Conditions | 4 |
Paths | 6 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 4 | public function validate(IValidate $entry): void |
|
20 | { |
||
21 | 4 | $last = null; |
|
22 | 4 | foreach ($this->againstValue as $item) { |
|
23 | /** @var ARule $item */ |
||
24 | try { |
||
25 | 4 | $item->validate($entry); |
|
26 | 3 | } catch (RuleException $ex) { |
|
27 | // not good, continue for any other |
||
28 | 3 | $ex->setPrev($last); |
|
29 | 3 | $last = $ex; |
|
30 | } |
||
31 | } |
||
32 | 4 | if (!empty($last)) { |
|
33 | // it will die when something has been found |
||
34 | 3 | throw new RuleException($this->errorText, 0, $last); |
|
35 | } |
||
38 |