4
4
5
5
namespace Enqueue \Gearman ;
6
6
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
- use Interop \Queue \TemporaryQueueNotSupportedException ;
19
-
20
- class GearmanContext 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 \Exception \ TemporaryQueueNotSupportedException ;
14
+ use Interop \Queue \Message ;
15
+ use Interop \Queue \Producer ;
16
+ use Interop \Queue \Queue ;
17
+ use Interop \Queue \SubscriptionConsumer ;
18
+ use Interop \Queue \Topic ;
19
+
20
+ class GearmanContext implements Context
21
21
{
22
22
/**
23
23
* @var \GearmanClient
@@ -42,36 +42,36 @@ public function __construct(array $config)
42
42
/**
43
43
* @return GearmanMessage
44
44
*/
45
- public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): PsrMessage
45
+ public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): Message
46
46
{
47
47
return new GearmanMessage ($ body , $ properties , $ headers );
48
48
}
49
49
50
50
/**
51
51
* @return GearmanDestination
52
52
*/
53
- public function createTopic (string $ topicName ): PsrTopic
53
+ public function createTopic (string $ topicName ): Topic
54
54
{
55
55
return new GearmanDestination ($ topicName );
56
56
}
57
57
58
58
/**
59
59
* @return GearmanDestination
60
60
*/
61
- public function createQueue (string $ queueName ): PsrQueue
61
+ public function createQueue (string $ queueName ): Queue
62
62
{
63
63
return new GearmanDestination ($ queueName );
64
64
}
65
65
66
- public function createTemporaryQueue (): PsrQueue
66
+ public function createTemporaryQueue (): Queue
67
67
{
68
68
throw TemporaryQueueNotSupportedException::providerDoestNotSupportIt ();
69
69
}
70
70
71
71
/**
72
72
* @return GearmanProducer
73
73
*/
74
- public function createProducer (): PsrProducer
74
+ public function createProducer (): Producer
75
75
{
76
76
return new GearmanProducer ($ this ->getClient ());
77
77
}
@@ -81,7 +81,7 @@ public function createProducer(): PsrProducer
81
81
*
82
82
* @return GearmanConsumer
83
83
*/
84
- public function createConsumer (PsrDestination $ destination ): PsrConsumer
84
+ public function createConsumer (Destination $ destination ): Consumer
85
85
{
86
86
InvalidDestinationException::assertDestinationInstanceOf ($ destination , GearmanDestination::class);
87
87
@@ -99,12 +99,12 @@ public function close(): void
99
99
}
100
100
}
101
101
102
- public function createSubscriptionConsumer (): PsrSubscriptionConsumer
102
+ public function createSubscriptionConsumer (): SubscriptionConsumer
103
103
{
104
104
throw SubscriptionConsumerNotSupportedException::providerDoestNotSupportIt ();
105
105
}
106
106
107
- public function purgeQueue (PsrQueue $ queue ): void
107
+ public function purgeQueue (Queue $ queue ): void
108
108
{
109
109
throw PurgeQueueNotSupportedException::providerDoestNotSupportIt ();
110
110
}
0 commit comments