1 | <?php |
||
10 | class SnapshotService extends Service |
||
11 | { |
||
12 | /** @var SnapshotConfig */ |
||
13 | private $config; |
||
14 | |||
15 | /** @var FileManager */ |
||
16 | private $files; |
||
17 | |||
18 | /** |
||
19 | * SnapshotService constructor. |
||
20 | * |
||
21 | * @param SnapshotConfig $config |
||
22 | * @param FileManager $files |
||
23 | */ |
||
24 | public function __construct(SnapshotConfig $config, FileManager $files) |
||
29 | |||
30 | /** |
||
31 | * Get snapshots. |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public function getSnapshots() |
||
53 | |||
54 | /** |
||
55 | * @param string $filename |
||
56 | * @return null|FileSnapshot |
||
57 | */ |
||
58 | public function getSnapshot(string $filename) |
||
66 | |||
67 | /** |
||
68 | * |
||
69 | */ |
||
70 | public function deleteSnapshots() |
||
76 | |||
77 | /** |
||
78 | * @param FileSnapshot $filename |
||
79 | */ |
||
80 | public function deleteSnapshot(FileSnapshot $filename) |
||
84 | |||
85 | /** |
||
86 | * @param string $filename |
||
87 | * @return bool |
||
88 | */ |
||
89 | public function exists(string $filename): bool |
||
93 | |||
94 | /** |
||
95 | * @param FileSnapshot $snapshot |
||
96 | * @return string |
||
97 | */ |
||
98 | public function read(FileSnapshot $snapshot): string |
||
102 | } |