| 1 | <?php |
||
| 7 | class ConsumerCallback |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var callable |
||
| 11 | */ |
||
| 12 | protected $callback; |
||
| 13 | /** |
||
| 14 | * @var Queue |
||
| 15 | */ |
||
| 16 | protected $queue; |
||
| 17 | /** |
||
| 18 | * @var MessageMapper |
||
| 19 | */ |
||
| 20 | protected $messageMapper; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * ConsumerCallback constructor. |
||
| 24 | * |
||
| 25 | * @param callable $callback |
||
| 26 | * @param Queue $queue |
||
| 27 | */ |
||
| 28 | 5 | public function __construct(callable $callback, Queue $queue) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @param AMQPMessage $message |
||
| 36 | * @return mixed |
||
| 37 | * @throws \OutOfBoundsException |
||
| 38 | */ |
||
| 39 | 1 | public function __invoke(AMQPMessage $message) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return MessageMapper |
||
| 51 | */ |
||
| 52 | 2 | public function getMessageMapper() |
|
| 59 | |||
| 60 | /** |
||
| 61 | * @param MessageMapper $messageMapper |
||
| 62 | * @return $this |
||
| 63 | */ |
||
| 64 | 5 | public function setMessageMapper($messageMapper) |
|
| 69 | } |
||
| 70 |
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: