Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 0 |
1 | <?php |
||
24 | 3 | public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) |
|
25 | { |
||
26 | 3 | $options = $this->getOptions($container, 'authentication'); |
|
27 | |||
28 | 3 | $objectManager = $options->getObjectManager(); |
|
29 | 3 | if (is_string($objectManager)) { |
|
30 | $options->setObjectManager($container->get($objectManager)); |
||
31 | } |
||
32 | |||
33 | 3 | $storage = $options->getStorage(); |
|
34 | 3 | if (is_string($storage)) { |
|
35 | 3 | $options->setStorage($container->get($storage)); |
|
36 | } |
||
37 | |||
38 | 3 | return new ObjectRepository($options); |
|
|
|||
39 | } |
||
40 | |||
56 |
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: