1 | <?php |
||
21 | class ContainerHandlerProvider implements HandlerProvider |
||
22 | { |
||
23 | /** |
||
24 | * @var ContainerInterface |
||
25 | */ |
||
26 | private $container; |
||
27 | |||
28 | /** |
||
29 | * @var array<string, string> |
||
30 | */ |
||
31 | private $handlers; |
||
32 | |||
33 | /** |
||
34 | * @param array<string, string> $mapping |
||
35 | * An array of key/value pairs where _key_ is a message class and _value_ the service |
||
36 | * identifier of its handler. |
||
37 | */ |
||
38 | public function __construct(ContainerInterface $container, array $mapping) |
||
43 | |||
44 | public function getHandlerForMessage(object $message): callable |
||
59 | } |
||
60 |
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: