Skip to content

Commit 26df896

Browse files
author
Oleg Namaka
committed
COW-9638 Update nack method to return bool instead of void to match 5.10 and 7.0+
- Change return type from void to bool in Connection::nack() - Return the result of the underlying AMQPQueue::nack() call - This allows callers to determine if the nack operation was successful
1 parent bc36e3b commit 26df896

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,9 @@ public function ack(\AMQPEnvelope $message, string $queueName, int $flags = \AMQ
491491
$this->queue($queueName)->ack($message->getDeliveryTag(), $flags);
492492
}
493493

494-
public function nack(\AMQPEnvelope $message, string $queueName, int $flags = \AMQP_NOPARAM): void
494+
public function nack(\AMQPEnvelope $message, string $queueName, int $flags = \AMQP_NOPARAM): bool
495495
{
496-
$this->queue($queueName)->nack($message->getDeliveryTag(), $flags);
496+
return $this->queue($queueName)->nack($message->getDeliveryTag(), $flags) ?? true;
497497
}
498498

499499
public function setup(): void

0 commit comments

Comments
 (0)