Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
| ApieFile | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
6 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| get | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSize | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getETag | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getContentType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Webdav\Dav; |
| 3 | |
| 4 | use Apie\ApieFileSystem\Virtual\VirtualFileInterface; |
| 5 | use Sabre\DAV\File; |
| 6 | |
| 7 | class ApieFile extends File |
| 8 | { |
| 9 | public function __construct(private readonly VirtualFileInterface $file) |
| 10 | { |
| 11 | } |
| 12 | |
| 13 | public function getName() |
| 14 | { |
| 15 | return $this->file->getName(); |
| 16 | } |
| 17 | |
| 18 | public function get() |
| 19 | { |
| 20 | return $this->file->getContents(); |
| 21 | } |
| 22 | |
| 23 | public function getSize() |
| 24 | { |
| 25 | return $this->file->getSize(); |
| 26 | } |
| 27 | |
| 28 | public function getETag() |
| 29 | { |
| 30 | return md5($this->file->getContents()); |
| 31 | } |
| 32 | |
| 33 | public function getContentType() |
| 34 | { |
| 35 | return $this->file->getMimeType(); |
| 36 | } |
| 37 | } |