Skip to content

Fix PHP 8.4 deprecated nullable parameter warnings #623

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions src/Queue/RabbitMQQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ protected function publishBatch($jobs, $data = '', $queue = null): void
/**
* @throws AMQPProtocolChannelException
*/
public function bulkRaw(string $payload, string $queue = null, array $options = []): int|string|null
public function bulkRaw(string $payload, ?string $queue = null, array $options = []): int|string|null
{
[$destination, $exchange, $exchangeType, $attempts] = $this->publishProperties($queue, $options);

Expand Down Expand Up @@ -397,7 +397,7 @@ public function deleteExchange(string $name, bool $unused = false): void
*
* @throws AMQPProtocolChannelException
*/
public function isQueueExists(string $name = null): bool
public function isQueueExists(?string $name = null): bool
{
$queueName = $this->getQueue($name);

Expand Down Expand Up @@ -484,7 +484,7 @@ public function bindQueue(string $queue, string $exchange, string $routingKey =
/**
* Purge the queue of messages.
*/
public function purge(string $queue = null): void
public function purge(?string $queue = null): void
{
// create a temporary channel, so the main channel will not be closed on exception
$channel = $this->createChannel();
Expand Down Expand Up @@ -654,7 +654,7 @@ protected function getRoutingKey(string $destination): string
/**
* Get the exchangeType, or AMQPExchangeType::DIRECT as default.
*/
protected function getExchangeType(string $type = null): string
protected function getExchangeType(?string $type = null): string
{
$constant = AMQPExchangeType::class.'::'.Str::upper($type ?: $this->getConfig()->getExchangeType());

Expand Down Expand Up @@ -699,7 +699,7 @@ protected function isQueueDeclared(string $name): bool
*
* @throws AMQPProtocolChannelException
*/
protected function declareDestination(string $destination, string $exchange = null, string $exchangeType = AMQPExchangeType::DIRECT): void
protected function declareDestination(string $destination, ?string $exchange = null, string $exchangeType = AMQPExchangeType::DIRECT): void
{
// When an exchange is provided and no exchange is present in RabbitMQ, create an exchange.
if ($exchange && ! $this->isExchangeExists($exchange)) {
Expand Down
Loading