From 90e4a0b84f8a69fa7831e2332ca74a83d27587b6 Mon Sep 17 00:00:00 2001 From: Jan Langer Date: Wed, 18 Dec 2024 15:54:27 +0100 Subject: [PATCH] Remove implicit nullable typehints for PHP 8.4 compatibility --- src/Channel.php | 4 ++-- src/ChannelInterface.php | 2 +- test/Library/SynchronousClientHelper.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Channel.php b/src/Channel.php index c395a3f..9aadd92 100644 --- a/src/Channel.php +++ b/src/Channel.php @@ -382,7 +382,7 @@ public function txRollback(): \Bunny\Protocol\MethodTxRollbackOkFrame /** * Changes channel to confirm mode. Broker then asynchronously sends 'basic.ack's for published messages. */ - public function confirmSelect(callable $callback = null, bool $nowait = false): \Bunny\Protocol\MethodConfirmSelectOkFrame + public function confirmSelect(?callable $callback = null, bool $nowait = false): \Bunny\Protocol\MethodConfirmSelectOkFrame { if ($this->mode !== ChannelMode::Regular) { throw new ChannelException("Channel not in regular mode, cannot change to transactional mode."); @@ -394,7 +394,7 @@ public function confirmSelect(callable $callback = null, bool $nowait = false): return $response; } - private function enterConfirmMode(callable $callback = null): void + private function enterConfirmMode(?callable $callback = null): void { $this->mode = ChannelMode::Confirm; $this->deliveryTag = 0; diff --git a/src/ChannelInterface.php b/src/ChannelInterface.php index 4333a2e..312f0d3 100644 --- a/src/ChannelInterface.php +++ b/src/ChannelInterface.php @@ -114,6 +114,6 @@ public function txRollback(): \Bunny\Protocol\MethodTxRollbackOkFrame; /** * Changes channel to confirm mode. Broker then asynchronously sends 'basic.ack's for published messages. */ - public function confirmSelect(callable $callback = null, bool $nowait = false): \Bunny\Protocol\MethodConfirmSelectOkFrame; + public function confirmSelect(?callable $callback = null, bool $nowait = false): \Bunny\Protocol\MethodConfirmSelectOkFrame; } diff --git a/test/Library/SynchronousClientHelper.php b/test/Library/SynchronousClientHelper.php index c6fc506..19e07dc 100644 --- a/test/Library/SynchronousClientHelper.php +++ b/test/Library/SynchronousClientHelper.php @@ -14,7 +14,7 @@ final class SynchronousClientHelper extends AbstractClientHelper * * @return Client */ - public function createClient(array $options = null): Client + public function createClient(?array $options = null): Client { $options = array_merge($this->getDefaultOptions(), $options ?? []);