Total Complexity | 4 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class FinalStorage |
||
17 | { |
||
18 | protected IFinalStorage $storage; |
||
19 | protected KeyEncoders\AEncoder $keyEncoder; |
||
20 | |||
21 | public function __construct( |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param Data $data |
||
32 | * @throws UploadException |
||
33 | * @return bool |
||
34 | */ |
||
35 | public function exists(Data $data): bool |
||
36 | { |
||
37 | return $this->storage->exists($this->keyEncoder->toPath($data)); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param string $key |
||
42 | * @param resource $source |
||
43 | * @throws UploadException |
||
44 | * @return bool |
||
45 | */ |
||
46 | public function store(string $key, $source): bool |
||
47 | { |
||
48 | return $this->storage->store($key, $source); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param Data $data |
||
53 | * @throws UploadException |
||
54 | * @return string |
||
55 | */ |
||
56 | public function findName(Data $data): string |
||
59 | } |
||
60 | } |
||
61 |