Total Complexity | 8 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | final class FlysystemStorage extends AbstractStorage |
||
16 | { |
||
17 | private $registry; |
||
18 | |||
19 | public function __construct(Types $types, Keys $keys, Registry $registry) |
||
20 | { |
||
21 | parent::__construct($types, $keys); |
||
22 | |||
23 | $this->registry = $registry; |
||
24 | } |
||
25 | |||
26 | protected function readFile(File $file): string |
||
27 | { |
||
28 | return $this->registry |
||
|
|||
29 | ->get($file->storage()) |
||
30 | ->read($file->key()) |
||
31 | ; |
||
32 | } |
||
33 | |||
34 | protected function streamFile(File $file) |
||
35 | { |
||
36 | return $this->registry |
||
37 | ->get($file->storage()) |
||
38 | ->readStream($file->key()) |
||
39 | ; |
||
40 | } |
||
41 | |||
42 | protected function deleteFile(File $file): void |
||
43 | { |
||
44 | $this->registry |
||
45 | ->get($file->storage()) |
||
46 | ->delete($file->key()) |
||
47 | ; |
||
48 | } |
||
49 | |||
50 | protected function writeFile(string $key, string $storage, $stream): void |
||
64 | } |
||
65 | } |
||
66 | } |
||
67 |