Revert "[TASK] Avoid slow array functions in loops"
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / Mvc / Configuration / YamlSource.php
index fceccc7..38c78f1 100644 (file)
@@ -62,7 +62,7 @@ class YamlSource
      */
     public function load(array $filesToLoad): array
     {
-        $configuration = [[]];
+        $configuration = [];
         foreach ($filesToLoad as $fileToLoad) {
             if ($fileToLoad instanceof File) {
                 $fileIdentifier = $fileToLoad->getIdentifier();
@@ -90,7 +90,7 @@ class YamlSource
                 $loadedConfiguration = Yaml::parse($rawYamlContent);
 
                 if (is_array($loadedConfiguration)) {
-                    $configuration[] = $loadedConfiguration;
+                    $configuration = array_replace_recursive($configuration, $loadedConfiguration);
                 }
             } catch (ParseException $exception) {
                 throw new ParseErrorException(
@@ -100,7 +100,7 @@ class YamlSource
             }
         }
 
-        $configuration = ArrayUtility::convertBooleanStringsToBooleanRecursive(array_replace_recursive(...$configuration));
+        $configuration = ArrayUtility::convertBooleanStringsToBooleanRecursive($configuration);
         return $configuration;
     }