Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crashes when XML report is used on PHP 8.1 #8788

Merged
merged 1 commit into from Nov 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Psalm/Report/XmlReport.php
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