File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ public function __construct(Source $source)
5050 $ this ->source = $ source ;
5151 $ this ->includeDirectoryRegexes = array_map (static function (FilterDirectory $ directory )
5252 {
53- return [$ directory , Glob:: toRegEx ( self ::toGlob ($ directory) )];
53+ return [$ directory , self ::toGlob ($ directory )];
5454 }, $ source ->includeDirectories ()->asArray ());
5555 $ this ->excludeDirectoryRegexes = array_map (static function (FilterDirectory $ directory )
5656 {
57- return [$ directory , Glob:: toRegEx ( self ::toGlob ($ directory) )];
57+ return [$ directory , self ::toGlob ($ directory )];
5858 }, $ source ->excludeDirectories ()->asArray ());
5959 }
6060
@@ -95,8 +95,13 @@ public function includes(string $path): bool
9595
9696 public static function toGlob (FilterDirectory $ directory ): string
9797 {
98- $ glob = sprintf ('%s/**/* ' , $ directory ->path ());
99- return $ glob ;
98+ $ path = $ directory ->path ();
99+
100+ if (Glob::isDynamic ($ path )) {
101+ return Glob::toRegEx ($ path );
102+ }
103+
104+ return Glob::toRegEx (sprintf ('%s/**/* ' , $ directory ->path ()));
100105 }
101106
102107 private static function filenameMatches (FilterDirectory $ directory , string $ filename ): bool
You can’t perform that action at this time.
0 commit comments