8000 minor #44626 [Intl] Leverage array_is_list (fancyweb) · symfony/symfony@d8fd632 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8fd632

Browse files
committed
minor #44626 [Intl] Leverage array_is_list (fancyweb)
This PR was merged into the 6.1 branch. Discussion ---------- [Intl] Leverage array_is_list | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | - | Tickets | #44167 (review) | License | MIT | Doc PR | - It was forgotten in #44167 and this is the last occurrence in the code base 🙏 Commits ------- 575ebf2 [Intl] Leverage array_is_list
2 parents 3a1f34a + 575ebf2 commit d8fd632

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Symfony/Component/Intl/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);

src/Symfony/Component/Intl/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)
0