Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
55 | 2 | private function initialize() |
|
56 | { |
||
57 | $handlers = $this |
||
58 | 2 | ->handlers |
|
59 | 2 | ->reduce( |
|
60 | 2 | new Map('string', 'callable'), |
|
61 | 2 | function(Map $carry, string $class, string $service): Map { |
|
62 | 2 | return $carry->put( |
|
63 | $class, |
||
1 ignored issue
–
show
|
|||
64 | 2 | $this->container->get($service) |
|
65 | ); |
||
66 | 2 | } |
|
67 | ); |
||
68 | 2 | $this->bus = new CommandBus($handlers); |
|
69 | 2 | } |
|
70 | } |
||
71 |
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: