diff --git a/src/Psalm/Internal/Analyzer/IssueData.php b/src/Psalm/Internal/Analyzer/IssueData.php index 4dddfbb74..363e8578e 100644 --- a/src/Psalm/Internal/Analyzer/IssueData.php +++ b/src/Psalm/Internal/Analyzer/IssueData.php @@ -2,8 +2,6 @@ namespace Psalm\Internal\Analyzer; -use function trim; - class IssueData { /** @@ -156,7 +154,7 @@ class IssueData $this->file_name = $file_name; $this->file_path = $file_path; $this->snippet = $snippet; - $this->selected_text = trim($selected_text); + $this->selected_text = $selected_text; $this->from = $from; $this->to = $to; $this->snippet_from = $snippet_from; diff --git a/src/Psalm/IssueBuffer.php b/src/Psalm/IssueBuffer.php index bc5492b27..f9954a9cf 100644 --- a/src/Psalm/IssueBuffer.php +++ b/src/Psalm/IssueBuffer.php @@ -48,6 +48,7 @@ use function sha1; use function sprintf; use function str_repeat; use function str_replace; +use function trim; use function usort; use const DEBUG_BACKTRACE_IGNORE_ARGS; @@ -518,7 +519,7 @@ class IssueBuffer if (isset($issue_baseline[$file][$type]) && $issue_baseline[$file][$type]['o'] > 0) { if ($issue_baseline[$file][$type]['o'] === count($issue_baseline[$file][$type]['s'])) { $position = array_search( - $issue_data->selected_text, + trim($issue_data->selected_text), $issue_baseline[$file][$type]['s'], true );