Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 9 | public function validate($toValidate): bool |
|
18 | { |
||
19 | 9 | foreach ($this->validators as $validatorFn) { |
|
20 | 9 | $this->isValid = $this->isValid && $validatorFn($toValidate); |
|
21 | } |
||
22 | |||
23 | 9 | $toReturn = $this->isValid; |
|
24 | |||
25 | // Reset isValid property |
||
26 | 9 | $this->isValid = true; |
|
27 | 9 | return $toReturn; |
|
28 | } |
||
30 |