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