Skip to content

Commit ca8e2ba

Browse files
authored
Symfony Instrumentation - fix warning if request options are not passed (#160)
1 parent 3430992 commit ca8e2ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/HttpClientInstrumentation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public static function register(): void
3333
?string $filename,
3434
?int $lineno,
3535
) use ($instrumentation): array {
36-
$requestOptions = $params[2];
3736
/** @psalm-suppress ArgumentTypeCoercion */
3837
$builder = $instrumentation
3938
->tracer()
@@ -53,6 +52,8 @@ public static function register(): void
5352
->setParent($parent)
5453
->startSpan();
5554

55+
$requestOptions = $params[2] ?? [];
56+
5657
if (!isset($requestOptions['headers'])) {
5758
$requestOptions['headers'] = [];
5859
}

0 commit comments

Comments
 (0)