Skip to content

Commit

Permalink
Merge pull request #8895 from weirdan/replace-array-to-xml
Browse files Browse the repository at this point in the history
Fixes #8852
  • Loading branch information
weirdan committed Dec 13, 2022
2 parents 72e7386 + 586d0c9 commit 321d5fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -33,8 +33,8 @@
"fidry/cpu-core-counter": "^0.4.0",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"nikic/php-parser": "^4.13",
"openlss/lib-array2xml": "^1.0",
"sebastian/diff": "^4.0",
"spatie/array-to-xml": "^2.17.0",
"symfony/console": "^4.1.6 || ^5.0 || ^6.0",
"symfony/filesystem": "^5.4 || ^6.0",
"symfony/polyfill-php80": "^1.25"
Expand Down
14 changes: 9 additions & 5 deletions src/Psalm/Report/XmlReport.php
Expand Up @@ -2,10 +2,10 @@

namespace Psalm\Report;

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

use function array_map;
use function get_object_vars;
Expand All @@ -14,8 +14,7 @@ final class XmlReport extends Report
{
public function create(): string
{
$xml = Array2XML::createXML(
'report',
$xml = (string) ArrayToXml::convert(
[
'item' => array_map(
static function (IssueData $issue_data): array {
Expand Down Expand Up @@ -46,9 +45,14 @@ static function (IssueData $issue_data): array {
},
$this->issues_data
)
]
],
'report',
true,
'UTF-8',
'1.0',
['preserveWhiteSpace' => false, 'formatOutput' => true]
);

return $xml->saveXML();
return $xml;
}
}

0 comments on commit 321d5fe

Please sign in to comment.