Total Complexity | 4 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
5 | abstract class PathException extends \OutOfBoundsException |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | protected string $key; |
||
11 | /** |
||
12 | * @var string[] |
||
13 | */ |
||
14 | protected array $path; |
||
15 | /** |
||
16 | * @var non-empty-string |
||
|
|||
17 | */ |
||
18 | protected string $pathDelimiter; |
||
19 | |||
20 | /** |
||
21 | * @param string $key |
||
22 | * @param string[] $path |
||
23 | * @param non-empty-string $pathDelimiter |
||
24 | */ |
||
25 | public function __construct(string $key, array $path, string $pathDelimiter) |
||
26 | { |
||
27 | parent::__construct(); |
||
28 | $this->key = $key; |
||
29 | $this->path = $path; |
||
30 | $this->pathDelimiter = $pathDelimiter; |
||
31 | parent::__construct("Key '{$this->key}' is not found on path '{$this->getPathString()}'"); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return string |
||
36 | */ |
||
37 | public function getKey(): string |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return string[] |
||
44 | */ |
||
45 | public function getPath(): array |
||
46 | { |
||
47 | return $this->path; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getPathString(): string |
||
56 | } |
||
57 | } |
||
58 |