Skip to content

Commit 72e170a

Browse files
staabmsebastianbergmann
authored andcommitted
Simplify NameFilterIterator
1 parent e1a0277 commit 72e170a

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/Runner/Filter/NameFilterIterator.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use function end;
1313
use function preg_match;
1414
use function sprintf;
15-
use function str_replace;
1615
use function substr;
1716
use PHPUnit\Framework\Test;
1817
use PHPUnit\Framework\TestSuite;
@@ -116,15 +115,10 @@ private function prepareFilter(string $filter): array
116115
);
117116
}
118117

119-
// Escape delimiters in regular expression. Do NOT use preg_quote,
120-
// to keep magic characters.
118+
// Do NOT use preg_quote, to keep magic characters.
121119
$filter = sprintf(
122-
'/%s/i',
123-
str_replace(
124-
'/',
125-
'\\/',
126-
$filter,
127-
),
120+
'{%s}i',
121+
$filter,
128122
);
129123
}
130124

0 commit comments

Comments
 (0)