| Total Complexity | 10 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class EvaluatedValueList implements EvaluatedValueListInterface |
||
| 10 | { |
||
| 11 | |||
| 12 | private $results; |
||
| 13 | |||
| 14 | private $indexMap; |
||
| 15 | |||
| 16 | private $values; |
||
| 17 | |||
| 18 | 14 | public function __construct(IndexMapInterface $indexMap, bool ...$results) |
|
| 22 | 14 | } |
|
| 23 | |||
| 24 | 4 | public function getValue(int $index): ValueInterface |
|
| 25 | { |
||
| 26 | 4 | $values = $this->getValues(); |
|
| 27 | 4 | if (!isset($values[$index])) { |
|
| 28 | 1 | throw new Exception\ValueNotFoundException($index, $this); |
|
| 29 | } |
||
| 30 | |||
| 31 | 3 | return $values[$index]; |
|
| 32 | } |
||
| 33 | |||
| 34 | 1 | public function getIndexMap(): IndexMapInterface |
|
| 35 | { |
||
| 36 | 1 | return $this->indexMap; |
|
| 37 | } |
||
| 38 | |||
| 39 | 4 | public function getResults(): array |
|
| 40 | { |
||
| 41 | 4 | return $this->results; |
|
| 42 | } |
||
| 43 | |||
| 44 | 3 | public function getResult(int $index): bool |
|
| 45 | { |
||
| 46 | 3 | if (!isset($this->results[$index])) { |
|
| 47 | 1 | throw new Exception\ResultNotFoundException($index, $this); |
|
| 48 | } |
||
| 49 | |||
| 50 | 2 | return $this->results[$index]; |
|
| 51 | } |
||
| 52 | |||
| 53 | 6 | public function getValues(): array |
|
| 60 | } |
||
| 61 | |||
| 62 | 4 | private function createResultValue(bool $result): EvaluatedValueInterface |
|
| 65 | } |
||
| 66 | } |
||
| 67 |