1 | <?php |
||
11 | class FormToolsExtension extends \Twig_Extension |
||
12 | { |
||
13 | /** |
||
14 | * @var FormHelper |
||
15 | */ |
||
16 | private $formHelper; |
||
17 | |||
18 | /** |
||
19 | * @param FormHelper $formHelper |
||
20 | */ |
||
21 | public function __construct(FormHelper $formHelper) |
||
25 | |||
26 | /** |
||
27 | * Get Twig functions defined in this extension. |
||
28 | * |
||
29 | * @return array |
||
|
|||
30 | */ |
||
31 | public function getFunctions() |
||
38 | |||
39 | /** |
||
40 | * Return if there are error messages. |
||
41 | * |
||
42 | * @param FormView $formView |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | public function hasErrorMessages(FormView $formView) |
||
50 | |||
51 | /** |
||
52 | * Get the error messages. |
||
53 | * |
||
54 | * @param FormView[]|FormView $formViews The form views |
||
55 | * @param array &$errors The errors |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getErrorMessages($formViews, array &$errors = array()) |
||
63 | } |
||
64 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.