Skip to content

Commit 3933e7c

Browse files
authored
Merge branch 'main' into feature/further-slash-normalization
2 parents 76a7d71 + b25ee48 commit 3933e7c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/Generator/MarkdownGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function getPublicProperties(array $properties): string
127127
private function getPublicPropertyLines(array $properties): array
128128
{
129129
return array_map(function (Property $property) {
130-
return "- \${$property->getName()} : {$property->getType()} {$property->getDescription()}";
130+
return "- `\${$property->getName()}` : {$property->getType()} {$property->getDescription()}";
131131
}, $properties);
132132
}
133133

src/Parser/ViolationParser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function parse(string $xmlFilePath): Violation
2929
private function getErrorCode(string $xmlFilePath): string
3030
{
3131
$xmlFilePath = Functions::normalizeSlashes($xmlFilePath);
32-
$part = '([^\/]*)';
33-
preg_match("/$part\/Docs\/$part\/{$part}Standard\/$part\.xml/", $xmlFilePath, $matches);
32+
$part = '([^/]*)';
33+
preg_match("`$part/Docs/$part/{$part}Standard/$part\.xml$`", $xmlFilePath, $matches);
3434
if ($matches === []) {
3535
throw NotAViolationPath::fromPath($xmlFilePath);
3636
}

src/SniffFinder/FilesystemSniffFinder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private function recursiveSearch(Folder $folder): Iterator
4343
$dirs = new RecursiveDirectoryIterator($folder->getPath());
4444
$files = new RecursiveIteratorIterator($dirs);
4545
return new CallbackFilterIterator($files, function (SplFileInfo $fileInfo) {
46-
return preg_match('/\.php$/', $fileInfo->getPathname()) && !preg_match('/\/Tests\//', $fileInfo->getPathname());
46+
return preg_match('/\.php$/', $fileInfo->getPathname()) && !preg_match('`/Tests/`', $fileInfo->getPathname());
4747
});
4848
}
4949

tests/Generator/MarkdownGeneratorTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function fromSniff_WithCompleteData_WriteAllDetails()
7272
);
7373

7474
self::assertEquals(
75-
<<<MD
75+
<<<'MD'
7676
# Standard.Category.My
7777
7878
Description
@@ -83,8 +83,8 @@ public function fromSniff_WithCompleteData_WriteAllDetails()
8383
8484
## Public Properties
8585
86-
- \$a : string DescriptionA
87-
- \$b : int DescriptionB
86+
- `$a` : string DescriptionA
87+
- `$b` : int DescriptionB
8888
8989
## See Also
9090

0 commit comments

Comments
 (0)