Merge branch '2.2'

* 2.2:
  [DependencyInjection] fixed wrong exception class
  fix overwriting of request's locale if attribute _locale is missing
This commit is contained in:
Fabien Potencier 2013-04-17 14:12:15 +02:00
commit ee489124fe
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@ use Symfony\Component\DependencyInjection\Compiler\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\Exception\BadMethodCallException;
use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
@ -893,7 +894,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
if (self::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) {
if (self::SCOPE_CONTAINER !== $scope && !isset($this->scopedServices[$scope])) {
throw new RuntimeException(sprintf('You tried to create the "%s" service of an inactive scope.', $id));
throw new InactiveScopeException($id, $scope);
}
$this->services[$lowerId = strtolower($id)] = $service;