mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Merge pull request #8895 from weirdan/replace-array-to-xml
Fixes https://github.com/vimeo/psalm/issues/8852
This commit is contained in:
commit
321d5fee62
@ -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"
|
||||
|
@ -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;
|
||||
@ -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 {
|
||||
@ -46,9 +45,14 @@ final class XmlReport extends Report
|
||||
},
|
||||
$this->issues_data
|
||||
)
|
||||
]
|
||||
],
|
||||
'report',
|
||||
true,
|
||||
'UTF-8',
|
||||
'1.0',
|
||||
['preserveWhiteSpace' => false, 'formatOutput' => true]
|
||||
);
|
||||
|
||||
return $xml->saveXML();
|
||||
return $xml;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user