Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
18 | { |
||
19 | $appConfig = $serviceLocator->get('Config'); |
||
20 | $config = []; |
||
21 | if (isset($appConfig['cron'])) { |
||
22 | $config = $appConfig['cron']; |
||
23 | } |
||
24 | |||
25 | return new Config( |
||
26 | $config, |
||
27 | $serviceLocator->get(FileSystem::class) |
||
|
|||
28 | ); |
||
29 | } |
||
30 | } |
||
31 |
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: