| Total Complexity | 7 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | trait ReadableTrait |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * {@see EntryInterface::getPathname()} |
||
| 18 | */ |
||
| 19 | abstract public function getPathname(): string; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * {@see EntryInterface::getBucket()} |
||
| 23 | */ |
||
| 24 | abstract public function getBucket(): BucketInterface; |
||
| 25 | |||
| 26 | public function exists(): bool |
||
| 27 | { |
||
| 28 | return $this->getBucket()->exists($this->getPathname()); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getContents(): string |
||
| 32 | { |
||
| 33 | return $this->getBucket()->getContents($this->getPathname()); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getStream() |
||
| 37 | { |
||
| 38 | return $this->getBucket()->getStream($this->getPathname()); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return positive-int |
||
|
|
|||
| 43 | */ |
||
| 44 | public function getLastModified(): int |
||
| 45 | { |
||
| 46 | return $this->getBucket()->getLastModified($this->getPathname()); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return positive-int|0 |
||
| 51 | */ |
||
| 52 | public function getSize(): int |
||
| 53 | { |
||
| 54 | return $this->getBucket()->getSize($this->getPathname()); |
||
| 55 | } |
||
| 56 | |||
| 57 | public function getMimeType(): string |
||
| 58 | { |
||
| 59 | return $this->getBucket()->getMimeType($this->getPathname()); |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return Visibility::VISIBILITY_* |
||
| 64 | */ |
||
| 65 | #[ExpectedValues(valuesFromClass: Visibility::class)] |
||
| 69 | } |
||
| 70 | } |
||
| 71 |