Skip to content

Commit fc4ecbc

Browse files
minor #21352 [DependencyInjection] Fix return of YamlFileLoader::parseDefaults (dunglas)
This PR was merged into the 3.3-dev branch. Discussion ---------- [DependencyInjection] Fix return of YamlFileLoader::parseDefaults | Q | A | ------------- | --- | Branch? | master | Bug fix? | no (or very unlikely) | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | n/a | License | MIT | Doc PR | n/a I've messed up the return value of parseDefaults under certain conditions in #21342. Here is the fix... Sorry about that. Commits ------- 5cf76f7 [DependencyInjection] Fix return of YamlFileLoader::parseDefaults
2 parents 19182f2 + 9065dca commit fc4ecbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Loader/YamlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ private function parseDefinitions(array $content, $file)
175175
private function parseDefaults(array &$content, $file)
176176
{
177177
if (!isset($content['services']['_defaults'])) {
178-
return $content;
178+
return array();
179179
}
180180
if (!is_array($defaults = $content['services']['_defaults'])) {
181181
throw new InvalidArgumentException(sprintf('Service defaults must be an array, "%s" given in "%s".', gettype($defaults), $file));
182182
}
183183
if (isset($defaults['alias']) || isset($defaults['class']) || isset($defaults['factory'])) {
184184
@trigger_error('Giving a service the "_defaults" name is deprecated since Symfony 3.3 and will be forbidden in 4.0. Rename your service.', E_USER_DEPRECATED);
185185

186-
return $content;
186+
return array();
187187
}
188188

189189
$defaultKeys = array('public', 'tags', 'inherit_tags', 'autowire');

0 commit comments

Comments
 (0)