| Conditions | 4 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 9 | public function addResult(string $attribute, Result $result): void |
|
| 24 | { |
||
| 25 | 9 | if (!$result->isValid()) { |
|
| 26 | 8 | $this->isValid = false; |
|
| 27 | } |
||
| 28 | |||
| 29 | 9 | if (!isset($this->results[$attribute])) { |
|
| 30 | 9 | $this->results[$attribute] = $result; |
|
| 31 | 9 | return; |
|
| 32 | } |
||
| 33 | |||
| 34 | 3 | if ($result->isValid()) { |
|
| 35 | 1 | return; |
|
| 36 | } |
||
| 37 | |||
| 38 | 2 | $this->results[$attribute]->addResult($result); |
|
| 39 | 2 | } |
|
| 77 |