| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class ResultNotFoundException extends OutOfRangeException implements ExceptionInterface |
||
| 11 | { |
||
| 12 | |||
| 13 | private $index; |
||
| 14 | |||
| 15 | private $values; |
||
| 16 | |||
| 17 | 6 | public function __construct(int $index, ValueListInterface $valueList, Throwable $previous = null) |
|
| 18 | { |
||
| 19 | 6 | $this->index = $index; |
|
| 20 | 6 | $this->values = $valueList; |
|
| 21 | 6 | parent::__construct($this->buildMessage(), 0, $previous); |
|
| 22 | 6 | } |
|
| 23 | |||
| 24 | 6 | private function buildMessage(): string |
|
| 25 | { |
||
| 26 | 6 | return "Result not found in list at position {$this->index}"; |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | public function getIndex(): int |
|
| 30 | { |
||
| 31 | 1 | return $this->index; |
|
| 32 | } |
||
| 33 | |||
| 34 | 1 | public function getValues(): ValueListInterface |
|
| 37 | } |
||
| 38 | } |
||
| 39 |