| Conditions | 7 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 7 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 1 | protected function removeCycle(string $dirPath, string $sign = DIRECTORY_SEPARATOR): bool |
|
| 20 | { |
||
| 21 | 1 | $path = static::removeEndingSign($dirPath, $sign); |
|
| 22 | 1 | if (is_dir($path) && $fileListing = scandir($path)) { |
|
| 23 | 1 | foreach ($fileListing as $fileName) { |
|
| 24 | 1 | if (is_dir($path . $sign . $fileName)) { |
|
| 25 | 1 | if (('.' != $fileName) && ('..' != $fileName)) { |
|
| 26 | 1 | $this->removeCycle($path . $sign . $fileName); |
|
| 27 | 1 | rmdir($path . $sign . $fileName); |
|
| 28 | } |
||
| 29 | } else { |
||
| 30 | 1 | unlink($path . $sign . $fileName); |
|
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | 1 | return true; |
|
| 35 | } |
||
| 48 |