1 | <?php |
||
5 | class JsonLoader { |
||
6 | |||
7 | const NO_ERROR = 0; |
||
8 | const ERROR_NO_READABLE = 1; |
||
9 | const ERROR_INVALID_JSON = 2; |
||
10 | |||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $path; |
||
15 | |||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $errorCode; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $errorMessage; |
||
25 | |||
26 | /** |
||
27 | * @var mixed |
||
28 | */ |
||
29 | private $data; |
||
30 | |||
31 | /** |
||
32 | * @param string $path |
||
33 | */ |
||
34 | 3 | public function __construct($path) |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 3 | public function getPath() |
|
57 | |||
58 | /** |
||
59 | * @return int |
||
60 | */ |
||
61 | 3 | public function getErrorCode() |
|
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | 2 | public function getErrorMessage() |
|
73 | |||
74 | /** |
||
75 | * @return mixed |
||
76 | */ |
||
77 | 3 | public function getData() |
|
81 | |||
82 | } |
||
83 |