Skip to content

Commit

Permalink
Fix crashes when XML report is used on PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Nov 28, 2022
1 parent 9d597cf commit 874eb7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Psalm/Report/XmlReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ static function (IssueData $issue_data): array {
);
}

// replace null values, as XML serializers tend to have problems with them
$issue_data['taint_trace'] ??= '';

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

// replace null values, as XML serializers tend to have problems with them
$issue_data['other_references'] ??= '';

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

0 comments on commit 874eb7d

Please sign in to comment.