| Conditions | 4 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function check($value): bool |
||
| 33 | { |
||
| 34 | $this->requireParameters(['fields']); |
||
| 35 | |||
| 36 | $parameters = $this->parameter('fields'); |
||
| 37 | |||
| 38 | $this->setParameterTextValues($parameters, 'other'); |
||
| 39 | |||
| 40 | $requiredValidator = $this->getRuleValidator('required'); |
||
| 41 | $requiredValidator->setAttribute($this->attribute); |
||
|
|
|||
| 42 | |||
| 43 | if ($requiredValidator->check($value)) { |
||
| 44 | foreach ($parameters as $parameter) { |
||
| 45 | $requiredValidator->setAttribute(new Attribute($this->validation, $parameter)); |
||
| 46 | if ($requiredValidator->check($this->validation->getValue($parameter))) { |
||
| 47 | return false; |
||
| 48 | } |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | return true; |
||
| 53 | } |
||
| 55 |