Skip to content

Commit

Permalink
Merge pull request #10542 from kkmuffme/remove-duplicate-directory-se…
Browse files Browse the repository at this point in the history
…parator-in-error-message

remove redundat directory separator which caused "//" in path not found errors
  • Loading branch information
orklah committed Jan 14, 2024
2 parents 6e86925 + 6f184dc commit c04eb4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Psalm/Config.php
Expand Up @@ -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);
Expand Down Expand Up @@ -1304,15 +1304,15 @@ 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.
// @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 Expand Up @@ -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);
}
Expand Down

0 comments on commit c04eb4c

Please sign in to comment.