44
55namespace Enqueue \Mongodb ;
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 \SubscriptionConsumerNotSupportedException ;
17- use Interop \Queue \TemporaryQueueNotSupportedException ;
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 \ SubscriptionConsumerNotSupportedException ;
12+ use Interop \Queue \Exception \ TemporaryQueueNotSupportedException ;
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 ;
1818use MongoDB \Client ;
1919use MongoDB \Collection ;
2020
21- class MongodbContext implements PsrContext
21+ class MongodbContext implements Context
2222{
2323 /**
2424 * @var array
@@ -44,7 +44,7 @@ public function __construct($client, array $config = [])
4444 /**
4545 * @return MongodbMessage
4646 */
47- public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): PsrMessage
47+ public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): Message
4848 {
4949 $ message = new MongodbMessage ();
5050 $ message ->setBody ($ body );
@@ -57,28 +57,28 @@ public function createMessage(string $body = '', array $properties = [], array $
5757 /**
5858 * @return MongodbDestination
5959 */
60- public function createTopic (string $ name ): PsrTopic
60+ public function createTopic (string $ name ): Topic
6161 {
6262 return new MongodbDestination ($ name );
6363 }
6464
6565 /**
6666 * @return MongodbDestination
6767 */
68- public function createQueue (string $ queueName ): PsrQueue
68+ public function createQueue (string $ queueName ): Queue
6969 {
7070 return new MongodbDestination ($ queueName );
7171 }
7272
73- public function createTemporaryQueue (): PsrQueue
73+ public function createTemporaryQueue (): Queue
7474 {
7575 throw TemporaryQueueNotSupportedException::providerDoestNotSupportIt ();
7676 }
7777
7878 /**
7979 * @return MongodbProducer
8080 */
81- public function createProducer (): PsrProducer
81+ public function createProducer (): Producer
8282 {
8383 return new MongodbProducer ($ this );
8484 }
@@ -88,7 +88,7 @@ public function createProducer(): PsrProducer
8888 *
8989 * @return MongodbConsumer
9090 */
91- public function createConsumer (PsrDestination $ destination ): PsrConsumer
91+ public function createConsumer (Destination $ destination ): Consumer
9292 {
9393 InvalidDestinationException::assertDestinationInstanceOf ($ destination , MongodbDestination::class);
9494
@@ -105,15 +105,15 @@ public function close(): void
105105 {
106106 }
107107
108- public function createSubscriptionConsumer (): PsrSubscriptionConsumer
108+ public function createSubscriptionConsumer (): SubscriptionConsumer
109109 {
110110 throw SubscriptionConsumerNotSupportedException::providerDoestNotSupportIt ();
111111 }
112112
113113 /**
114114 * @param MongodbDestination $queue
115115 */
116- public function purgeQueue (PsrQueue $ queue ): void
116+ public function purgeQueue (Queue $ queue ): void
117117 {
118118 $ this ->getCollection ()->deleteMany ([
119119 'queue ' => $ queue ->getQueueName (),
0 commit comments