@@ -46,22 +46,15 @@ public function prepend(ContainerBuilder $container): void
46
46
}
47
47
48
48
$ coreLoader ->load (sprintf ('core_areas/%s_service.yaml ' , $ areaName ));
49
-
50
- // @see https://github.com/symfony/symfony/issues/52789
51
- $ data = $ coreLoader ->getLocator ()->locate (sprintf ('core_areas/%s_config.yaml ' , $ areaName ));
52
- $ parsedData = Yaml::parseFile ($ data );
53
-
54
- if (array_key_exists ('toolbox ' , $ parsedData )) {
55
- $ container ->prependExtensionConfig ('toolbox ' , $ parsedData ['toolbox ' ]);
56
- }
49
+ $ this ->prependConfigToContainer ($ coreLoader , $ container , sprintf ('core_areas/%s_config.yaml ' , $ areaName ));
57
50
58
51
$ loaded [] = $ areaName ;
59
52
}
60
53
}
61
54
62
55
// add default theme (b4) if not set
63
56
if ($ hasTheme === false ) {
64
- $ coreLoader -> load ( 'theme/bootstrap4_theme.yaml ' );
57
+ $ this -> prependConfigToContainer ( $ coreLoader , $ container , 'theme/bootstrap4_theme.yaml ' );
65
58
}
66
59
67
60
$ container ->setParameter ('toolbox.wysiwyg_editor ' , $ wysiwygEditor );
@@ -250,4 +243,18 @@ private function parseContextConfigs(array $configs): array
250
243
251
244
return $ configs ;
252
245
}
246
+
247
+ private function prependConfigToContainer (YamlFileLoader $ loader , ContainerBuilder $ container , string $ configPath ): void
248
+ {
249
+ // @see https://github.com/symfony/symfony/issues/52789
250
+
251
+ $ data = $ loader ->getLocator ()->locate ($ configPath );
252
+ $ parsedData = Yaml::parseFile ($ data , Yaml::PARSE_CONSTANT );
253
+
254
+ if (!array_key_exists ('toolbox ' , $ parsedData )) {
255
+ return ;
256
+ }
257
+
258
+ $ container ->prependExtensionConfig ('toolbox ' , $ parsedData ['toolbox ' ]);
259
+ }
253
260
}
0 commit comments