| Total Complexity | 7 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 81.25% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class ResultSet implements \IteratorAggregate |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var Result[] |
||
| 13 | */ |
||
| 14 | private array $results = []; |
||
| 15 | |||
| 16 | 2 | public function addResult(string $attribute, Result $result): self |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | public function getResult(string $attribute): Result |
|
| 35 | { |
||
| 36 | 2 | if (!isset($this->results[$attribute])) { |
|
| 37 | throw new \InvalidArgumentException("There is no result for attribute \"$attribute\""); |
||
| 38 | } |
||
| 39 | |||
| 40 | 2 | return $this->results[$attribute]; |
|
| 41 | } |
||
| 42 | |||
| 43 | public function getIterator() |
||
| 46 | } |
||
| 47 | } |
||
| 48 |