| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | final class Reject |
||
| 7 | { |
||
| 8 | private $deliveryTag; |
||
| 9 | private $requeue = false; |
||
| 10 | |||
| 11 | 32 | public function __construct(int $deliveryTag) |
|
| 14 | 32 | } |
|
| 15 | |||
| 16 | /** |
||
| 17 | * This will requeue unacknowledged messages meaning they may be delivered |
||
| 18 | * to a different consumer that the original one |
||
| 19 | */ |
||
| 20 | 18 | public static function requeue(int $deliveryTag): self |
|
| 21 | { |
||
| 22 | 18 | $self = new self($deliveryTag); |
|
| 23 | 18 | $self->requeue = true; |
|
| 24 | |||
| 25 | 18 | return $self; |
|
| 26 | } |
||
| 27 | |||
| 28 | 28 | public function deliveryTag(): int |
|
| 29 | { |
||
| 30 | 28 | return $this->deliveryTag; |
|
| 31 | } |
||
| 32 | |||
| 33 | 28 | public function shouldRequeue(): bool |
|
| 36 | } |
||
| 37 | } |
||
| 38 |