Total Complexity | 5 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class InvalidNodeDataException extends RuntimeException implements |
||
14 | ExceptionInterface, |
||
15 | PathAwareInterface, |
||
16 | DataAwareInterface |
||
17 | { |
||
18 | |||
19 | private $data; |
||
20 | |||
21 | private $path; |
||
22 | |||
23 | public function __construct($data, PathInterface $path, Throwable $previous = null) |
||
24 | { |
||
25 | $this->data = $data; |
||
26 | $this->path = $path; |
||
27 | parent::__construct($this->buildMessage(), 0, $previous); |
||
28 | } |
||
29 | |||
30 | private function buildMessage(): string |
||
31 | { |
||
32 | return "Invalid data in decoded JSON at {$this->buildPath()}"; |
||
33 | } |
||
34 | |||
35 | public function getData() |
||
36 | { |
||
37 | return $this->data; |
||
38 | } |
||
39 | |||
40 | public function getPath(): PathInterface |
||
41 | { |
||
42 | return $this->path; |
||
43 | } |
||
44 | |||
45 | private function buildPath(): string |
||
48 | } |
||
49 | } |
||
50 |