From 56c751bbc9b78c02542d72bd0e29aa05f1d92069 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 2 Sep 2024 18:57:57 +0700 Subject: [PATCH] [FileSystem] Add data and writable to not include on InitFilePathsResolver --- src/FileSystem/InitFilePathsResolver.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/FileSystem/InitFilePathsResolver.php b/src/FileSystem/InitFilePathsResolver.php index 9539abcd15d..2883f44b4a6 100644 --- a/src/FileSystem/InitFilePathsResolver.php +++ b/src/FileSystem/InitFilePathsResolver.php @@ -12,6 +12,12 @@ */ final class InitFilePathsResolver { + /** + * @var string + * @see https://regex101.com/r/XkQ6Pe/1 + */ + private const DO_NOT_INCLUDE_PATHS_REGEX = '#(vendor|var|stubs|temp|templates|tmp|e2e|bin|build|Migrations|data(?:base)?|storage|migrations|writable)#'; + /** * @return string[] */ @@ -21,7 +27,7 @@ public function resolve(string $projectDirectory): array ->directories() ->depth(0) // system files - ->notPath('#(vendor|var|stubs|temp|templates|tmp|e2e|bin|build|Migrations|database|storage|migrations)#') + ->notPath(self::DO_NOT_INCLUDE_PATHS_REGEX) ->in($projectDirectory) ->sortByName();