Skip to content

Commit 636c716

Browse files
committed
replace with php72 equivalents
1 parent aa38993 commit 636c716

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/FrameBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private function getFunctionArguments(array $backtraceFrame): array
179179
} else {
180180
$reflectionFunction = new \ReflectionMethod($backtraceFrame['class'], '__call');
181181
}
182-
} elseif ($backtraceFrame['function'] !== '__lambda_func' && !str_starts_with($backtraceFrame['function'], '{closure') && \function_exists($backtraceFrame['function'])) {
182+
} elseif ($backtraceFrame['function'] !== '__lambda_func' && strpos($backtraceFrame['function'], '{closure') !== 0 && \function_exists($backtraceFrame['function'])) {
183183
$reflectionFunction = new \ReflectionFunction($backtraceFrame['function']);
184184
}
185185
} catch (\ReflectionException $e) {

src/Tracing/DynamicSamplingContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static function fromHeader(string $header): self
125125
$keyValueAndProperties = explode(';', $listMember, 2);
126126
$keyValue = trim($keyValueAndProperties[0]);
127127

128-
if (!str_contains($keyValue, '=')) {
128+
if (strpos($keyValue, '=') === false) {
129129
continue;
130130
}
131131

tests/Logs/LogsAggregatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testAttributes(array $attributes, array $expected): void
5252
$log->attributes()->toSimpleArray(),
5353
static function (string $key) {
5454
// We are not testing internal Sentry attributes here, only the ones the user supplied
55-
return !str_starts_with($key, 'sentry.');
55+
return strpos($key, 'sentry.') !== 0;
5656
},
5757
\ARRAY_FILTER_USE_KEY
5858
)

tests/Monolog/LogsHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testHandle($record, Log $expectedLog): void
5353
$log->attributes()->toSimpleArray(),
5454
static function (string $key) {
5555
// We are not testing Sentry's own attributes here, only the ones the user supplied so filter them out of the expected attributes
56-
return !str_starts_with($key, 'sentry.');
56+
return strpos($key, 'sentry.') !== 0;
5757
},
5858
\ARRAY_FILTER_USE_KEY
5959
)

0 commit comments

Comments
 (0)