File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,10 @@ final class SourceFilter
3838 public static function instance (): self
3939 {
4040 if (self ::$ instance === null ) {
41- $ source = Registry::get ()->source ();
41+ $ source = Registry::get ()->source ();
42+ self ::$ instance = new self ($ source );
4243
43- return new self ( $ source ) ;
44+ return self :: $ instance ;
4445 }
4546
4647 return self ::$ instance ;
Original file line number Diff line number Diff line change 1414use function count ;
1515use function ctype_alpha ;
1616use function preg_quote ;
17- use function sprintf ;
1817use function strlen ;
19- use RuntimeException ;
2018
2119/**
2220 * FileMatcher ultimately attempts to emulate the behavior `php-file-iterator`
@@ -90,11 +88,9 @@ private static function mapToRegex(array $tokens): FileMatcherRegex
9088 self ::T_BRACKET_OPEN => '[ ' ,
9189 self ::T_BRACKET_CLOSE => '] ' ,
9290 self ::T_HYPHEN => '- ' ,
91+ self ::T_COLON => ': ' ,
92+ self ::T_BACKSLASH => '\\' ,
9393 self ::T_CHAR_CLASS => '[: ' . $ token [1 ] . ':] ' ,
94- default => throw new RuntimeException (sprintf (
95- 'Unhandled token type: %s - this should not happen ' ,
96- $ type ,
97- )),
9894 };
9995 }
10096 $ regex .= '(/|$) ' ;
You can’t perform that action at this time.
0 commit comments