File tree 2 files changed +5
-8
lines changed 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,10 @@ final class SourceFilter
38
38
public static function instance (): self
39
39
{
40
40
if (self ::$ instance === null ) {
41
- $ source = Registry::get ()->source ();
41
+ $ source = Registry::get ()->source ();
42
+ self ::$ instance = new self ($ source );
42
43
43
- return new self ( $ source ) ;
44
+ return self :: $ instance ;
44
45
}
45
46
46
47
return self ::$ instance ;
Original file line number Diff line number Diff line change 14
14
use function count ;
15
15
use function ctype_alpha ;
16
16
use function preg_quote ;
17
- use function sprintf ;
18
17
use function strlen ;
19
- use RuntimeException ;
20
18
21
19
/**
22
20
* FileMatcher ultimately attempts to emulate the behavior `php-file-iterator`
@@ -90,11 +88,9 @@ private static function mapToRegex(array $tokens): FileMatcherRegex
90
88
self ::T_BRACKET_OPEN => '[ ' ,
91
89
self ::T_BRACKET_CLOSE => '] ' ,
92
90
self ::T_HYPHEN => '- ' ,
91
+ self ::T_COLON => ': ' ,
92
+ self ::T_BACKSLASH => '\\' ,
93
93
self ::T_CHAR_CLASS => '[: ' . $ token [1 ] . ':] ' ,
94
- default => throw new RuntimeException (sprintf (
95
- 'Unhandled token type: %s - this should not happen ' ,
96
- $ type ,
97
- )),
98
94
};
99
95
}
100
96
$ regex .= '(/|$) ' ;
You can’t perform that action at this time.
0 commit comments