| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 5 | public function validate(IValidate $entry): void |
|
| 20 | { |
||
| 21 | 5 | $last = null; |
|
| 22 | 5 | foreach ($this->againstValue as $item) { |
|
| 23 | /** @var ARule $item */ |
||
| 24 | try { |
||
| 25 | 5 | $item->validate($entry); |
|
| 26 | 3 | return; // one matched, need no more lookup |
|
| 27 | 3 | } catch (RuleException $ex) { |
|
| 28 | // not good, continue for any other |
||
| 29 | 3 | $ex->setPrev($last); |
|
| 30 | 3 | $last = $ex; |
|
| 31 | } |
||
| 32 | } |
||
| 33 | 2 | throw new RuleException($this->errorText, 0, $last); |
|
| 34 | } |
||
| 36 |