| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | class YandexDisk extends Remote |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * YandexDisk api client. |
||
| 25 | * |
||
| 26 | * @var Disk |
||
| 27 | */ |
||
| 28 | protected $disk; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * YandexDisk constructor. |
||
| 32 | * |
||
| 33 | * @param Disk $disk |
||
| 34 | * @param Closed $yandexFile |
||
| 35 | */ |
||
| 36 | 4 | public function __construct(Disk $disk, Closed $yandexFile) |
|
| 37 | { |
||
| 38 | 4 | $this->disk = $disk; |
|
| 39 | 4 | $this->filename = $yandexFile->get('name'); |
|
| 40 | 4 | $this->pathname = $yandexFile->get('path'); |
|
| 41 | 4 | $this->size = $yandexFile->get('size'); |
|
| 42 | 4 | $this->lastModified = strtotime($yandexFile->get('modified')); |
|
| 43 | 4 | } |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Deletes the file on YandexDisk. |
||
| 47 | * |
||
| 48 | * @throws Exception |
||
| 49 | */ |
||
| 50 | 1 | public function unlink() |
|
| 57 | } |
||
| 58 | } |
||
| 60 |