| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait UploadEntityFileSystem |
||
| 10 | { |
||
| 11 | protected string $folder = ''; |
||
| 12 | |||
| 13 | protected string $disk; |
||
| 14 | |||
| 15 | protected string $localDisk; |
||
| 16 | |||
| 17 | |||
| 18 | public function folder(string $name): UploadEntities |
||
| 19 | { |
||
| 20 | if (!$this->folder) { |
||
| 21 | $this->folder = str_replace('_', '-', Str::kebab($name)); |
||
| 22 | } |
||
| 23 | |||
| 24 | return $this; |
||
|
|
|||
| 25 | } |
||
| 26 | |||
| 27 | public function disk(string $disk): UploadEntities |
||
| 28 | { |
||
| 29 | $this->disk = $disk; |
||
| 30 | |||
| 31 | return $this; |
||
| 32 | } |
||
| 33 | |||
| 34 | protected function driverIsLocal(): bool |
||
| 35 | { |
||
| 36 | return disk_driver_is_local($this->disk); |
||
| 37 | } |
||
| 38 | |||
| 39 | protected function driverIsNotLocal(): bool |
||
| 42 | } |
||
| 43 | } |
||
| 44 |