| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 77.78% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class IllegalTargetException extends RuntimeException |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string[] |
||
| 12 | */ |
||
| 13 | private $path; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param string[] $path |
||
| 17 | * @param null $message |
||
|
|
|||
| 18 | * @param Throwable|null $previous |
||
| 19 | */ |
||
| 20 | 8 | public function __construct(array $path, $message = null, Throwable $previous = null) |
|
| 21 | { |
||
| 22 | 8 | $this->path = $path; |
|
| 23 | 8 | if (!$message) { |
|
| 24 | 3 | $template = 'Can not access target at path `%s`'; |
|
| 25 | 3 | $message = sprintf($template, Paths::toString($path)); |
|
| 26 | } |
||
| 27 | 8 | parent::__construct($message, $previous); |
|
| 28 | 8 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @return string[] |
||
| 32 | */ |
||
| 33 | public function getPath() |
||
| 36 | } |
||
| 37 | } |
||
| 38 |