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