From 5aa667cafb896a71de48023d3254b43b5d19201f Mon Sep 17 00:00:00 2001 From: Luke Adamczewski Date: Wed, 24 Jun 2020 00:01:53 +0200 Subject: [PATCH] #1086: Code review suggestions applying --- runtime/lib/parser/yaml/sfYamlInline.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime/lib/parser/yaml/sfYamlInline.php b/runtime/lib/parser/yaml/sfYamlInline.php index a75208f77..331802a00 100644 --- a/runtime/lib/parser/yaml/sfYamlInline.php +++ b/runtime/lib/parser/yaml/sfYamlInline.php @@ -122,10 +122,8 @@ protected static function dumpArray($value) { // array $keys = array_keys($value); - if ( - (1 == count($keys) && '0' == $keys[0]) - || - (count($keys) > 1 && array_reduce($keys, function($v, $w) { return (integer) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2)) + + if (count($value) > 0 && array_values($value) === $value) { $output = array(); foreach ($value as $val) {