diff --git a/composer.json b/composer.json index 2639e129472..f08bde5165c 100644 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/src/Psalm/Report/XmlReport.php b/src/Psalm/Report/XmlReport.php index 99eef77e0e3..7b200ff2878 100644 --- a/src/Psalm/Report/XmlReport.php +++ b/src/Psalm/Report/XmlReport.php @@ -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 @@ static function (IssueData $issue_data): array { }, $this->issues_data ) - ] + ], + 'report', + true, + 'UTF-8', + '1.0', + ['preserveWhiteSpace' => false, 'formatOutput' => true] ); - return $xml->saveXML(); + return $xml; } }