Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove implicit nullable typehints for PHP 8.4 compatibility #162

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading