1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00

Merge pull request #10628 from weirdan/fix-baseline-usage-with-paths-passed-via-cli-args

This commit is contained in:
Bruce Weirdan 2024-01-31 21:04:32 -04:00 committed by GitHub
commit 8c473e2437
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1067,7 +1067,8 @@ final class Psalm
if ($paths_to_check !== null) {
$filtered_issue_baseline = [];
foreach ($paths_to_check as $path_to_check) {
$path_to_check = substr($path_to_check, strlen($config->base_dir));
// +1 to remove the initial slash from $path_to_check
$path_to_check = substr($path_to_check, strlen($config->base_dir) + 1);
if (isset($issue_baseline[$path_to_check])) {
$filtered_issue_baseline[$path_to_check] = $issue_baseline[$path_to_check];
}