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