Skip to content

Commit ef5ea75

Browse files
committed
[Intl] Leverage array_is_list
1 parent c4f851b commit ef5ea75

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Data/Bundle/Writer/TextBundleWriter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ private function writeResource($file, mixed $value, int $indentation, bool $requ
7878
if (\is_array($value)) {
7979
$intValues = \count($value) === \count(array_filter($value, 'is_int'));
8080

81-
$keys = array_keys($value);
82-
8381
// check that the keys are 0-indexed and ascending
84-
$intKeys = $keys === range(0, \count($keys) - 1);
82+
$intKeys = array_is_list($value);
8583

8684
if ($intValues && $intKeys) {
8785
$this->writeIntVector($file, $value, $indentation);

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
}
2525
],
2626
"require": {
27-
"php": ">=8.0.2"
27+
"php": ">=8.0.2",
28+
"symfony/polyfill-php81": "^1.22"
2829
},
2930
"require-dev": {
3031
"symfony/filesystem": "^5.4|^6.0"

0 commit comments

Comments
 (0)