Skip to content

Commit

Permalink
Remove implicit nullable typehints for PHP 8.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
janlanger committed Dec 18, 2024
1 parent 93f464e commit 90e4a0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ChannelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

2 changes: 1 addition & 1 deletion test/Library/SynchronousClientHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? []);

Expand Down

0 comments on commit 90e4a0b

Please sign in to comment.