mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Trim issue snippet at time of comparison with baseline, not in IssueData constructor
This commit is contained in:
parent
097ccf16b4
commit
140cf01a91
@ -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;
|
||||
|
@ -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
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user