1 | <?php |
||
14 | abstract class Form implements FormInterface |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $name; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $method; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $options; |
||
31 | |||
32 | /** |
||
33 | * @var \stdClass|null |
||
34 | */ |
||
35 | private $object; |
||
36 | |||
37 | /** |
||
38 | * @var null|\ValidatorInterface |
||
39 | */ |
||
40 | private $validator; |
||
41 | |||
42 | /** |
||
43 | * @var array|FormElementInterface[] |
||
44 | */ |
||
45 | private $elements; |
||
46 | |||
47 | /** |
||
48 | * Form constructor. |
||
49 | * |
||
50 | * @param string $name |
||
51 | * @param string $method |
||
52 | * @param array $options |
||
53 | */ |
||
54 | public function __construct($name, $method = FormInterface::METHOD_GET, array $options = []) |
||
61 | |||
62 | /** |
||
63 | * @inheritDoc |
||
64 | */ |
||
65 | public function getName() |
||
69 | |||
70 | /** |
||
71 | * @inheritDoc |
||
72 | */ |
||
73 | public function getMethod() |
||
77 | |||
78 | /** |
||
79 | * @inheritDoc |
||
80 | */ |
||
81 | public function getOptions() |
||
85 | |||
86 | /** |
||
87 | * @inheritDoc |
||
88 | */ |
||
89 | public function add(FormElementInterface $element) |
||
98 | |||
99 | /** |
||
100 | * @inheritDoc |
||
101 | */ |
||
102 | public function remove($fieldName) |
||
107 | |||
108 | /** |
||
109 | * @inheritDoc |
||
110 | */ |
||
111 | public function has($fieldName) |
||
115 | |||
116 | /** |
||
117 | * @inheritDoc |
||
118 | */ |
||
119 | public function validate() |
||
139 | |||
140 | /** |
||
141 | * @return array|string[] |
||
142 | */ |
||
143 | public function getErrorMessages() |
||
151 | |||
152 | /** |
||
153 | * @param null|\ValidatorInterface $validator |
||
154 | * |
||
155 | * @return Form |
||
156 | */ |
||
157 | protected function setValidator(ValidatorInterface $validator) |
||
162 | |||
163 | |||
164 | /** |
||
165 | * @inheritDoc |
||
166 | */ |
||
167 | public function bind($object) |
||
183 | |||
184 | /** |
||
185 | * @inheritDoc |
||
186 | * @throws \ReflectionException |
||
187 | */ |
||
188 | public function setData(array $data) |
||
219 | |||
220 | /** |
||
221 | * @param \ReflectionMethod $targetMethod |
||
222 | * @param mixed $value |
||
223 | * |
||
224 | * @return bool|float|int|string |
||
225 | */ |
||
226 | private function sanitize(\ReflectionMethod $targetMethod, $value = null) |
||
254 | |||
255 | /** |
||
256 | * @inheritDoc |
||
257 | */ |
||
258 | public function getObject() |
||
262 | |||
263 | /** |
||
264 | * @inheritDoc |
||
265 | */ |
||
266 | public function getElement($elementName) |
||
274 | |||
275 | /** |
||
276 | * @param string $name |
||
277 | * |
||
278 | * @return string |
||
279 | */ |
||
280 | private function camelCase($name) |
||
285 | |||
286 | } |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.