Skip to content

Commit da3572b

Browse files
authored
[PHP 8.4] Fixes for implicit nullability deprecation (#1297)
1 parent 2b590b5 commit da3572b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Propagation/NoopTextMapPropagator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public function fields(): array
2525
return [];
2626
}
2727

28-
public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface
28+
public function extract($carrier, ?PropagationGetterInterface $getter = null, ?ContextInterface $context = null): ContextInterface
2929
{
3030
return $context ?? Context::getCurrent();
3131
}
3232

33-
public function inject(&$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void
33+
public function inject(&$carrier, ?PropagationSetterInterface $setter = null, ?ContextInterface $context = null): void
3434
{
3535
}
3636
}

Propagation/TextMapPropagatorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public function fields() : array;
2626
*
2727
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/context/api-propagators.md#textmap-inject
2828
*/
29-
public function inject(mixed &$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void;
29+
public function inject(mixed &$carrier, ?PropagationSetterInterface $setter = null, ?ContextInterface $context = null): void;
3030

3131
/**
3232
* Extracts specific values from the provided carrier into the provided {@see ContextInterface}
3333
* via an {@see PropagationGetterInterface}.
3434
*
3535
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/context/api-propagators.md#textmap-extract
3636
*/
37-
public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface;
37+
public function extract($carrier, ?PropagationGetterInterface $getter = null, ?ContextInterface $context = null): ContextInterface;
3838
}

0 commit comments

Comments
 (0)