Skip to content

Commit

Permalink
fixing implicit nullable deprecations for 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed Aug 21, 2024
1 parent c6c4b3c commit b15ed1d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Aws/src/Xray/Propagator.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function fields(): array
* X-Amzn-Trace-Id: Root={traceId};Parent={parentId};Sampled={samplingFlag}
* X-Amzn-Trace-Id: Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;Sampled=1
*/
public function inject(&$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void
public function inject(&$carrier, ?PropagationSetterInterface $setter = null, ?ContextInterface $context = null): void
{
$setter = $setter ?? ArrayAccessGetterSetter::getInstance();
$context = $context ?? Context::getCurrent();
Expand Down Expand Up @@ -102,7 +102,7 @@ public function inject(&$carrier, PropagationSetterInterface $setter = null, Con
* This function will parse all parts of the header and validate that it is
* formatted properly to AWS X-ray standards
*/
public function extract($carrier, PropagationGetterInterface $getter = null, ContextInterface $context = null): ContextInterface
public function extract($carrier, ?PropagationGetterInterface $getter = null, ?ContextInterface $context = null): ContextInterface
{
$getter = $getter ?? ArrayAccessGetterSetter::getInstance();
$context = $context ?? Context::getCurrent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait AttributesBuilder
private function buildMessageAttributes(
QueueContract $queue,
string $rawPayload,
string $queueName = null,
?string $queueName = null,
array $options = [],
mixed ...$params,
): array {
Expand All @@ -38,7 +38,7 @@ private function buildMessageAttributes(
private function contextualMessageSystemAttributes(
QueueContract $queue,
array $payload,
string $queueName = null,
?string $queueName = null,
array $options = [],
mixed ...$params,
): array {
Expand All @@ -50,23 +50,23 @@ private function contextualMessageSystemAttributes(
};
}

private function beanstalkContextualAttributes(BeanstalkdQueue $queue, array $payload, string $queueName = null, array $options = [], mixed ...$params): array
private function beanstalkContextualAttributes(BeanstalkdQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
{
return [
TraceAttributes::MESSAGING_SYSTEM => 'beanstalk',
TraceAttributes::MESSAGING_DESTINATION_NAME => $queue->getQueue($queueName),
];
}

private function redisContextualAttributes(RedisQueue $queue, array $payload, string $queueName = null, array $options = [], mixed ...$params): array
private function redisContextualAttributes(RedisQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
{
return [
TraceAttributes::MESSAGING_SYSTEM => 'redis',
TraceAttributes::MESSAGING_DESTINATION_NAME => $queue->getQueue($queueName),
];
}

private function awsSqsContextualAttributes(SqsQueue $queue, array $payload, string $queueName = null, array $options = [], mixed ...$params): array
private function awsSqsContextualAttributes(SqsQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
{
return [
TraceAttributes::MESSAGING_SYSTEM => TraceAttributeValues::MESSAGING_SYSTEM_AWS_SQS,
Expand Down
2 changes: 1 addition & 1 deletion src/Propagation/ServerTiming/src/ResponsePropagator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ interface ResponsePropagator
*
* @param mixed $carrier
*/
public function inject(&$carrier, PropagationSetterInterface $setter = null, ContextInterface $context = null): void;
public function inject(&$carrier, ?PropagationSetterInterface $setter = null, ?ContextInterface $context = null): void;
}
4 changes: 2 additions & 2 deletions src/ResourceDetectors/Azure/src/Vm/Detector.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class Detector implements ResourceDetectorInterface
private RequestFactoryInterface $requestFactory;

public function __construct(
ClientInterface $client = null,
RequestFactoryInterface $requestFactory = null
?ClientInterface $client = null,
?RequestFactoryInterface $requestFactory = null
) {
$this->client = $client ?: Psr18ClientDiscovery::find();
$this->requestFactory = $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
use Throwable;

class OtelDataCollector extends DataCollector implements LateDataCollectorInterface, InstrumentationInterface
{
Expand All @@ -27,7 +28,7 @@ public function reset(): void
/**
* {@inheritDoc}
*/
public function collect(Request $request, Response $response, \Throwable $exception = null): void
public function collect(Request $request, Response $response, ?Throwable $exception = null): void
{
// Everything is collected during the request, and formatted on kernel terminate.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function forceFlush(?CancellationInterface $cancellation = null): bool
return $this->spanProcessor->forceFlush();
}

public function shutdown(CancellationInterface $cancellation = null): bool
public function shutdown(?CancellationInterface $cancellation = null): bool
{
return $this->spanProcessor->shutdown();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ private function createValidatedReference(string $id): Reference
* @param array $arguments
* @return Definition
*/
private static function createDefinition(string $class = null, array $arguments = []): Definition
private static function createDefinition(?string $class = null, array $arguments = []): Definition
{
return new Definition($class, $arguments);
}
Expand Down

0 comments on commit b15ed1d

Please sign in to comment.