1 | <?php |
||
11 | class QueueReader implements DomainQueueReader |
||
12 | { |
||
13 | /** |
||
14 | * @var SqsClient |
||
15 | */ |
||
16 | protected $client; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $queueUrl; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $queueName; |
||
27 | |||
28 | /** |
||
29 | * @var MessageHandler |
||
30 | */ |
||
31 | protected $messageHandler; |
||
32 | |||
33 | /** |
||
34 | * @var LoggerInterface |
||
35 | */ |
||
36 | protected $logger; |
||
37 | |||
38 | /** |
||
39 | * @param SqsClient $client |
||
40 | * @param string $queueName |
||
41 | * @param MessageHandler $messageHandler |
||
42 | * @param LoggerInterface $logger |
||
43 | */ |
||
44 | public function __construct(SqsClient $client, $queueName, MessageHandler $messageHandler, LoggerInterface $logger) |
||
51 | |||
52 | /** |
||
53 | * @param callable $callback |
||
54 | * @param int $timeout |
||
55 | * |
||
56 | * @throws ReaderException |
||
57 | */ |
||
58 | public function read(callable $callback, $timeout=0) |
||
69 | |||
70 | /** |
||
71 | * Deletes all messages from the queue |
||
72 | */ |
||
73 | public function purge() |
||
77 | |||
78 | /** |
||
79 | * @param int $timeout |
||
80 | */ |
||
81 | protected function consume($timeout) |
||
96 | |||
97 | /** |
||
98 | * @throws ReaderException |
||
99 | */ |
||
100 | protected function initialize() |
||
109 | |||
110 | /** |
||
111 | * Creates the queue in SQS, nothing will happen if the queue already exists |
||
112 | */ |
||
113 | protected function createQueue() |
||
120 | } |
||
121 |
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: