Skip to content

Commit 2845809

Browse files
committed
next bunch of static analysis fixes
1 parent b226c25 commit 2845809

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Instrumentation/Slim/src/CallableFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public static function format($callable): string
2222
if ($callable instanceof Closure || (is_string($callable) && function_exists($callable))) {
2323
$reflection = new ReflectionFunction($callable);
2424
$name = $reflection->getShortName();
25-
if ($name === '{closure}') {
26-
return $name;
25+
if ((PHP_VERSION_ID < 80400 && $name === '{closure}') || (PHP_VERSION_ID >= 80400 && str_contains($name, '{closure:'))) {
26+
return '{closure}';
2727
}
2828
$class = $reflection->getClosureScopeClass()?->getName() ?? '';
2929
if ($reflection->getClosureScopeClass()?->isAnonymous()) {

src/Instrumentation/Symfony/tests/Integration/SymfonyInstrumentationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function test_http_kernel_handle_subrequest(): void
204204
$this->assertSame(SpanKind::KIND_INTERNAL, $span->getKind());
205205
}
206206

207-
private function getHttpKernel(EventDispatcherInterface $eventDispatcher, $controller = null, RequestStack $requestStack = null, array $arguments = []): HttpKernel
207+
private function getHttpKernel(EventDispatcherInterface $eventDispatcher, $controller = null, ?RequestStack $requestStack = null, array $arguments = []): HttpKernel
208208
{
209209
$controller ??= fn () => new Response('Hello');
210210

src/Symfony/tests/Unit/OtelSdkBundle/Util/ServiceHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testFloatToString()
2828
ServiceHelper::floatToString(0.5)
2929
);
3030
$this->assertSame(
31-
'2.1234567890124',
31+
PHP_VERSION_ID < 80400 ? '2.1234567890124' : '2.1234567890123',
3232
ServiceHelper::floatToString(2.12345678901234567890)
3333
);
3434
}

0 commit comments

Comments
 (0)