Skip to content

Commit 06bee88

Browse files
Refactor directory removal function for readability
1 parent f304a0a commit 06bee88

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cleanup.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727

2828
function removeDirectory(string $dir): bool
2929
{
30-
if (!is_dir($dir)) {
30+
if (! is_dir($dir)) {
3131
return false;
3232
}
3333

3434
$files = array_diff(scandir($dir), ['.', '..']);
3535

3636
foreach ($files as $file) {
37-
$path = realpath($dir . DIRECTORY_SEPARATOR . $file);
37+
$path = realpath($dir.DIRECTORY_SEPARATOR.$file);
3838

3939
// Als realpath faalt (bv. bestand is al weg), sla over
4040
if ($path === false) {
@@ -50,4 +50,3 @@ function removeDirectory(string $dir): bool
5050

5151
return rmdir($dir);
5252
}
53-

0 commit comments

Comments
 (0)