Skip to content

Commit 806997b

Browse files
authored
Merge pull request #6 from PHPCSStandards/feature/minor-regex-tweak
SniffParser: minor regex simplification
2 parents e96d0d0 + 0e91a43 commit 806997b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Parser/SniffParser.php

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

0 commit comments

Comments
 (0)