Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | public function delete(string $path = null) |
||
45 | { |
||
46 | $folder = $path ?? $this->path; |
||
47 | |||
48 | $files = array_diff(scandir($folder), array('.', '..')); |
||
49 | |||
50 | foreach ($files as $file) { |
||
51 | |||
52 | $item = "$folder/$file"; |
||
53 | |||
54 | is_dir($item) ? $this->delete($item) : unlink($item); |
||
55 | } |
||
56 | |||
57 | return rmdir($folder); |
||
58 | } |
||
70 | } |