Skip to content

Commit 76a7d71

Browse files
committed
ViolationParser: implement use of Functions::normalizeSlashes()
Improves cross-platform compatibility of the code. With this additional change, the tests will pass on Windows as well, meaning that this part of the functionality should now also work on Windows.
1 parent aaeefd8 commit 76a7d71

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Parser/ViolationParser.php

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace App\Parser;
55

66
use App\Parser\Exception\NotAViolationPath;
7+
use App\Util\Functions;
78
use App\Value\Diff;
89
use App\Value\Url;
910
use App\Value\UrlList;
@@ -27,6 +28,7 @@ public function parse(string $xmlFilePath): Violation
2728

2829
private function getErrorCode(string $xmlFilePath): string
2930
{
31+
$xmlFilePath = Functions::normalizeSlashes($xmlFilePath);
3032
$part = '([^\/]*)';
3133
preg_match("/$part\/Docs\/$part\/{$part}Standard\/$part\.xml/", $xmlFilePath, $matches);
3234
if ($matches === []) {

0 commit comments

Comments
 (0)