Skip to content

Commit 2e315cb

Browse files
authored
fixing implicit nullable deprecations for 8.4 (#288)
1 parent c6c4b3c commit 2e315cb

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

src/Aws/src/Xray/Propagator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function fields(): array
7373
* X-Amzn-Trace-Id: Root={traceId};Parent={parentId};Sampled={samplingFlag}
7474
* X-Amzn-Trace-Id: Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;Sampled=1
7575
*/
76-
public function inject(&$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void
76+
public function inject(&$carrier, ?PropagationSetterInterface $setter = null, ?ContextInterface $context = null): void
7777
{
7878
$setter = $setter ?? ArrayAccessGetterSetter::getInstance();
7979
$context = $context ?? Context::getCurrent();
@@ -102,7 +102,7 @@ public function inject(&$carrier, PropagationSetterInterface $setter = null, Con
102102
* This function will parse all parts of the header and validate that it is
103103
* formatted properly to AWS X-ray standards
104104
*/
105-
public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface
105+
public function extract($carrier, ?PropagationGetterInterface $getter = null, ?ContextInterface $context = null): ContextInterface
106106
{
107107
$getter = $getter ?? ArrayAccessGetterSetter::getInstance();
108108
$context = $context ?? Context::getCurrent();

src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/AttributesBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait AttributesBuilder
1616
private function buildMessageAttributes(
1717
QueueContract $queue,
1818
string $rawPayload,
19-
string $queueName = null,
19+
?string $queueName = null,
2020
array $options = [],
2121
mixed ...$params,
2222
): array {
@@ -38,7 +38,7 @@ private function buildMessageAttributes(
3838
private function contextualMessageSystemAttributes(
3939
QueueContract $queue,
4040
array $payload,
41-
string $queueName = null,
41+
?string $queueName = null,
4242
array $options = [],
4343
mixed ...$params,
4444
): array {
@@ -50,23 +50,23 @@ private function contextualMessageSystemAttributes(
5050
};
5151
}
5252

53-
private function beanstalkContextualAttributes(BeanstalkdQueue $queue, array $payload, string $queueName = null, array $options = [], mixed ...$params): array
53+
private function beanstalkContextualAttributes(BeanstalkdQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
5454
{
5555
return [
5656
TraceAttributes::MESSAGING_SYSTEM => 'beanstalk',
5757
TraceAttributes::MESSAGING_DESTINATION_NAME => $queue->getQueue($queueName),
5858
];
5959
}
6060

61-
private function redisContextualAttributes(RedisQueue $queue, array $payload, string $queueName = null, array $options = [], mixed ...$params): array
61+
private function redisContextualAttributes(RedisQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
6262
{
6363
return [
6464
TraceAttributes::MESSAGING_SYSTEM => 'redis',
6565
TraceAttributes::MESSAGING_DESTINATION_NAME => $queue->getQueue($queueName),
6666
];
6767
}
6868

69-
private function awsSqsContextualAttributes(SqsQueue $queue, array $payload, string $queueName = null, array $options = [], mixed ...$params): array
69+
private function awsSqsContextualAttributes(SqsQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
7070
{
7171
return [
7272
TraceAttributes::MESSAGING_SYSTEM => TraceAttributeValues::MESSAGING_SYSTEM_AWS_SQS,

src/Propagation/ServerTiming/src/ResponsePropagator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ interface ResponsePropagator
2020
*
2121
* @param mixed $carrier
2222
*/
23-
public function inject(&$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void;
23+
public function inject(&$carrier, ?PropagationSetterInterface $setter = null, ?ContextInterface $context = null): void;
2424
}

src/ResourceDetectors/Azure/src/Vm/Detector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class Detector implements ResourceDetectorInterface
4646
private RequestFactoryInterface $requestFactory;
4747

4848
public function __construct(
49-
ClientInterface $client = null,
50-
RequestFactoryInterface $requestFactory = null
49+
?ClientInterface $client = null,
50+
?RequestFactoryInterface $requestFactory = null
5151
) {
5252
$this->client = $client ?: Psr18ClientDiscovery::find();
5353
$this->requestFactory = $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory();

src/Symfony/src/OtelSdkBundle/DataCollector/OtelDataCollector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Symfony\Component\HttpFoundation\Response;
1313
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1414
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
15+
use Throwable;
1516

1617
class OtelDataCollector extends DataCollector implements LateDataCollectorInterface, InstrumentationInterface
1718
{
@@ -27,7 +28,7 @@ public function reset(): void
2728
/**
2829
* {@inheritDoc}
2930
*/
30-
public function collect(Request $request, Response $response, \Throwable $exception = null): void
31+
public function collect(Request $request, Response $response, ?Throwable $exception = null): void
3132
{
3233
// Everything is collected during the request, and formatted on kernel terminate.
3334
}

src/Symfony/src/OtelSdkBundle/Debug/TraceableSpanProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function forceFlush(?CancellationInterface $cancellation = null): bool
5050
return $this->spanProcessor->forceFlush();
5151
}
5252

53-
public function shutdown(CancellationInterface $cancellation = null): bool
53+
public function shutdown(?CancellationInterface $cancellation = null): bool
5454
{
5555
return $this->spanProcessor->shutdown();
5656
}

src/Symfony/src/OtelSdkBundle/DependencyInjection/OtelSdkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ private function createValidatedReference(string $id): Reference
736736
* @param array $arguments
737737
* @return Definition
738738
*/
739-
private static function createDefinition(string $class = null, array $arguments = []): Definition
739+
private static function createDefinition(?string $class = null, array $arguments = []): Definition
740740
{
741741
return new Definition($class, $arguments);
742742
}

0 commit comments

Comments
 (0)