Skip to content

Commit

Permalink
Merge pull request #6146 from ndench/fix-xml-report-data-flow-node-data
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan authored Jul 20, 2021
2 parents d8cddd6 + b149097 commit 9cb963f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/Psalm/Report/XmlReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
namespace Psalm\Report;

use LSS\Array2XML;
use Psalm\Internal\Analyzer\DataFlowNodeData;
use Psalm\Internal\Analyzer\IssueData;
use Psalm\Report;

use function array_map;
use function get_object_vars;

class XmlReport extends Report
{
Expand All @@ -16,8 +18,27 @@ public function create(): string
[
'item' => array_map(
function (IssueData $issue_data): array {
$issue_data = (array) $issue_data;
$issue_data = get_object_vars($issue_data);
unset($issue_data['dupe_key']);

if (null !== $issue_data['taint_trace']) {
$issue_data['taint_trace'] = array_map(
function ($trace): array {
return (array) $trace;
},
$issue_data['taint_trace']
);
}

if (null !== $issue_data['other_references']) {
$issue_data['other_references'] = array_map(
function (DataFlowNodeData $reference): array {
return (array) $reference;
},
$issue_data['other_references']
);
}

return $issue_data;
},
$this->issues_data
Expand Down

0 comments on commit 9cb963f

Please sign in to comment.