| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 26 | 93 | public function validate(): bool |
|
| 27 | { |
||
| 28 | /** @var array $requestData */ |
||
| 29 | 93 | $requestData = match ($this->form->getMethod()) { |
|
| 30 | 93 | 'GET' => $this->form->getRequest()->getQueryParams(), |
|
| 31 | 93 | 'POST' => $this->form->getRequest()->getParsedBody(), |
|
| 32 | 93 | default => [] |
|
| 33 | 93 | }; |
|
| 34 | /** @var string $value */ |
||
| 35 | 93 | $value = \getValueByIndexPath( |
|
| 36 | 93 | Form::_TOKEN_SUBMIT_, |
|
| 37 | 93 | $requestData |
|
| 38 | 93 | ); |
|
| 39 | |||
| 40 | 93 | return $value == $this->getToken(); |
|
| 41 | } |
||
| 43 |