Skip to content

Commit 50b0de4

Browse files
committed
Check for the existence of PHPStan source after extraction.
Fix namespace error in the class property of composer.json.
1 parent d2d4ef7 commit 50b0de4

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
],
2424
"extra": {
25-
"class": "Xact\\PHPStan\\Plugin"
25+
"class": "Xact\\PHPStan\\Dev\\Plugin"
2626
},
2727
"require-dev": {
2828
"composer/composer": "^2.5"

src/Plugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,9 @@ public function extractPHPStan(): void
5151
$phar = new Phar($pharPath);
5252
$phar->extractTo($extractPath);
5353
}
54+
55+
if (!file_exists($extractPath) || !file_exists("{$extractPath}/src")) {
56+
throw new Exception("Could not find phpstan/src after extracting the .phar file.");
57+
}
5458
}
5559
}

0 commit comments

Comments
 (0)