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