Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundat directory separator which caused "//" in path not found errors #10542

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Psalm/Config.php
Original file line number Diff line number Diff line change
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
Loading