[DependencyInjection] Fix return of YamlFileLoader::parseDefaults

This commit is contained in:
Kévin Dunglas 2017-01-20 01:22:02 +01:00
parent 63b8d31885
commit 5cf76f774c
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6

View File

@ -175,7 +175,7 @@ class YamlFileLoader extends FileLoader
private function parseDefaults(array &$content, $file)
{
if (!isset($content['services']['_defaults'])) {
return $content;
return array();
}
if (!is_array($defaults = $content['services']['_defaults'])) {
throw new InvalidArgumentException(sprintf('Service defaults must be an array, "%s" given in "%s".', gettype($defaults), $file));
@ -183,7 +183,7 @@ class YamlFileLoader extends FileLoader
if (isset($defaults['alias']) || isset($defaults['class']) || isset($defaults['factory'])) {
@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);
return $content;
return array();
}
$defaultKeys = array('public', 'tags', 'inherit_tags', 'autowire');