44
55namespace Enqueue \Stomp ;
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 \PurgeQueueNotSupportedException ;
17- use Interop \Queue \SubscriptionConsumerNotSupportedException ;
18-
19- class StompContext 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 \ PurgeQueueNotSupportedException ;
12+ use Interop \Queue \Exception \ SubscriptionConsumerNotSupportedException ;
13+ use Interop \Queue \Message ;
14+ use Interop \Queue \Producer ;
15+ use Interop \Queue \Queue ;
16+ use Interop \Queue \SubscriptionConsumer ;
17+ use Interop \Queue \Topic ;
18+
19+ class StompContext implements Context
2020{
2121 /**
2222 * @var BufferedStompClient
@@ -45,15 +45,15 @@ public function __construct($stomp)
4545 /**
4646 * @return StompMessage
4747 */
48- public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): PsrMessage
48+ public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): Message
4949 {
5050 return new StompMessage ($ body , $ properties , $ headers );
5151 }
5252
5353 /**
5454 * @return StompDestination
5555 */
56- public function createQueue (string $ name ): PsrQueue
56+ public function createQueue (string $ name ): Queue
5757 {
5858 if (0 !== strpos ($ name , '/ ' )) {
5959 $ destination = new StompDestination ();
@@ -69,7 +69,7 @@ public function createQueue(string $name): PsrQueue
6969 /**
7070 * @return StompDestination
7171 */
72- public function createTemporaryQueue (): PsrQueue
72+ public function createTemporaryQueue (): Queue
7373 {
7474 $ queue = $ this ->createQueue (uniqid ('' , true ));
7575 $ queue ->setType (StompDestination::TYPE_TEMP_QUEUE );
@@ -80,7 +80,7 @@ public function createTemporaryQueue(): PsrQueue
8080 /**
8181 * @return StompDestination
8282 */
83- public function createTopic (string $ name ): PsrTopic
83+ public function createTopic (string $ name ): Topic
8484 {
8585 if (0 !== strpos ($ name , '/ ' )) {
8686 $ destination = new StompDestination ();
@@ -156,7 +156,7 @@ public function createDestination(string $destination): StompDestination
156156 *
157157 * @return StompConsumer
158158 */
159- public function createConsumer (PsrDestination $ destination ): PsrConsumer
159+ public function createConsumer (Destination $ destination ): Consumer
160160 {
161161 InvalidDestinationException ::assertDestinationInstanceOf ($ destination , StompDestination::class);
162162
@@ -166,7 +166,7 @@ public function createConsumer(PsrDestination $destination): PsrConsumer
166166 /**
167167 * @return StompProducer
168168 */
169- public function createProducer (): PsrProducer
169+ public function createProducer (): Producer
170170 {
171171 return new StompProducer ($ this ->getStomp ());
172172 }
@@ -176,12 +176,12 @@ public function close(): void
176176 $ this ->getStomp ()->disconnect ();
177177 }
178178
179- public function createSubscriptionConsumer (): PsrSubscriptionConsumer
179+ public function createSubscriptionConsumer (): SubscriptionConsumer
180180 {
181181 throw SubscriptionConsumerNotSupportedException ::providerDoestNotSupportIt ();
182182 }
183183
184- public function purgeQueue (PsrQueue $ queue ): void
184+ public function purgeQueue (Queue $ queue ): void
185185 {
186186 throw PurgeQueueNotSupportedException ::providerDoestNotSupportIt ();
187187 }
0 commit comments