Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
24 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
25 | { |
||
26 | $options = $serviceLocator->get('zfcuser_module_options'); |
||
27 | $mapper = new Mapper\User(); |
||
28 | $mapper->setDbAdapter($serviceLocator->get('zfcuser_zend_db_adapter')); |
||
|
|||
29 | $entityClass = $options->getUserEntityClass(); |
||
30 | $mapper->setEntityPrototype(new $entityClass); |
||
31 | $mapper->setHydrator(new Mapper\UserHydrator()); |
||
32 | $mapper->setTableName($options->getTableName()); |
||
33 | return $mapper; |
||
34 | } |
||
35 | } |
||
36 |
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: