| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 19 | 
| Code Lines | 12 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 2 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 18 | public function createService(ServiceLocatorInterface $formElementManager) | ||
| 19 |     { | ||
| 20 |         if ($formElementManager instanceof FormElementManager) { | ||
| 21 | $sm = $formElementManager->getServiceLocator(); | ||
| 22 | $fem = $formElementManager; | ||
| 23 |         } else { | ||
| 24 | $sm = $formElementManager; | ||
| 25 |             $fem = $sm->get('FormElementManager'); | ||
| 26 | } | ||
| 27 | |||
| 28 |         $options = $sm->get('zfcuser_module_options'); | ||
| 29 | $form = new Form\ChangePassword(null, $options); | ||
| 30 | // Inject the FormElementManager to support custom FormElements | ||
| 31 | $form->getFormFactory()->setFormElementManager($fem); | ||
|  | |||
| 32 | |||
| 33 | $form->setInputFilter(new Form\ChangePasswordFilter($options)); | ||
| 34 | |||
| 35 | return $form; | ||
| 36 | } | ||
| 37 | } | ||
| 38 | 
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: