Skip to content

Commit 976a85a

Browse files
authored
fix php8.4 nullable configuration (#134)
1 parent 7ab2080 commit 976a85a

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ return PhpCsFixer\Config::create()
2626
'header' => $header,
2727
'location' => 'after_open',
2828
],
29+
'nullable_type_declaration_for_default_null_value' => true,
2930
))
3031
->setFinder($finder)
3132
;

EnvelopeItem/TransportConfiguration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,28 @@ public function addMetadata(string $key, $value): self
7171
return $this;
7272
}
7373

74-
public function setPriority(int $priority = null): self
74+
public function setPriority(?int $priority = null): self
7575
{
7676
$this->metadata['priority'] = $priority;
7777

7878
return $this;
7979
}
8080

81-
public function setDeliveryDelay(int $deliveryDelay = null): self
81+
public function setDeliveryDelay(?int $deliveryDelay = null): self
8282
{
8383
$this->metadata['deliveryDelay'] = $deliveryDelay;
8484

8585
return $this;
8686
}
8787

88-
public function setDelayStrategy(DelayStrategy $delayStrategy = null): self
88+
public function setDelayStrategy(?DelayStrategy $delayStrategy = null): self
8989
{
9090
$this->metadata['delayStrategy'] = $delayStrategy;
9191

9292
return $this;
9393
}
9494

95-
public function setTimeToLive(int $timeToLive = null): self
95+
public function setTimeToLive(?int $timeToLive = null): self
9696
{
9797
$this->metadata['timeToLive'] = $timeToLive;
9898

QueueInteropTransportFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function createSender(string $dsn, array $options): TransportInterface
4747
return $this->createTransport($dsn, $options);
4848
}
4949

50-
public function createTransport(string $dsn, array $options, SerializerInterface $serializer = null): TransportInterface
50+
public function createTransport(string $dsn, array $options, ?SerializerInterface $serializer = null): TransportInterface
5151
{
5252
[$contextManager, $dsnOptions] = $this->parseDsn($dsn);
5353

Tests/QueueInteropTransportFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testItThrowsAnExceptionWhenContextDoesNotExist()
9898
$factory->createTransport('enqueue://foo', array());
9999
}
100100

101-
private function getFactory(SerializerInterface $serializer = null, ContainerInterface $container = null, $debug = true)
101+
private function getFactory(?SerializerInterface $serializer = null, ?ContainerInterface $container = null, $debug = true)
102102
{
103103
return new QueueInteropTransportFactory(
104104
$serializer ?: $this->prophesize(SerializerInterface::class)->reveal(),

Tests/QueueInteropTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ public function testNullHandler()
544544
}
545545

546546
private function getTransport(
547-
SerializerInterface $serializer = null,
548-
ContextManager $contextManager = null,
547+
?SerializerInterface $serializer = null,
548+
?ContextManager $contextManager = null,
549549
array $options = array(),
550550
$debug = false
551551
) {

0 commit comments

Comments
 (0)