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