1 | <?php |
||
11 | class Worker |
||
12 | { |
||
13 | /** |
||
14 | * @var DriverInterface |
||
15 | */ |
||
16 | private $driver; |
||
17 | |||
18 | /** |
||
19 | * @var Event |
||
20 | */ |
||
21 | private $event; |
||
22 | |||
23 | /** |
||
24 | * @var LoggerInterface |
||
25 | */ |
||
26 | private $logger; |
||
27 | |||
28 | /** |
||
29 | * @var MessageSerializerInterface |
||
30 | */ |
||
31 | private $serializer; |
||
32 | |||
33 | /** |
||
34 | * @var RouterInterface |
||
35 | */ |
||
36 | private $router; |
||
37 | |||
38 | /** |
||
39 | * @param DriverInterface $driver |
||
40 | * @param Event $event |
||
41 | * @param LoggerInterface $logger |
||
42 | * @param MessageSerializerInterface $serializer |
||
43 | * @param RouterInterface $router |
||
44 | */ |
||
45 | 6 | public function __construct( |
|
58 | |||
59 | /** |
||
60 | * Consumes messages off of the queue |
||
61 | * |
||
62 | * @param string $queue |
||
63 | */ |
||
64 | 1 | public function consume($queue) |
|
68 | |||
69 | /** |
||
70 | * Handles fetching messages from the queue |
||
71 | * |
||
72 | * @param string $queue |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | 6 | protected function tick($queue) |
|
95 | |||
96 | /** |
||
97 | * Invoke the messages handler |
||
98 | * |
||
99 | * @param Message $message |
||
100 | * |
||
101 | * @return null|bool |
||
102 | */ |
||
103 | 5 | private function invoke(Message $message) |
|
116 | |||
117 | /** |
||
118 | * Handles actions related to a job starting |
||
119 | * |
||
120 | * @param Message $message |
||
121 | */ |
||
122 | 5 | private function jobStart(Message $message) |
|
127 | |||
128 | /** |
||
129 | * Handles actions related to a job finishing |
||
130 | * |
||
131 | * @param Message $message |
||
132 | */ |
||
133 | 3 | private function jobFinish(Message $message) |
|
138 | |||
139 | /** |
||
140 | * Handles actions related to a job shutting down the consumer |
||
141 | * |
||
142 | * @param Message $message |
||
143 | */ |
||
144 | 2 | private function jobShutdown(Message $message) |
|
148 | |||
149 | /** |
||
150 | * Handles actions related to job exceptions |
||
151 | * |
||
152 | * @param Message $message |
||
153 | * @param Exception $exception |
||
154 | */ |
||
155 | 2 | private function jobException(Message $message, Exception $exception) |
|
160 | } |
||
161 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: