[DependencyInjection] fixed PHP notice when the scope is not defined

This commit is contained in:
Fabien Potencier 2013-03-23 11:39:42 +01:00
parent 550df5a85a
commit cec98c1d7a

View File

@ -72,8 +72,8 @@ class CheckReferenceValidityPass implements CompilerPassInterface
$this->currentScopeChildren = array_keys($scopes);
$this->currentScopeAncestors = array();
} elseif (ContainerInterface::SCOPE_PROTOTYPE !== $scope) {
$this->currentScopeChildren = $children[$scope];
$this->currentScopeAncestors = $ancestors[$scope];
$this->currentScopeChildren = isset($children[$scope]) ? $children[$scope] : array();
$this->currentScopeAncestors = isset($ancestors[$scope]) ? $ancestors[$scope] : array();
}
$this->validateReferences($definition->getArguments());