| 1 | <?php |
||
| 14 | class MessageHandler |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var JSONMessageFactory |
||
| 18 | */ |
||
| 19 | private $jsonMessageFactory; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var callable |
||
| 23 | */ |
||
| 24 | private $callback; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * MessageHandler constructor. |
||
| 28 | * @param JSONMessageFactory $jsonMessageFactory |
||
| 29 | */ |
||
| 30 | public function __construct(JSONMessageFactory $jsonMessageFactory) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param AMQPMessage $message |
||
| 37 | * @throws \Exception |
||
| 38 | */ |
||
| 39 | public function handleMessage(AMQPMessage $message) |
||
| 49 | |||
| 50 | public function setCallback(callable $callback) |
||
| 54 | } |
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: