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