Skip to content

Commit e2a2e1b

Browse files
committed
FinalClassRule - normalize paths for Windows
1 parent fe503ca commit e2a2e1b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: build/PHPStan/Build/FinalClassRule.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\File\FileHelper;
78
use PHPStan\Node\InClassNode;
89
use PHPStan\Reflection\FunctionVariant;
910
use PHPStan\Reflection\FunctionVariantWithPhpDocs;
@@ -22,6 +23,10 @@
2223
final class FinalClassRule implements Rule
2324
{
2425

26+
public function __construct(private FileHelper $fileHelper)
27+
{
28+
}
29+
2530
public function getNodeType(): string
2631
{
2732
return InClassNode::class;
@@ -53,7 +58,7 @@ public function processNode(Node $node, Scope $scope): array
5358
return [];
5459
}
5560

56-
if (str_starts_with($scope->getFile(), dirname(__DIR__, 3) . '/tests')) {
61+
if (str_starts_with($this->fileHelper->normalizePath($scope->getFile()), $this->fileHelper->normalizePath(dirname(__DIR__, 3) . '/tests'))) {
5762
return [];
5863
}
5964

0 commit comments

Comments
 (0)