| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | class Json extends Base |
||
| 27 | { |
||
| 28 | 62 | public function load(string $path): array |
|
| 29 | { |
||
| 30 | 62 | if ($this->doesntExists($path)) { |
|
| 31 | 62 | return []; |
|
| 32 | } |
||
| 33 | |||
| 34 | 62 | $content = Pretty::make()->loadRaw($path); |
|
| 35 | |||
| 36 | 62 | $items = json_decode($content, true); |
|
| 37 | |||
| 38 | 62 | return $this->correct($items); |
|
| 39 | } |
||
| 40 | |||
| 41 | 62 | public function store(string $path, $content): string |
|
| 42 | { |
||
| 43 | 62 | Arr::storeAsJson($path, $content, false, JSON_UNESCAPED_UNICODE ^ JSON_PRETTY_PRINT); |
|
| 44 | |||
| 45 | 62 | return $path; |
|
| 46 | } |
||
| 47 | |||
| 48 | 4 | public function delete(string $path): void |
|
| 51 | 4 | } |
|
| 52 | } |
||
| 53 |