Skip to content

Commit 8ce999c

Browse files
committed
[enqueue] Do not use deprecated classes.
1 parent 2006d62 commit 8ce999c

File tree

72 files changed

+666
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+666
-678
lines changed

pkg/enqueue/Client/ArrayProcessorRegistry.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33
namespace Enqueue\Client;
44

5-
use Interop\Queue\PsrProcessor;
5+
use Interop\Queue\Processor;
66

77
class ArrayProcessorRegistry implements ProcessorRegistryInterface
88
{
99
/**
10-
* @var PsrProcessor[]
10+
* @var Processor[]
1111
*/
1212
private $processors;
1313

1414
/**
15-
* @param PsrProcessor[] $processors
15+
* @param Processor[] $processors
1616
*/
1717
public function __construct(array $processors = [])
1818
{
1919
$this->processors = $processors;
2020
}
2121

22-
public function add(string $name, PsrProcessor $processor): void
22+
public function add(string $name, Processor $processor): void
2323
{
2424
$this->processors[$name] = $processor;
2525
}
2626

27-
public function get(string $processorName): PsrProcessor
27+
public function get(string $processorName): Processor
2828
{
2929
if (false == isset($this->processors[$processorName])) {
3030
throw new \LogicException(sprintf('Processor was not found. processorName: "%s"', $processorName));

pkg/enqueue/Client/ConsumptionExtension/DelayRedeliveredMessageExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(DriverInterface $driver, $delay)
4141
*/
4242
public function onPreReceived(Context $context)
4343
{
44-
$message = $context->getPsrMessage();
44+
$message = $context->getInteropMessage();
4545
if (false == $message->isRedelivered()) {
4646
return;
4747
}

pkg/enqueue/Client/ConsumptionExtension/ExclusiveCommandExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(DriverInterface $driver)
3030

3131
public function onPreReceived(Context $context)
3232
{
33-
$message = $context->getPsrMessage();
33+
$message = $context->getInteropMessage();
3434
$queue = $context->getPsrQueue();
3535

3636
if ($message->getProperty(Config::PARAMETER_TOPIC_NAME)) {

pkg/enqueue/Client/ConsumptionExtension/SetRouterPropertiesExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(DriverInterface $driver)
2727

2828
public function onPreReceived(Context $context)
2929
{
30-
$message = $context->getPsrMessage();
30+
$message = $context->getInteropMessage();
3131
if ($message->getProperty(Config::PARAMETER_PROCESSOR_NAME)) {
3232
return;
3333
}

pkg/enqueue/Client/DelegateProcessor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Enqueue\Client;
44

5-
use Interop\Queue\PsrContext;
6-
use Interop\Queue\PsrMessage;
7-
use Interop\Queue\PsrProcessor;
5+
use Interop\Queue\Context;
6+
use Interop\Queue\Message as InteropMessage;
7+
use Interop\Queue\Processor;
88

9-
class DelegateProcessor implements PsrProcessor
9+
class DelegateProcessor implements Processor
1010
{
1111
/**
1212
* @var ProcessorRegistryInterface
@@ -24,7 +24,7 @@ public function __construct(ProcessorRegistryInterface $registry)
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
public function process(PsrMessage $message, PsrContext $context)
27+
public function process(InteropMessage $message, Context $context)
2828
{
2929
$processorName = $message->getProperty(Config::PARAMETER_PROCESSOR_NAME);
3030
if (false == $processorName) {

pkg/enqueue/Client/Driver/AmqpDriver.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
use Interop\Amqp\AmqpQueue;
1212
use Interop\Amqp\AmqpTopic;
1313
use Interop\Amqp\Impl\AmqpBind;
14-
use Interop\Queue\PsrDestination;
15-
use Interop\Queue\PsrMessage;
16-
use Interop\Queue\PsrProducer;
14+
use Interop\Queue\Destination;
15+
use Interop\Queue\Message as InteropMessage;
16+
use Interop\Queue\Producer as InteropProducer;
1717
use Interop\Queue\PsrQueue;
1818
use Psr\Log\LoggerInterface;
1919
use Psr\Log\NullLogger;
@@ -31,7 +31,7 @@ public function __construct(AmqpContext $context, ...$args)
3131
/**
3232
* @return AmqpMessage
3333
*/
34-
public function createTransportMessage(Message $clientMessage): PsrMessage
34+
public function createTransportMessage(Message $clientMessage): InteropMessage
3535
{
3636
/** @var AmqpMessage $transportMessage */
3737
$transportMessage = parent::createTransportMessage($clientMessage);
@@ -96,7 +96,7 @@ public function setupBroker(LoggerInterface $logger = null): void
9696
/**
9797
* @return AmqpTopic
9898
*/
99-
protected function createRouterTopic(): PsrDestination
99+
protected function createRouterTopic(): Destination
100100
{
101101
$topic = $this->doCreateTopic(
102102
$this->createTransportRouterTopicName($this->getConfig()->getRouterTopicName(), true)
@@ -124,7 +124,7 @@ protected function doCreateQueue(string $transportQueueName): PsrQueue
124124
* @param AmqpTopic $topic
125125
* @param AmqpMessage $transportMessage
126126
*/
127-
protected function doSendToRouter(PsrProducer $producer, PsrDestination $topic, PsrMessage $transportMessage): void
127+
protected function doSendToRouter(InteropProducer $producer, Destination $topic, InteropMessage $transportMessage): void
128128
{
129129
// We should not handle priority, expiration, and delay at this stage.
130130
// The router will take care of it while re-sending the message to the final destinations.

pkg/enqueue/Client/Driver/GenericDriver.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
use Enqueue\Client\MessagePriority;
1111
use Enqueue\Client\Route;
1212
use Enqueue\Client\RouteCollection;
13-
use Interop\Queue\PsrContext;
14-
use Interop\Queue\PsrDestination;
15-
use Interop\Queue\PsrMessage;
16-
use Interop\Queue\PsrProducer;
13+
use Interop\Queue\Context;
14+
use Interop\Queue\Destination;
15+
use Interop\Queue\Message as InteropMessage;
16+
use Interop\Queue\Producer as InteropProducer;
1717
use Interop\Queue\PsrQueue;
1818
use Interop\Queue\PsrTopic;
1919
use Psr\Log\LoggerInterface;
2020

2121
class GenericDriver implements DriverInterface
2222
{
2323
/**
24-
* @var PsrContext
24+
* @var Context
2525
*/
2626
private $context;
2727

@@ -36,7 +36,7 @@ class GenericDriver implements DriverInterface
3636
private $routeCollection;
3737

3838
public function __construct(
39-
PsrContext $context,
39+
Context $context,
4040
Config $config,
4141
RouteCollection $routeCollection
4242
) {
@@ -134,7 +134,7 @@ public function createRouteQueue(Route $route): PsrQueue
134134
return $this->doCreateQueue($transportName);
135135
}
136136

137-
public function createTransportMessage(Message $clientMessage): PsrMessage
137+
public function createTransportMessage(Message $clientMessage): InteropMessage
138138
{
139139
$headers = $clientMessage->getHeaders();
140140
$properties = $clientMessage->getProperties();
@@ -167,7 +167,7 @@ public function createTransportMessage(Message $clientMessage): PsrMessage
167167
return $transportMessage;
168168
}
169169

170-
public function createClientMessage(PsrMessage $transportMessage): Message
170+
public function createClientMessage(InteropMessage $transportMessage): Message
171171
{
172172
$clientMessage = new Message();
173173

@@ -203,7 +203,7 @@ public function getConfig(): Config
203203
return $this->config;
204204
}
205205

206-
public function getContext(): PsrContext
206+
public function getContext(): Context
207207
{
208208
return $this->context;
209209
}
@@ -213,17 +213,17 @@ public function getRouteCollection(): RouteCollection
213213
return $this->routeCollection;
214214
}
215215

216-
protected function doSendToRouter(PsrProducer $producer, PsrDestination $topic, PsrMessage $transportMessage): void
216+
protected function doSendToRouter(InteropProducer $producer, Destination $topic, InteropMessage $transportMessage): void
217217
{
218218
$producer->send($topic, $transportMessage);
219219
}
220220

221-
protected function doSendToProcessor(PsrProducer $producer, PsrQueue $queue, PsrMessage $transportMessage): void
221+
protected function doSendToProcessor(InteropProducer $producer, PsrQueue $queue, InteropMessage $transportMessage): void
222222
{
223223
$producer->send($queue, $transportMessage);
224224
}
225225

226-
protected function createRouterTopic(): PsrDestination
226+
protected function createRouterTopic(): Destination
227227
{
228228
return $this->createQueue($this->getConfig()->getRouterQueueName());
229229
}

pkg/enqueue/Client/Driver/GpsDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Enqueue\Gps\GpsContext;
66
use Enqueue\Gps\GpsQueue;
77
use Enqueue\Gps\GpsTopic;
8-
use Interop\Queue\PsrDestination;
8+
use Interop\Queue\Destination;
99
use Psr\Log\LoggerInterface;
1010
use Psr\Log\NullLogger;
1111

@@ -55,7 +55,7 @@ public function setupBroker(LoggerInterface $logger = null): void
5555
/**
5656
* @return GpsTopic
5757
*/
58-
protected function createRouterTopic(): PsrDestination
58+
protected function createRouterTopic(): Destination
5959
{
6060
return $this->doCreateTopic(
6161
$this->createTransportRouterTopicName($this->getConfig()->getRouterTopicName(), true)

pkg/enqueue/Client/Driver/RabbitMqStompDriver.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
use Enqueue\Stomp\StompDestination;
1010
use Enqueue\Stomp\StompMessage;
1111
use Enqueue\Stomp\StompProducer;
12-
use Interop\Queue\PsrDestination;
13-
use Interop\Queue\PsrMessage;
14-
use Interop\Queue\PsrProducer;
12+
use Interop\Queue\Destination;
13+
use Interop\Queue\Message as InteropMessage;
14+
use Interop\Queue\Producer as InteropProducer;
1515
use Interop\Queue\PsrQueue;
1616
use Psr\Log\LoggerInterface;
1717
use Psr\Log\NullLogger;
@@ -33,7 +33,7 @@ public function __construct(StompContext $context, Config $config, RouteCollecti
3333
/**
3434
* @return StompMessage
3535
*/
36-
public function createTransportMessage(Message $message): PsrMessage
36+
public function createTransportMessage(Message $message): InteropMessage
3737
{
3838
$transportMessage = parent::createTransportMessage($message);
3939

@@ -151,7 +151,7 @@ protected function doCreateQueue(string $transportQueueName): PsrQueue
151151
* @param StompDestination $topic
152152
* @param StompMessage $transportMessage
153153
*/
154-
protected function doSendToRouter(PsrProducer $producer, PsrDestination $topic, PsrMessage $transportMessage): void
154+
protected function doSendToRouter(InteropProducer $producer, Destination $topic, InteropMessage $transportMessage): void
155155
{
156156
// We should not handle priority, expiration, and delay at this stage.
157157
// The router will take care of it while re-sending the message to the final destinations.
@@ -167,7 +167,7 @@ protected function doSendToRouter(PsrProducer $producer, PsrDestination $topic,
167167
* @param StompDestination $destination
168168
* @param StompMessage $transportMessage
169169
*/
170-
protected function doSendToProcessor(PsrProducer $producer, PsrQueue $destination, PsrMessage $transportMessage): void
170+
protected function doSendToProcessor(InteropProducer $producer, PsrQueue $destination, InteropMessage $transportMessage): void
171171
{
172172
if ($delay = $transportMessage->getProperty('X-Enqueue-Delay')) {
173173
$producer->setDeliveryDelay(null);

pkg/enqueue/Client/Driver/RdKafkaDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Enqueue\RdKafka\RdKafkaContext;
66
use Enqueue\RdKafka\RdKafkaTopic;
7-
use Interop\Queue\PsrDestination;
7+
use Interop\Queue\Destination;
88
use Psr\Log\LoggerInterface;
99
use Psr\Log\NullLogger;
1010

@@ -48,7 +48,7 @@ public function setupBroker(LoggerInterface $logger = null): void
4848
/**
4949
* @return RdKafkaTopic
5050
*/
51-
protected function createRouterTopic(): PsrDestination
51+
protected function createRouterTopic(): Destination
5252
{
5353
return $this->doCreateTopic(
5454
$this->createTransportRouterTopicName($this->getConfig()->getRouterTopicName(), true)

pkg/enqueue/Client/Driver/StompDriver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use Enqueue\Stomp\StompContext;
77
use Enqueue\Stomp\StompDestination;
88
use Enqueue\Stomp\StompMessage;
9-
use Interop\Queue\PsrDestination;
10-
use Interop\Queue\PsrMessage;
9+
use Interop\Queue\Destination;
10+
use Interop\Queue\Message as InteropMessage;
1111
use Interop\Queue\PsrQueue;
1212
use Psr\Log\LoggerInterface;
1313
use Psr\Log\NullLogger;
@@ -31,7 +31,7 @@ public function setupBroker(LoggerInterface $logger = null): void
3131
/**
3232
* @return StompMessage
3333
*/
34-
public function createTransportMessage(Message $message): PsrMessage
34+
public function createTransportMessage(Message $message): InteropMessage
3535
{
3636
/** @var StompMessage $transportMessage */
3737
$transportMessage = parent::createTransportMessage($message);
@@ -57,7 +57,7 @@ protected function doCreateQueue(string $transportQueueName): PsrQueue
5757
/**
5858
* @return StompDestination
5959
*/
60-
protected function createRouterTopic(): PsrDestination
60+
protected function createRouterTopic(): Destination
6161
{
6262
/** @var StompDestination $topic */
6363
$topic = $this->doCreateTopic(

pkg/enqueue/Client/DriverInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
namespace Enqueue\Client;
66

7-
use Interop\Queue\PsrContext;
8-
use Interop\Queue\PsrMessage;
7+
use Interop\Queue\Context;
8+
use Interop\Queue\Message as InteropMessage;
99
use Interop\Queue\PsrQueue;
1010
use Psr\Log\LoggerInterface;
1111

1212
interface DriverInterface
1313
{
14-
public function createTransportMessage(Message $message): PsrMessage;
14+
public function createTransportMessage(Message $message): InteropMessage;
1515

16-
public function createClientMessage(PsrMessage $message): Message;
16+
public function createClientMessage(InteropMessage $message): Message;
1717

1818
public function sendToRouter(Message $message): void;
1919

@@ -31,7 +31,7 @@ public function setupBroker(LoggerInterface $logger = null): void;
3131

3232
public function getConfig(): Config;
3333

34-
public function getContext(): PsrContext;
34+
public function getContext(): Context;
3535

3636
public function getRouteCollection(): RouteCollection;
3737
}

pkg/enqueue/Client/ProcessorRegistryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Enqueue\Client;
44

5-
use Interop\Queue\PsrProcessor;
5+
use Interop\Queue\Processor;
66

77
interface ProcessorRegistryInterface
88
{
9-
public function get(string $processorName): PsrProcessor;
9+
public function get(string $processorName): Processor;
1010
}

pkg/enqueue/Client/RouterProcessor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace Enqueue\Client;
44

55
use Enqueue\Consumption\Result;
6-
use Interop\Queue\PsrContext;
7-
use Interop\Queue\PsrMessage;
8-
use Interop\Queue\PsrProcessor;
6+
use Interop\Queue\Context;
7+
use Interop\Queue\Message as InteropMessage;
8+
use Interop\Queue\Processor;
99

10-
final class RouterProcessor implements PsrProcessor
10+
final class RouterProcessor implements Processor
1111
{
1212
/**
1313
* @var DriverInterface
@@ -19,7 +19,7 @@ public function __construct(DriverInterface $driver)
1919
$this->driver = $driver;
2020
}
2121

22-
public function process(PsrMessage $message, PsrContext $context): Result
22+
public function process(InteropMessage $message, Context $context): Result
2323
{
2424
if ($message->getProperty(Config::PARAMETER_COMMAND_NAME)) {
2525
return Result::reject(sprintf(

0 commit comments

Comments
 (0)