Skip to content

Commit 94c278c

Browse files
committed
Leverage array_is_list
1 parent ca3bdee commit 94c278c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Dumper/XmlDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ private function addServices(\DOMElement $parent)
268268

269269
private function convertParameters(array $parameters, string $type, \DOMElement $parent, string $keyAttribute = 'key')
270270
{
271-
$withKeys = array_keys($parameters) !== range(0, \count($parameters) - 1);
271+
$withKeys = !array_is_list($parameters);
272272
foreach ($parameters as $key => $value) {
273273
$element = $this->document->createElement($type);
274274
if ($withKeys) {

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"psr/container": "^1.1.1",
2121
"symfony/deprecation-contracts": "^2.1",
2222
"symfony/polyfill-php80": "^1.16",
23+
"symfony/polyfill-php81": "^1.22",
2324
"symfony/service-contracts": "^1.1.6|^2"
2425
},
2526
"require-dev": {

0 commit comments

Comments
 (0)