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();