Skip to content

Commit aefc87a

Browse files
authored
Fix FileExcluder on Windows
1 parent f0b3d52 commit aefc87a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/File/FileExcluder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ final class FileExcluder
5050
* @param string[] $analyseExcludes
5151
*/
5252
public function __construct(
53-
FileHelper $fileHelper,
53+
private FileHelper $fileHelper,
5454
array $analyseExcludes,
5555
)
5656
{
@@ -89,6 +89,8 @@ public function __construct(
8989

9090
public function isExcludedFromAnalysing(string $file): bool
9191
{
92+
$file = $this->fileHelper->normalizePath($file);
93+
9294
foreach ($this->literalAnalyseExcludes as $exclude) {
9395
if (str_starts_with($file, $exclude)) {
9496
return true;

tests/PHPStan/File/FileExcluderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function dataExcludeOnWindows(): array
6464
],
6565
[
6666
__DIR__ . '\data\parse-error.php',
67-
['tests/PHPStan/File/data/*'],
67+
['*/tests/PHPStan/File/data/*'],
6868
true,
6969
],
7070
[

0 commit comments

Comments
 (0)