From 6f184dca916ec156addc5e997f3e915dee87004d Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:46:04 +0100 Subject: [PATCH] remove redundat directory separator which caused "//" in path not found errors --- src/Psalm/Config.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 82c696c0bcd..e6f05540b55 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -787,7 +787,7 @@ public static function loadFromXMLFile(string $file_path, string $current_dir): { $file_contents = file_get_contents($file_path); - $base_dir = dirname($file_path) . DIRECTORY_SEPARATOR; + $base_dir = dirname($file_path); if ($file_contents === false) { throw new InvalidArgumentException('Cannot open ' . $file_path); @@ -1304,7 +1304,7 @@ private static function fromXmlAndPaths( // ProjectAnalyzer::getInstance()->check_paths_files is not populated at this point in time $paths_to_check = null; - + global $argv; // Hack for Symfonys own argv resolution. @@ -1312,7 +1312,7 @@ private static function fromXmlAndPaths( 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) { @@ -1473,7 +1473,7 @@ private static function fromXmlAndPaths( $path = Path::isAbsolute($plugin_file_name) ? $plugin_file_name - : $config->base_dir . $plugin_file_name; + : $config->base_dir . DIRECTORY_SEPARATOR . $plugin_file_name; $config->addPluginPath($path); }