| Total Complexity | 7 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 78.56% |
| 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 | 4 | public function addResult(string $attribute, Result $result): void |
|
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | 4 | public function getResult(string $attribute): Result |
|
| 31 | { |
||
| 32 | 4 | if (!isset($this->results[$attribute])) { |
|
| 33 | throw new \InvalidArgumentException("There is no result for attribute \"$attribute\""); |
||
| 34 | } |
||
| 35 | |||
| 36 | 4 | return $this->results[$attribute]; |
|
| 37 | } |
||
| 38 | |||
| 39 | public function getIterator() |
||
| 42 | } |
||
| 43 | } |
||
| 44 |