-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
It seems that the toRegex method in Finder\Glob.php is duplicated in the Finder\Expression\Glob.php. There are some small differences in the code though:
< public static function toRegex($glob, $strictLeadingDot = true, $strictWildcardSlash = true)
---
> public function toRegex($strictLeadingDot = true, $strictWildcardSlash = true)
7c7
< $sizeGlob = strlen($glob);
---
> $sizeGlob = strlen($this->pattern);
9c9
< $car = $glob[$i];
---
> $car = $this->pattern[$i];
55c55
< return '#^'.$regex.'$#';
---
> return new Regex('^'.$regex.'$');
None which seems strange. It might be a good idea to actually remove the toRegex from the Expression/Glob.php method, and instead use the Glob::toRegex in its place (this file is not unit-tested neither).
Any suggestions / comments on this? I'm happy to create a PR for this.
Metadata
Metadata
Assignees
Labels
No labels