1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Fix loading stubs from phar file on Windows

Fixes vimeo/psalm#10747
This commit is contained in:
Bruce Weirdan 2024-02-25 12:53:13 +01:00
parent 6c10ad2355
commit 01dc2fef84

View File

@ -2326,6 +2326,10 @@ class Config
foreach ($stub_files as $file_path) {
$file_path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $file_path);
// fix mangled phar paths on Windows
if (strpos($file_path, 'phar:\\\\') === 0) {
$file_path = 'phar://'. substr($file_path, 7);
}
$codebase->scanner->addFileToDeepScan($file_path);
}
@ -2423,6 +2427,10 @@ class Config
foreach ($stub_files as $file_path) {
$file_path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $file_path);
// fix mangled phar paths on Windows
if (strpos($file_path, 'phar:\\\\') === 0) {
$file_path = 'phar://' . substr($file_path, 7);
}
$codebase->scanner->addFileToDeepScan($file_path);
}