From 204582be525a76191aadcf677d1468c2c83880cb Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Wed, 20 Jan 2021 00:21:33 +0200 Subject: [PATCH] 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. --- src/psalm.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/psalm.php b/src/psalm.php index 38cba741f..30f09c4b8 100644 --- a/src/psalm.php +++ b/src/psalm.php @@ -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(