Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | abstract class Filesystem implements Contract |
||
11 | { |
||
12 | use Logger; |
||
|
|||
13 | |||
14 | 28 | public function ensureKeys(string $path): void |
|
15 | { |
||
16 | 28 | $this->log('Ensure array keys exist for a file', $path); |
|
17 | |||
18 | 28 | $content = $this->load($path); |
|
19 | 28 | ||
20 | 28 | $this->store($path, $content); |
|
21 | } |
||
22 | 28 | ||
23 | 28 | protected function correctValues(array $items): array |
|
24 | 28 | { |
|
25 | 28 | $this->log('Correcting array values...'); |
|
26 | |||
27 | $callback = static function ($value) { |
||
28 | 28 | return stripslashes($value); |
|
29 | }; |
||
30 | 28 | ||
31 | return Arrayable::of($items) |
||
32 | 28 | ->map($callback, true) |
|
33 | ->renameKeys($callback) |
||
34 | ->get(); |
||
35 | } |
||
36 | |||
37 | protected function doesntExists(string $path): bool |
||
42 | } |
||
43 | } |
||
44 |