5
5
namespace Enqueue \AmqpBunny ;
6
6
7
7
use Bunny \Channel ;
8
- use Bunny \Message ;
8
+ use Bunny \Message as BunnyMessage ;
9
9
use Enqueue \AmqpTools \DelayStrategyAware ;
10
10
use Enqueue \AmqpTools \DelayStrategyAwareTrait ;
11
11
use Interop \Amqp \AmqpBind as InteropAmqpBind ;
18
18
use Interop \Amqp \Impl \AmqpMessage ;
19
19
use Interop \Amqp \Impl \AmqpQueue ;
20
20
use Interop \Amqp \Impl \AmqpTopic ;
21
- use Interop \Queue \Exception ;
22
- use Interop \Queue \InvalidDestinationException ;
23
- use Interop \Queue \PsrConsumer ;
24
- use Interop \Queue \PsrDestination ;
25
- use Interop \Queue \PsrMessage ;
26
- use Interop \Queue \PsrProducer ;
27
- use Interop \Queue \PsrQueue ;
28
- use Interop \Queue \PsrSubscriptionConsumer ;
29
- use Interop \Queue \PsrTopic ;
21
+ use Interop \Queue \Consumer ;
22
+ use Interop \Queue \Destination ;
23
+ use Interop \Queue \Exception \ Exception ;
24
+ use Interop \Queue \Exception \ InvalidDestinationException ;
25
+ use Interop \Queue \Message ;
26
+ use Interop \Queue \Producer ;
27
+ use Interop \Queue \Queue ;
28
+ use Interop \Queue \SubscriptionConsumer ;
29
+ use Interop \Queue \Topic ;
30
30
31
31
class AmqpContext implements InteropAmqpContext, DelayStrategyAware
32
32
{
@@ -73,23 +73,23 @@ public function __construct($bunnyChannel, array $config)
73
73
/**
74
74
* @return InteropAmqpMessage
75
75
*/
76
- public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): PsrMessage
76
+ public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): Message
77
77
{
78
78
return new AmqpMessage ($ body , $ properties , $ headers );
79
79
}
80
80
81
81
/**
82
82
* @return InteropAmqpQueue
83
83
*/
84
- public function createQueue (string $ name ): PsrQueue
84
+ public function createQueue (string $ name ): Queue
85
85
{
86
86
return new AmqpQueue ($ name );
87
87
}
88
88
89
89
/**
90
90
* @return InteropAmqpTopic
91
91
*/
92
- public function createTopic (string $ name ): PsrTopic
92
+ public function createTopic (string $ name ): Topic
93
93
{
94
94
return new AmqpTopic ($ name );
95
95
}
@@ -99,9 +99,9 @@ public function createTopic(string $name): PsrTopic
99
99
*
100
100
* @return AmqpConsumer
101
101
*/
102
- public function createConsumer (PsrDestination $ destination ): PsrConsumer
102
+ public function createConsumer (Destination $ destination ): Consumer
103
103
{
104
- $ destination instanceof PsrTopic
104
+ $ destination instanceof Topic
105
105
? InvalidDestinationException::assertDestinationInstanceOf ($ destination , InteropAmqpTopic::class)
106
106
: InvalidDestinationException::assertDestinationInstanceOf ($ destination , InteropAmqpQueue::class)
107
107
;
@@ -119,15 +119,15 @@ public function createConsumer(PsrDestination $destination): PsrConsumer
119
119
/**
120
120
* @return AmqpSubscriptionConsumer
121
121
*/
122
- public function createSubscriptionConsumer (): PsrSubscriptionConsumer
122
+ public function createSubscriptionConsumer (): SubscriptionConsumer
123
123
{
124
124
return new AmqpSubscriptionConsumer ($ this );
125
125
}
126
126
127
127
/**
128
128
* @return AmqpProducer
129
129
*/
130
- public function createProducer (): PsrProducer
130
+ public function createProducer (): Producer
131
131
{
132
132
$ producer = new AmqpProducer ($ this ->getBunnyChannel (), $ this );
133
133
$ producer ->setDelayStrategy ($ this ->delayStrategy );
@@ -138,7 +138,7 @@ public function createProducer(): PsrProducer
138
138
/**
139
139
* @return InteropAmqpQueue
140
140
*/
141
- public function createTemporaryQueue (): PsrQueue
141
+ public function createTemporaryQueue (): Queue
142
142
{
143
143
$ frame = $ this ->getBunnyChannel ()->queueDeclare ('' , false , false , true , false );
144
144
@@ -199,7 +199,7 @@ public function deleteQueue(InteropAmqpQueue $queue): void
199
199
/**
200
200
* @param InteropAmqpQueue $queue
201
201
*/
202
- public function purgeQueue (PsrQueue $ queue ): void
202
+ public function purgeQueue (Queue $ queue ): void
203
203
{
204
204
$ this ->getBunnyChannel ()->queuePurge (
205
205
$ queue ->getQueueName (),
@@ -309,7 +309,7 @@ public function getBunnyChannel(): Channel
309
309
/**
310
310
* @internal It must be used here and in the consumer only
311
311
*/
312
- public function convertMessage (Message $ bunnyMessage ): InteropAmqpMessage
312
+ public function convertMessage (BunnyMessage $ bunnyMessage ): InteropAmqpMessage
313
313
{
314
314
$ headers = $ bunnyMessage ->headers ;
315
315
0 commit comments