Skip to content

Commit 138c7b8

Browse files
committed
Fix baseline loading for path specified on the command line
Fixes #10624
1 parent 04ba935 commit 138c7b8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Psalm/Internal/Cli/Psalm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,8 @@ private static function initBaseline(
10671067
if ($paths_to_check !== null) {
10681068
$filtered_issue_baseline = [];
10691069
foreach ($paths_to_check as $path_to_check) {
1070-
$path_to_check = substr($path_to_check, strlen($config->base_dir));
1070+
// +1 to remove the initial slash from $path_to_check
1071+
$path_to_check = substr($path_to_check, strlen($config->base_dir) + 1);
10711072
if (isset($issue_baseline[$path_to_check])) {
10721073
$filtered_issue_baseline[$path_to_check] = $issue_baseline[$path_to_check];
10731074
}

0 commit comments

Comments
 (0)