8000 revert using functions provided by polyfill packages · symfony/symfony@3b9b700 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b9b700

Browse files
committed
revert using functions provided by polyfill packages
1 parent d7ea3de commit 3b9b700

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,19 @@ public static function dump($value, int $flags = 0): string
211211
*/
212212
public static function isHash($value): bool
213213
{
214-
return !\is_array($value) || !array_is_list($value);
214+
if ($value instanceof \stdClass || $value instanceof \ArrayObject) {
215+
return true;
216+
}
217+
218+
$expectedKey = 0;
219+
220+
foreach ($value as $key => $val) {
221+
if ($key !== $expectedKey++) {
222+
return true;
223+
}
224+
}
225+
226+
return false;
215227
}
216228

217229
/**

src/Symfony/Component/Yaml/composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"symfony/deprecation-contracts": "^2.1",
21-
"symfony/polyfill-ctype": "^1.8",
22-
"symfony/polyfill-php80": "^1.16",
23-
"symfony/polyfill-php81": "^1.22"
21+
"symfony/polyfill-ctype": "^1.8"
2422
},
2523
"require-dev": {
2624
"symfony/console": "^5.3|^6.0"

0 commit comments

Comments
 (0)
0