mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix #4252 - fix xml generation
This commit is contained in:
parent
d6c64eef25
commit
23d1571d2a
@ -119,7 +119,7 @@ class IssueData
|
||||
* @var ?string
|
||||
* @readonly
|
||||
*/
|
||||
private $dupe_key;
|
||||
public $dupe_key;
|
||||
|
||||
/**
|
||||
* @param ?list<ControlFlowNodeData|array{label: string, entry_path_type: string}> $taint_trace
|
||||
@ -166,9 +166,4 @@ class IssueData
|
||||
$this->taint_trace = $taint_trace;
|
||||
$this->dupe_key = $dupe_key;
|
||||
}
|
||||
|
||||
public function getDupeKey() : ?string
|
||||
{
|
||||
return $this->dupe_key;
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ class IssueBuffer
|
||||
. '-' . $issue->file_name
|
||||
. ':' . $issue->line_from
|
||||
. ':' . $issue->column_from
|
||||
. ' ' . $issue->getDupeKey();
|
||||
. ' ' . $issue->dupe_key;
|
||||
|
||||
if (!self::alreadyEmitted($emitted_key)) {
|
||||
self::$issues_data[$file_path][] = $issue;
|
||||
|
@ -13,6 +13,15 @@ class JsonReport extends Report
|
||||
{
|
||||
$options = $this->pretty ? Json::PRETTY : Json::DEFAULT;
|
||||
|
||||
return Json::encode(array_values($this->issues_data), $options) . "\n";
|
||||
$issues_data = \array_map(
|
||||
function ($issue_data): array {
|
||||
$issue_data = (array) $issue_data;
|
||||
unset($issue_data['dupe_key']);
|
||||
return $issue_data;
|
||||
},
|
||||
$this->issues_data
|
||||
);
|
||||
|
||||
return Json::encode(array_values($issues_data), $options) . "\n";
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,9 @@ class XmlReport extends Report
|
||||
[
|
||||
'item' => array_map(
|
||||
function (IssueData $issue_data): array {
|
||||
return (array) $issue_data;
|
||||
$issue_data = (array) $issue_data;
|
||||
unset($issue_data['dupe_key']);
|
||||
return $issue_data;
|
||||
},
|
||||
$this->issues_data
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user