Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 0 |
1 | <?php |
||
23 | 2 | public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) |
|
24 | { |
||
25 | 2 | $options = $this->getOptions($container, 'authentication'); |
|
26 | |||
27 | 2 | $objectManager = $options->getObjectManager(); |
|
28 | 2 | if (is_string($objectManager)) { |
|
29 | $options->setObjectManager($container->get($objectManager)); |
||
30 | } |
||
31 | |||
32 | 2 | return new ObjectRepository($options); |
|
|
|||
33 | } |
||
34 | |||
50 |
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: