1 | <?php namespace Limoncello\Application\FormValidation; |
||
37 | class Validator extends BaseValidator implements FormValidatorInterface |
||
38 | { |
||
39 | use HasContainerTrait; |
||
40 | |||
41 | /** |
||
42 | * Namespace for string resources. |
||
43 | */ |
||
44 | const RESOURCES_NAMESPACE = 'Limoncello.Flute.Validation'; |
||
45 | |||
46 | /** Rule description index */ |
||
47 | const RULE_INDEX = 0; |
||
48 | |||
49 | /** Rule description index */ |
||
50 | const RULE_ATTRIBUTES = self::RULE_INDEX + 1; |
||
51 | |||
52 | /** Rule description index */ |
||
53 | const RULE_TO_ONE = self::RULE_ATTRIBUTES + 1; |
||
54 | |||
55 | /** Rule description index */ |
||
56 | const RULE_TO_MANY = self::RULE_TO_ONE + 1; |
||
57 | |||
58 | /** Rule description index */ |
||
59 | const RULE_UNLISTED_ATTRIBUTE = self::RULE_TO_MANY + 1; |
||
60 | |||
61 | /** Rule description index */ |
||
62 | const RULE_UNLISTED_RELATIONSHIP = self::RULE_UNLISTED_ATTRIBUTE + 1; |
||
63 | |||
64 | /** |
||
65 | * @var ContextStorageInterface |
||
66 | */ |
||
67 | private $contextStorage; |
||
68 | |||
69 | /** |
||
70 | * @var array |
||
71 | */ |
||
72 | private $blocks; |
||
73 | |||
74 | /** |
||
75 | * @var int[] |
||
76 | */ |
||
77 | private $attributeRules; |
||
78 | |||
79 | /** |
||
80 | * @param string $name |
||
81 | * @param array $data |
||
82 | * @param ContainerInterface $container |
||
83 | * |
||
84 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
85 | */ |
||
86 | 2 | public function __construct(string $name, array $data, ContainerInterface $container) |
|
95 | |||
96 | /** |
||
97 | * @inheritdoc |
||
98 | * |
||
99 | * @SuppressWarnings(PHPMD.ElseExpression) |
||
100 | */ |
||
101 | 2 | public function validate($input): bool |
|
117 | |||
118 | /** |
||
119 | * @return BaseValidator |
||
120 | */ |
||
121 | 2 | protected function resetAggregators(): BaseValidator |
|
129 | |||
130 | /** |
||
131 | * @return ContextStorageInterface |
||
132 | */ |
||
133 | 1 | protected function getContextStorage(): ContextStorageInterface |
|
137 | |||
138 | /** |
||
139 | * @return ContextStorageInterface |
||
140 | */ |
||
141 | 2 | protected function createContextStorage(): ContextStorageInterface |
|
145 | |||
146 | /** |
||
147 | * @param array $attributes |
||
148 | * |
||
149 | * @return self |
||
150 | * @SuppressWarnings(PHPMD.ElseExpression) |
||
151 | */ |
||
152 | 1 | private function validateAttributes(array $attributes): self |
|
170 | |||
171 | /** |
||
172 | * @param mixed $input |
||
173 | * @param int $index |
||
174 | * |
||
175 | * @return void |
||
176 | * |
||
177 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
178 | */ |
||
179 | 1 | private function executeBlock($input, int $index): void |
|
190 | |||
191 | /** |
||
192 | * @param array $indexes |
||
193 | * |
||
194 | * @return void |
||
195 | * |
||
196 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
197 | */ |
||
198 | 1 | private function executeStarts(array $indexes): void |
|
207 | |||
208 | /** |
||
209 | * @param array $indexes |
||
210 | * |
||
211 | * @return void |
||
212 | * |
||
213 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
214 | */ |
||
215 | 1 | private function executeEnds(array $indexes): void |
|
224 | |||
225 | /** |
||
226 | * @param array $rules |
||
227 | * |
||
228 | * @return self |
||
229 | */ |
||
230 | 2 | private function setAttributeRules(array $rules): self |
|
238 | |||
239 | /** |
||
240 | * @return int[] |
||
241 | */ |
||
242 | 1 | private function getAttributeRules(): array |
|
246 | |||
247 | /** |
||
248 | * @return array |
||
249 | */ |
||
250 | 2 | private function getBlocks(): array |
|
254 | |||
255 | /** |
||
256 | * @param array $blocks |
||
257 | * |
||
258 | * @return self |
||
259 | */ |
||
260 | 2 | private function setBlocks(array $blocks): self |
|
266 | |||
267 | /** |
||
268 | * @param string $name |
||
269 | * |
||
270 | * @return int|null |
||
271 | * |
||
272 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
273 | */ |
||
274 | 1 | private function getAttributeIndex(string $name): ?int |
|
281 | |||
282 | /** |
||
283 | * @param array $rules |
||
284 | * |
||
285 | * @return bool |
||
286 | * |
||
287 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
288 | */ |
||
289 | 2 | private function debugCheckIndexesExist(array $rules): bool |
|
305 | } |
||
306 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.