Skip to content

Commit 0e91a43

Browse files
committed
SniffParser: minor regex simplification
1 parent 8bed61b commit 0e91a43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Parser/SniffParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ private function getSniffClassName(string $phpFilePath): string
7777
*/
7878
private function getSniffFileParts(string $filePath): array
7979
{
80-
$part = '([^\/]*)';
81-
preg_match("/$part\/Sniffs\/$part\/{$part}Sniff\.php/", $filePath, $matches);
80+
$part = '([^/]*)';
81+
preg_match("`$part/Sniffs/$part/{$part}Sniff\.php$`", $filePath, $matches);
8282
if ($matches === []) {
8383
throw NotASniffPath::fromPath($filePath);
8484
}

0 commit comments

Comments
 (0)