1 | <?php |
||
25 | abstract class AbstractValidateRenderer extends AbstractRenderer |
||
26 | { |
||
27 | /** |
||
28 | * Executed before the ZF2 view helper renders the element |
||
29 | * |
||
30 | * @param string $formAlias |
||
31 | * @param \Zend\View\Renderer\PhpRenderer $view |
||
32 | * @param \Zend\Form\FormInterface $form |
||
33 | * @param array $options |
||
34 | * |
||
35 | * @return FormInterface |
||
36 | */ |
||
37 | public function preRenderForm($formAlias, View $view, FormInterface $form = null, array $options = []) |
||
61 | |||
62 | /** |
||
63 | * Iterate through all the elements and retrieve their validators |
||
64 | * |
||
65 | * @param FieldsetInterface $formOrFieldset |
||
66 | * @param InputFilterInterface $inputFilter |
||
67 | * |
||
68 | * @return array |
||
69 | */ |
||
70 | public function extractValidatorsForForm(FieldsetInterface $formOrFieldset, InputFilterInterface $inputFilter) |
||
91 | |||
92 | /** |
||
93 | * Get all validators for a given element |
||
94 | * |
||
95 | * @param InputFilterInterface $inputFilter |
||
96 | * @param ElementInterface $element |
||
97 | * |
||
98 | * @return mixed |
||
99 | */ |
||
100 | public function getValidatorsForElement(InputFilterInterface $inputFilter, ElementInterface $element) |
||
125 | |||
126 | /** |
||
127 | * When the input is required we need to inject the NotEmpty validator |
||
128 | * |
||
129 | * @param InputInterface $input |
||
130 | */ |
||
131 | protected function injectNotEmptyValidator(InputInterface $input) |
||
150 | |||
151 | /** |
||
152 | * Excecuted before the ZF2 view helper renders the element |
||
153 | * |
||
154 | * @param ElementInterface $element |
||
155 | * |
||
156 | * @return mixed |
||
157 | */ |
||
158 | public function preRenderInputField(ElementInterface $element) |
||
161 | |||
162 | /** |
||
163 | * @param string $formAlias |
||
164 | * @param ElementInterface $element |
||
165 | * @param ValidatorInterface $validator |
||
166 | * |
||
167 | * @return mixed |
||
168 | */ |
||
169 | abstract protected function addValidationAttributesForElement($formAlias, ElementInterface $element, ValidatorInterface $validator = null); |
||
170 | |||
171 | /** |
||
172 | * Get the name of the form element |
||
173 | * |
||
174 | * @param ElementInterface $element |
||
175 | * |
||
176 | * @return string |
||
177 | */ |
||
178 | protected function getElementName(ElementInterface $element) |
||
187 | |||
188 | /** |
||
189 | * Get the classname of the zend validator |
||
190 | * |
||
191 | * @param ValidatorInterface $validator |
||
192 | * |
||
193 | * @return mixed |
||
194 | */ |
||
195 | protected function getValidatorClassName(ValidatorInterface $validator = null) |
||
200 | } |
||
201 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.