Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1.0019 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 79 | public function validate(Ruleable $element): bool |
|
29 | { |
||
30 | |||
31 | 79 | $method = $this->getRequest()->getRequest()->getMethod(); |
|
32 | |||
33 | 79 | $requestData = match (strtolower($method)) { |
|
34 | 76 | 'get' => $this->getRequest()->getQueryData()->toArray(), |
|
35 | 3 | 'post' => $this->getRequest()->getPostData()->toArray(), |
|
36 | default => [] |
||
37 | }; |
||
38 | |||
39 | 79 | $value = \getValueByIndexPath($element->getName(), $requestData); |
|
|
|||
40 | |||
41 | 79 | return $this->check($value); |
|
42 | } |
||
50 |