Skip to content

Commit 4fe3dd4

Browse files
committed
[amqp-bunny] Do not use deprecated classes in producer and subscription consumer.
1 parent dee1f5a commit 4fe3dd4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

pkg/amqp-bunny/AmqpProducer.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
use Interop\Amqp\AmqpProducer as InteropAmqpProducer;
1313
use Interop\Amqp\AmqpQueue as InteropAmqpQueue;
1414
use Interop\Amqp\AmqpTopic as InteropAmqpTopic;
15+
use Interop\Queue\Destination;
1516
use Interop\Queue\Exception\DeliveryDelayNotSupportedException;
1617
use Interop\Queue\Exception\Exception;
1718
use Interop\Queue\Exception\InvalidDestinationException;
1819
use Interop\Queue\Exception\InvalidMessageException;
19-
use Interop\Queue\PsrDestination;
20-
use Interop\Queue\PsrMessage;
21-
use Interop\Queue\PsrProducer;
22-
use Interop\Queue\PsrTopic;
20+
use Interop\Queue\Message;
21+
use Interop\Queue\Producer;
22+
use Interop\Queue\Topic;
2323

2424
class AmqpProducer implements InteropAmqpProducer, DelayStrategyAware
2525
{
@@ -60,9 +60,9 @@ public function __construct(Channel $channel, AmqpContext $context)
6060
* @param InteropAmqpTopic|InteropAmqpQueue $destination
6161
* @param InteropAmqpMessage $message
6262
*/
63-
public function send(PsrDestination $destination, PsrMessage $message): void
63+
public function send(Destination $destination, Message $message): void
6464
{
65-
$destination instanceof PsrTopic
65+
$destination instanceof Topic
6666
? InvalidDestinationException::assertDestinationInstanceOf($destination, InteropAmqpTopic::class)
6767
: InvalidDestinationException::assertDestinationInstanceOf($destination, InteropAmqpQueue::class)
6868
;
@@ -79,7 +79,7 @@ public function send(PsrDestination $destination, PsrMessage $message): void
7979
/**
8080
* @return self
8181
*/
82-
public function setDeliveryDelay(int $deliveryDelay = null): PsrProducer
82+
public function setDeliveryDelay(int $deliveryDelay = null): Producer
8383
{
8484
if (null === $this->delayStrategy) {
8585
throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt();
@@ -98,7 +98,7 @@ public function getDeliveryDelay(): ?int
9898
/**
9999
* @return self
100100
*/
101-
public function setPriority(int $priority = null): PsrProducer
101+
public function setPriority(int $priority = null): Producer
102102
{
103103
$this->priority = $priority;
104104

@@ -113,7 +113,7 @@ public function getPriority(): ?int
113113
/**
114114
* @return self
115115
*/
116-
public function setTimeToLive(int $timeToLive = null): PsrProducer
116+
public function setTimeToLive(int $timeToLive = null): Producer
117117
{
118118
$this->timeToLive = $timeToLive;
119119

pkg/amqp-bunny/AmqpSubscriptionConsumer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use Enqueue\AmqpTools\SignalSocketHelper;
1212
use Interop\Amqp\AmqpConsumer as InteropAmqpConsumer;
1313
use Interop\Amqp\AmqpSubscriptionConsumer as InteropAmqpSubscriptionConsumer;
14+
use Interop\Queue\Consumer;
1415
use Interop\Queue\Exception\Exception;
15-
use Interop\Queue\PsrConsumer;
1616

1717
class AmqpSubscriptionConsumer implements InteropAmqpSubscriptionConsumer
1818
{
@@ -60,7 +60,7 @@ public function consume(int $timeout = 0): void
6060
/**
6161
* @param AmqpConsumer $consumer
6262
*/
63-
public function subscribe(PsrConsumer $consumer, callable $callback): void
63+
public function subscribe(Consumer $consumer, callable $callback): void
6464
{
6565
if (false == $consumer instanceof AmqpConsumer) {
6666
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, get_class($consumer)));
@@ -107,7 +107,7 @@ public function subscribe(PsrConsumer $consumer, callable $callback): void
107107
/**
108108
* @param AmqpConsumer $consumer
109109
*/
110-
public function unsubscribe(PsrConsumer $consumer): void
110+
public function unsubscribe(Consumer $consumer): void
111111
{
112112
if (false == $consumer instanceof AmqpConsumer) {
113113
throw new \InvalidArgumentException(sprintf('The consumer must be instance of "%s" got "%s"', AmqpConsumer::class, get_class($consumer)));

0 commit comments

Comments
 (0)