| Total Complexity | 6 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class DeletePhp extends BaseProcess |
||
| 11 | { |
||
| 12 | 12 | public function run(): array |
|
| 13 | { |
||
| 14 | 12 | $this->checkExists($this->path()); |
|
| 15 | |||
| 16 | 12 | $this->delete() |
|
| 17 | 6 | ? $this->push('*', Status::DELETED) |
|
| 18 | 6 | : $this->push('*', Status::SKIPPED); |
|
| 19 | |||
| 20 | 12 | return $this->result(); |
|
| 21 | } |
||
| 22 | |||
| 23 | 12 | protected function delete(): bool |
|
| 24 | { |
||
| 25 | 12 | return ! $this->isProtected() |
|
| 26 | 6 | ? IlluminateFile::deleteDirectory($this->path()) |
|
| 27 | 12 | : false; |
|
| 28 | } |
||
| 29 | |||
| 30 | 12 | protected function path(): string |
|
| 33 | } |
||
| 34 | |||
| 35 | 12 | protected function isProtected(): bool |
|
| 40 |