Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
get rid of GLOB_BRACE
Browse files Browse the repository at this point in the history
  • Loading branch information
arrilot committed Jun 24, 2021
1 parent 6e708a7 commit 233c218
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Commands/GenerateClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,16 @@ private function recursiveClearDirectory(string $dir, int $level = 0)
return;
}

foreach (glob($dir . "/{*,.[!.]*,..?*}", GLOB_BRACE) as $file) {
if ($level === 0 && in_array(str_replace($this->outputDir . "/", "", $file), $this->filesToIgnoreDuringCleanup)) {
foreach (scandir($dir) as $fileWithoutDir) {
if (in_array($fileWithoutDir, ['..', '.'])) {
continue;
}
$file = $dir . "/" . $fileWithoutDir;

if ($level === 0 && in_array($fileWithoutDir, $this->filesToIgnoreDuringCleanup)) {
continue;
}

if (is_dir($file)) {
$this->recursiveClearDirectory($file, $level + 1);
} else {
Expand Down

0 comments on commit 233c218

Please sign in to comment.