Skip to content

Commit 6fc5179

Browse files
committed
Fix missing types
1 parent 054bc67 commit 6fc5179

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/TextUI/Configuration/SourceFilter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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;

src/Util/FileMatcher.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
use function count;
1515
use function ctype_alpha;
1616
use function preg_quote;
17-
use function sprintf;
1817
use 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 .= '(/|$)';

0 commit comments

Comments
 (0)