Skip to content

Commit ca6cd22

Browse files
authored
Merge pull request #616 from sergonie/php84
Fixed php-8.4 deprecations
2 parents 5f024c0 + c00a8cc commit ca6cd22

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

pint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"preset": "laravel",
33
"rules": {
4-
"nullable_type_declaration_for_default_null_value": {
5-
"use_nullable_type_declaration": false
4+
"php_unit_method_casing": {
5+
"case": "camel_case"
66
}
77
}
88
}

src/Horizon/RabbitMQQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RabbitMQQueue extends BaseRabbitMQQueue
2626
*
2727
* @throws AMQPProtocolChannelException
2828
*/
29-
public function readyNow(string $queue = null): int
29+
public function readyNow(?string $queue = null): int
3030
{
3131
return $this->size($queue);
3232
}

src/Queue/RabbitMQQueue.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected function publishBatch($jobs, $data = '', $queue = null): void
204204
/**
205205
* @throws AMQPProtocolChannelException
206206
*/
207-
public function bulkRaw(string $payload, string $queue = null, array $options = []): int|string|null
207+
public function bulkRaw(string $payload, ?string $queue = null, array $options = []): int|string|null
208208
{
209209
[$destination, $exchange, $exchangeType, $attempts] = $this->publishProperties($queue, $options);
210210

@@ -397,7 +397,7 @@ public function deleteExchange(string $name, bool $unused = false): void
397397
*
398398
* @throws AMQPProtocolChannelException
399399
*/
400-
public function isQueueExists(string $name = null): bool
400+
public function isQueueExists(?string $name = null): bool
401401
{
402402
$queueName = $this->getQueue($name);
403403

@@ -484,7 +484,7 @@ public function bindQueue(string $queue, string $exchange, string $routingKey =
484484
/**
485485
* Purge the queue of messages.
486486
*/
487-
public function purge(string $queue = null): void
487+
public function purge(?string $queue = null): void
488488
{
489489
// create a temporary channel, so the main channel will not be closed on exception
490490
$channel = $this->createChannel();
@@ -637,7 +637,7 @@ protected function getDelayQueueArguments(string $destination, int $ttl): array
637637
/**
638638
* Get the exchange name, or empty string; as default value.
639639
*/
640-
protected function getExchange(string $exchange = null): string
640+
protected function getExchange(?string $exchange = null): string
641641
{
642642
return $exchange ?? $this->getConfig()->getExchange();
643643
}
@@ -654,7 +654,7 @@ protected function getRoutingKey(string $destination): string
654654
/**
655655
* Get the exchangeType, or AMQPExchangeType::DIRECT as default.
656656
*/
657-
protected function getExchangeType(string $type = null): string
657+
protected function getExchangeType(?string $type = null): string
658658
{
659659
$constant = AMQPExchangeType::class.'::'.Str::upper($type ?: $this->getConfig()->getExchangeType());
660660

@@ -664,7 +664,7 @@ protected function getExchangeType(string $type = null): string
664664
/**
665665
* Get the exchange for failed messages.
666666
*/
667-
protected function getFailedExchange(string $exchange = null): string
667+
protected function getFailedExchange(?string $exchange = null): string
668668
{
669669
return $exchange ?? $this->getConfig()->getFailedExchange();
670670
}
@@ -699,7 +699,7 @@ protected function isQueueDeclared(string $name): bool
699699
*
700700
* @throws AMQPProtocolChannelException
701701
*/
702-
protected function declareDestination(string $destination, string $exchange = null, string $exchangeType = AMQPExchangeType::DIRECT): void
702+
protected function declareDestination(string $destination, ?string $exchange = null, string $exchangeType = AMQPExchangeType::DIRECT): void
703703
{
704704
// When an exchange is provided and no exchange is present in RabbitMQ, create an exchange.
705705
if ($exchange && ! $this->isExchangeExists($exchange)) {

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function getEnvironmentSetUp($app): void
5050
]);
5151
}
5252

53-
protected function connection(string $name = null): RabbitMQQueue
53+
protected function connection(?string $name = null): RabbitMQQueue
5454
{
5555
return Queue::connection($name);
5656
}

0 commit comments

Comments
 (0)