| Conditions | 6 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function process(ContainerBuilder $container) |
||
| 29 | { |
||
| 30 | $repository = $container->getParameter('run_open_code.exchange_rate.repository'); |
||
| 31 | |||
| 32 | if ($container->hasDefinition($repository)) { |
||
| 33 | $container->setDefinition('run_open_code.exchange_rate.repository', $repository); |
||
| 34 | return; |
||
| 35 | } |
||
| 36 | |||
| 37 | foreach ($container->findTaggedServiceIds('run_open_code.exchange_rate.repository') as $id => $tags) { |
||
| 38 | |||
| 39 | foreach ($tags as $attributes) { |
||
| 40 | |||
| 41 | if (isset($attributes['alias']) && $repository === $attributes['alias']) { |
||
| 42 | $container->setDefinition('run_open_code.exchange_rate.repository', $id); |
||
|
|
|||
| 43 | return; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | throw new ServiceNotFoundException(sprintf('Repository service "%s" does not exists.', $repository)); |
||
| 49 | } |
||
| 50 | } |
||
| 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: