From f74cbed0247f2121d7a6994fd72d497d9ec27cb2 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Sat, 7 Sep 2024 08:51:46 +1000 Subject: [PATCH] fix withspan handler nullable + example (#1377) - class is nullable for pre hooks - add phpt tests for withspan and its interaction with auto root span --- Instrumentation/WithSpanHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Instrumentation/WithSpanHandler.php b/Instrumentation/WithSpanHandler.php index f0f0dc9..979ebcd 100644 --- a/Instrumentation/WithSpanHandler.php +++ b/Instrumentation/WithSpanHandler.php @@ -18,7 +18,7 @@ class WithSpanHandler /** * @psalm-suppress ArgumentTypeCoercion */ - public static function pre(mixed $target, array $params, string $class, string $function, ?string $filename, ?int $lineno, ?array $span_args = [], ?array $attributes = []): void + public static function pre(mixed $target, array $params, ?string $class, string $function, ?string $filename, ?int $lineno, ?array $span_args = [], ?array $attributes = []): void { static $instrumentation; $instrumentation ??= new CachedInstrumentation(name: 'io.opentelemetry.php.with-span', schemaUrl: 'https://opentelemetry.io/schemas/1.25.0');