Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2fe4442

Browse files
minor#41431 [Yaml] Leverage array_is_list() (nicolas-grekas)
This PR was merged into the 5.4 branch.Discussion----------[Yaml] Leverage array_is_list()| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Commits-------f4da7e4 [Yaml] Leverage array_is_list()
2 parentsdbeebd1 +f4da7e4 commit2fe4442

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

‎src/Symfony/Component/Yaml/Inline.php‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -207,19 +207,7 @@ public static function dump($value, int $flags = 0): string
207207
*/
208208
publicstaticfunctionisHash($value):bool
209209
{
210-
if ($valueinstanceof \stdClass ||$valueinstanceof \ArrayObject) {
211-
returntrue;
212-
}
213-
214-
$expectedKey =0;
215-
216-
foreach ($valueas$key =>$val) {
217-
if ($key !==$expectedKey++) {
218-
returntrue;
219-
}
220-
}
221-
222-
returnfalse;
210+
return !\is_array($value) || !array_is_list($value);
223211
}
224212

225213
/**

‎src/Symfony/Component/Yaml/composer.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"require": {
1919
"php":">=7.2.5",
2020
"symfony/deprecation-contracts":"^2.1",
21-
"symfony/polyfill-ctype":"~1.8"
21+
"symfony/polyfill-ctype":"^1.8",
22+
"symfony/polyfill-php81":"^1.22"
2223
},
2324
"require-dev": {
2425
"symfony/console":"^4.4|^5.0|^6.0"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp