Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
30 | { |
||
31 | /** @var $options ModuleOptions */ |
||
32 | $options = $serviceLocator->get(ModuleOptions::class); |
||
33 | $rendererCollection = new RendererCollection(); |
||
34 | foreach ($options->getActiveRenderers() as $rendererAlias) { |
||
35 | /** @var $renderer RendererInterface */ |
||
36 | $renderer = $serviceLocator->get($rendererAlias); |
||
37 | $renderer->setDefaultOptions($options->getRendererOptions($rendererAlias)); |
||
38 | $renderer->setFormManager($serviceLocator->get(FormManager::class)); |
||
39 | if ($serviceLocator->has('translator')) { |
||
40 | $renderer->setTranslator($serviceLocator->get('translator')); |
||
41 | } |
||
42 | $renderer->setHttpRouter($serviceLocator->get('HttpRouter')); |
||
|
|||
43 | $rendererCollection->addRenderer($renderer); |
||
44 | } |
||
45 | |||
46 | return $rendererCollection; |
||
47 | } |
||
48 | } |
||
49 |
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: