1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Use composer autoloader during init (#5054)

Fixes vimeo/psalm#5048

The issue was caused by missing dependency of a class that Psalm tried
to inspect through reflection. Fixed by using composer autoloader which
avoids the need to use reflection.
This commit is contained in:
Bruce Weirdan 2021-01-20 00:21:33 +02:00 committed by Daniil Gentili
parent 0c52f528bd
commit 204582be52
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -337,6 +337,7 @@ if (isset($options['i'])) {
echo "Calculating best config level based on project files\n";
\Psalm\Config\Creator::createBareConfig($current_dir, $init_source_dir, $vendor_dir);
$config = \Psalm\Config::getInstance();
$config->setComposerClassLoader($first_autoloader);
} else {
try {
$template_contents = \Psalm\Config\Creator::getContents(