1 | <?php |
||
26 | class MessageManagerBackend implements BackendInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var MessageManagerInterface |
||
30 | */ |
||
31 | protected $messageManager; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $checkLevel; |
||
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | */ |
||
41 | protected $pause; |
||
42 | |||
43 | /** |
||
44 | * @var int |
||
45 | */ |
||
46 | protected $maxAge; |
||
47 | |||
48 | /** |
||
49 | * @var MessageManagerBackendDispatcher|null |
||
50 | */ |
||
51 | protected $dispatcher = null; |
||
52 | |||
53 | /** |
||
54 | * @var array |
||
55 | */ |
||
56 | protected $types; |
||
57 | |||
58 | /** |
||
59 | * @var int |
||
60 | */ |
||
61 | protected $batchSize; |
||
62 | |||
63 | /** |
||
64 | * @param int $pause |
||
65 | * @param int $maxAge |
||
66 | * @param int $batchSize |
||
67 | */ |
||
68 | public function __construct(MessageManagerInterface $messageManager, array $checkLevel, $pause = 500000, $maxAge = 86400, $batchSize = 10, array $types = []) |
||
77 | |||
78 | /** |
||
79 | * @param array $types |
||
80 | */ |
||
81 | public function setTypes($types): void |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function publish(MessageInterface $message) |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function create($type, array $body) |
||
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | public function createAndPublish($type, array $body) |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | */ |
||
120 | public function getIterator() |
||
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | public function initialize(): void |
||
131 | |||
132 | public function setDispatcher(MessageManagerBackendDispatcher $dispatcher): void |
||
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | public function handle(MessageInterface $message, EventDispatcherInterface $dispatcher) |
||
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | public function getStatus() |
||
195 | |||
196 | /** |
||
197 | * {@inheritdoc} |
||
198 | */ |
||
199 | public function cleanup(): void |
||
203 | } |
||
204 |
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: