From dd15fbec84655ce56469ebf76920f88a90eb5cfd Mon Sep 17 00:00:00 2001 From: Andreas Fridlund Date: Fri, 20 Dec 2024 08:27:16 +0100 Subject: [PATCH] Add PHP 8.4 support --- src/Jaeger/Config.php | 6 +++--- src/Jaeger/Reporter/LoggingReporter.php | 2 +- src/Jaeger/ScopeManager.php | 2 +- src/Jaeger/Sender/JaegerSender.php | 4 ++-- src/Jaeger/Sender/UdpSender.php | 2 +- src/Jaeger/ThriftUdpTransport.php | 2 +- src/Jaeger/Tracer.php | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Jaeger/Config.php b/src/Jaeger/Config.php index de08f3f..2f6e2c9 100644 --- a/src/Jaeger/Config.php +++ b/src/Jaeger/Config.php @@ -87,9 +87,9 @@ public function getLogger() */ public function __construct( array $config, - string $serviceName = null, - LoggerInterface $logger = null, - CacheItemPoolInterface $cache = null + ?string $serviceName = null, + ?LoggerInterface $logger = null, + ?CacheItemPoolInterface $cache = null ) { $this->config = $config; diff --git a/src/Jaeger/Reporter/LoggingReporter.php b/src/Jaeger/Reporter/LoggingReporter.php index 264ea94..c96e81c 100644 --- a/src/Jaeger/Reporter/LoggingReporter.php +++ b/src/Jaeger/Reporter/LoggingReporter.php @@ -21,7 +21,7 @@ class LoggingReporter implements ReporterInterface * * @param LoggerInterface|null $logger */ - public function __construct(LoggerInterface $logger = null) + public function __construct(?LoggerInterface $logger = null) { $this->logger = $logger ?? new NullLogger(); } diff --git a/src/Jaeger/ScopeManager.php b/src/Jaeger/ScopeManager.php index eb5c276..11426f4 100644 --- a/src/Jaeger/ScopeManager.php +++ b/src/Jaeger/ScopeManager.php @@ -38,7 +38,7 @@ public function getActive(): ?OTScope * Sets the scope as active. * @param OTScope|null $scope */ - public function setActive(OTScope $scope = null) + public function setActive(?OTScope $scope = null) { $this->active = $scope; } diff --git a/src/Jaeger/Sender/JaegerSender.php b/src/Jaeger/Sender/JaegerSender.php index dfce510..489f64c 100644 --- a/src/Jaeger/Sender/JaegerSender.php +++ b/src/Jaeger/Sender/JaegerSender.php @@ -66,8 +66,8 @@ class JaegerSender implements SenderInterface */ public function __construct( AgentIf $agentClient, - LoggerInterface $logger = null, - SpanToJaegerMapper $mapper = null + ?LoggerInterface $logger = null, + ?SpanToJaegerMapper $mapper = null ) { $this->agentClient = $agentClient; $this->logger = $logger ?? new NullLogger(); diff --git a/src/Jaeger/Sender/UdpSender.php b/src/Jaeger/Sender/UdpSender.php index ff0e4cf..7cafca8 100644 --- a/src/Jaeger/Sender/UdpSender.php +++ b/src/Jaeger/Sender/UdpSender.php @@ -62,7 +62,7 @@ class UdpSender public function __construct( AgentClient $client, int $maxBufferLength, - LoggerInterface $logger = null + ?LoggerInterface $logger = null ) { $this->client = $client; $this->maxBufferLength = $maxBufferLength; diff --git a/src/Jaeger/ThriftUdpTransport.php b/src/Jaeger/ThriftUdpTransport.php index babc689..87f9f9c 100644 --- a/src/Jaeger/ThriftUdpTransport.php +++ b/src/Jaeger/ThriftUdpTransport.php @@ -36,7 +36,7 @@ class ThriftUdpTransport extends TTransport * @param int $port * @param LoggerInterface $logger */ - public function __construct(string $host, int $port, LoggerInterface $logger = null, Config $config = null) + public function __construct(string $host, int $port, ?LoggerInterface $logger = null, ?Config $config = null) { $this->setLogger($logger); diff --git a/src/Jaeger/Tracer.php b/src/Jaeger/Tracer.php index bb0649a..07f1640 100644 --- a/src/Jaeger/Tracer.php +++ b/src/Jaeger/Tracer.php @@ -96,8 +96,8 @@ public function __construct( ReporterInterface $reporter, SamplerInterface $sampler, $oneSpanPerRpc = true, - LoggerInterface $logger = null, - ScopeManager $scopeManager = null, + ?LoggerInterface $logger = null, + ?ScopeManager $scopeManager = null, $traceIdHeader = TRACE_ID_HEADER, $baggageHeaderPrefix = BAGGAGE_HEADER_PREFIX, $debugIdHeader = DEBUG_ID_HEADER_KEY,