| Conditions | 4 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 4 | public function addResult(string $attribute, Result $result): void |
|
| 17 | { |
||
| 18 | 4 | if (!isset($this->results[$attribute])) { |
|
| 19 | 4 | $this->results[$attribute] = $result; |
|
| 20 | 4 | return; |
|
| 21 | } |
||
| 22 | 2 | if ($result->isValid()) { |
|
| 23 | 1 | return; |
|
| 24 | } |
||
| 25 | 1 | foreach ($result->getErrors() as $error) { |
|
| 26 | 1 | $this->results[$attribute]->addError($error); |
|
| 27 | } |
||
| 44 |