Skip to content

Commit

Permalink
Fix "Cannot locate enable" with Symfony project
Browse files Browse the repository at this point in the history
Fixes the "Cannot locate enable" error when using psalm-plugin enable with a Symfony project
  • Loading branch information
florisluiten authored Dec 13, 2023
1 parent 955e7fe commit e981778
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,17 @@ private static function fromXmlAndPaths(
// any paths passed via CLI should be added to the projectFiles
// as they're getting analyzed like if they are part of the project
// ProjectAnalyzer::getInstance()->check_paths_files is not populated at this point in time
$paths_to_check = CliUtils::getPathsToCheck(null);

$paths_to_check = null;

global $argv;

// Hack for Symfonys own argv resolution.
// @see https://github.com/vimeo/psalm/issues/10465
if (!isset($argv[0]) || basename($argv[0]) !== 'psalm-plugin') {
$paths_to_check = CliUtils::getPathsToCheck(null);
}

if ($paths_to_check !== null) {
$paths_to_add_to_project_files = array();
foreach ($paths_to_check as $path) {
Expand Down

0 comments on commit e981778

Please sign in to comment.