Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class StorageRuntime implements StorageInterface |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @var array |
||
10 | */ |
||
11 | protected static $mem = []; |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $file; |
||
16 | |||
17 | /** |
||
18 | * @param string $file |
||
19 | */ |
||
20 | public function __construct(string $file) |
||
21 | { |
||
22 | $this->file = $file; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @param bool $lock |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | public function load(bool $lock): array |
||
31 | { |
||
32 | return static::$mem[$this->file] ?? []; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param array $collectionData |
||
37 | */ |
||
38 | public function save(array $collectionData) |
||
39 | { |
||
40 | static::$mem[$this->file] = $collectionData; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | */ |
||
45 | public static function clear() |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return array |
||
52 | */ |
||
53 | public static function dump(): array |
||
54 | { |
||
55 | return static::$mem; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | */ |
||
60 | public function drop() |
||
63 | } |
||
64 | } |
||
65 |