Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.5923 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 6 | public function createService(ServiceLocatorInterface $serviceLocator) |
|
23 | { |
||
24 | $config = $serviceLocator->get('Config'); |
||
25 | |||
26 | 6 | $dmmConfig = isset($config['thorr_persistence_dmm']) |
|
27 | ? new DataMapperManagerConfig($config['thorr_persistence_dmm']) |
||
28 | 6 | : null; |
|
29 | |||
30 | $dataMapperManager = new DataMapperManager($dmmConfig); |
||
31 | $dataMapperManager->setServiceLocator($serviceLocator); |
||
32 | |||
33 | 5 | if (isset($config['di']) && $serviceLocator->has('Di')) { |
|
34 | $dataMapperManager->addAbstractFactory($serviceLocator->get('DiAbstractServiceFactory')); |
||
|
|||
35 | } |
||
36 | |||
37 | 6 | return $dataMapperManager; |
|
38 | 6 | } |
|
39 | } |
||
40 |
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: