Skip to content

Commit 3fd3101

Browse files
authored
PHP 8.4 - Fixes for implicit nullability deprecation (open-telemetry#328)
1 parent ee99079 commit 3fd3101

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Instrumentation/ExtRdKafka/tests/Integration/ExtRdKafkaInstrumentationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function test_produce_creates_new_span()
136136
private function produceMessage(
137137
string $message,
138138
?string $key = null,
139-
array $headers = null,
139+
?array $headers = null,
140140
bool $produceWithoutHeaders = false
141141
): void {
142142
$conf = new Conf();
@@ -163,7 +163,7 @@ private function consumeMessage(): int|Message
163163
{
164164
$conf = new Conf();
165165

166-
$conf->setRebalanceCb(function (KafkaConsumer $kafka, $err, array $partitions = null) {
166+
$conf->setRebalanceCb(function (KafkaConsumer $kafka, $err, ?array $partitions = null) {
167167
switch ($err) {
168168
case RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS:
169169
$kafka->assign($partitions);

src/Instrumentation/HttpAsyncClient/tests/Integration/HttpAsyncClientInstrumentationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function __construct($response)
9494
$this->response = $response;
9595
}
9696

97-
public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
97+
public function then(?callable $onFulfilled = null, ?callable $onRejected = null): Promise
9898
{
9999
$this->onFulfilled = $onFulfilled;
100100
$this->onRejected = $onRejected;

src/Instrumentation/MongoDB/src/MongoDBInstrumentation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class MongoDBInstrumentation
1414
/**
1515
* @param callable(object):?string $commandSerializer
1616
*/
17-
public static function register(callable $commandSerializer = null): void
17+
public static function register(?callable $commandSerializer = null): void
1818
{
1919
$instrumentation = new CachedInstrumentation(
2020
'io.opentelemetry.contrib.php.mongodb',

src/Symfony/tests/Unit/OtelSdkBundle/Factory/GenericFactoryTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class TestedDefaultNullClass
395395
private $fooBar;
396396
private $fooBaz;
397397

398-
public function __construct(string $fooBar, stdClass $fooBaz = null)
398+
public function __construct(string $fooBar, ?stdClass $fooBaz = null)
399399
{
400400
$this->fooBar = $fooBar;
401401
$this->fooBaz = $fooBaz;

0 commit comments

Comments
 (0)