44
55namespace Enqueue \Redis ;
66
7- use Interop \Queue \InvalidDestinationException ;
8- use Interop \Queue \PsrConsumer ;
9- use Interop \Queue \PsrContext ;
10- use Interop \Queue \PsrDestination ;
11- use Interop \Queue \PsrMessage ;
12- use Interop \Queue \PsrProducer ;
13- use Interop \Queue \PsrQueue ;
14- use Interop \Queue \PsrSubscriptionConsumer ;
15- use Interop \Queue \PsrTopic ;
16- use Interop \Queue \TemporaryQueueNotSupportedException ;
17-
18- class RedisContext implements PsrContext
7+ use Interop \Queue \Consumer ;
8+ use Interop \Queue \Context ;
9+ use Interop \Queue \Destination ;
10+ use Interop \Queue \Exception \ InvalidDestinationException ;
11+ use Interop \Queue \Exception \ TemporaryQueueNotSupportedException ;
12+ use Interop \Queue \Message ;
13+ use Interop \Queue \Producer ;
14+ use Interop \Queue \Queue ;
15+ use Interop \Queue \SubscriptionConsumer ;
16+ use Interop \Queue \Topic ;
17+
18+ class RedisContext implements Context
1919{
2020 /**
2121 * @var Redis
@@ -50,31 +50,31 @@ public function __construct($redis)
5050 /**
5151 * @return RedisMessage
5252 */
53- public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): PsrMessage
53+ public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): Message
5454 {
5555 return new RedisMessage ($ body , $ properties , $ headers );
5656 }
5757
5858 /**
5959 * @return RedisDestination
6060 */
61- public function createTopic (string $ topicName ): PsrTopic
61+ public function createTopic (string $ topicName ): Topic
6262 {
6363 return new RedisDestination ($ topicName );
6464 }
6565
6666 /**
6767 * @return RedisDestination
6868 */
69- public function createQueue (string $ queueName ): PsrQueue
69+ public function createQueue (string $ queueName ): Queue
7070 {
7171 return new RedisDestination ($ queueName );
7272 }
7373
7474 /**
7575 * @param RedisDestination $queue
7676 */
77- public function deleteQueue (PsrQueue $ queue ): void
77+ public function deleteQueue (Queue $ queue ): void
7878 {
7979 InvalidDestinationException ::assertDestinationInstanceOf ($ queue , RedisDestination::class);
8080
@@ -84,22 +84,22 @@ public function deleteQueue(PsrQueue $queue): void
8484 /**
8585 * @param RedisDestination $topic
8686 */
87- public function deleteTopic (PsrTopic $ topic ): void
87+ public function deleteTopic (Topic $ topic ): void
8888 {
8989 InvalidDestinationException ::assertDestinationInstanceOf ($ topic , RedisDestination::class);
9090
9191 $ this ->getRedis ()->del ($ topic ->getName ());
9292 }
9393
94- public function createTemporaryQueue (): PsrQueue
94+ public function createTemporaryQueue (): Queue
9595 {
9696 throw TemporaryQueueNotSupportedException ::providerDoestNotSupportIt ();
9797 }
9898
9999 /**
100100 * @return RedisProducer
101101 */
102- public function createProducer (): PsrProducer
102+ public function createProducer (): Producer
103103 {
104104 return new RedisProducer ($ this ->getRedis ());
105105 }
@@ -109,7 +109,7 @@ public function createProducer(): PsrProducer
109109 *
110110 * @return RedisConsumer
111111 */
112- public function createConsumer (PsrDestination $ destination ): PsrConsumer
112+ public function createConsumer (Destination $ destination ): Consumer
113113 {
114114 InvalidDestinationException ::assertDestinationInstanceOf ($ destination , RedisDestination::class);
115115
@@ -119,15 +119,15 @@ public function createConsumer(PsrDestination $destination): PsrConsumer
119119 /**
120120 * @return RedisSubscriptionConsumer
121121 */
122- public function createSubscriptionConsumer (): PsrSubscriptionConsumer
122+ public function createSubscriptionConsumer (): SubscriptionConsumer
123123 {
124124 return new RedisSubscriptionConsumer ($ this );
125125 }
126126
127127 /**
128128 * @param RedisDestination $queue
129129 */
130- public function purgeQueue (PsrQueue $ queue ): void
130+ public function purgeQueue (Queue $ queue ): void
131131 {
132132 $ this ->getRedis ()->del ($ queue ->getName ());
133133 }
0 commit comments