Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 1fec387a4317 |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
15:e200cb7efeb3 | 16:c2387f117808 |
---|---|
9 * file that was distributed with this source code. | 9 * file that was distributed with this source code. |
10 */ | 10 */ |
11 | 11 |
12 namespace Symfony\Component\DependencyInjection\Compiler; | 12 namespace Symfony\Component\DependencyInjection\Compiler; |
13 | 13 |
14 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; | |
15 use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; | 14 use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; |
16 use Symfony\Component\DependencyInjection\ContainerInterface; | 15 use Symfony\Component\DependencyInjection\ContainerInterface; |
17 use Symfony\Component\DependencyInjection\Reference; | 16 use Symfony\Component\DependencyInjection\Reference; |
18 | 17 |
19 /** | 18 /** |
29 return parent::processValue($value, $isRoot); | 28 return parent::processValue($value, $isRoot); |
30 } | 29 } |
31 if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior() && !$this->container->has($id = (string) $value)) { | 30 if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior() && !$this->container->has($id = (string) $value)) { |
32 throw new ServiceNotFoundException($id, $this->currentId); | 31 throw new ServiceNotFoundException($id, $this->currentId); |
33 } | 32 } |
34 if (ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior() && $this->container->has($id = (string) $value) && !$this->container->findDefinition($id)->isShared()) { | |
35 throw new InvalidArgumentException(sprintf('Invalid ignore-on-uninitialized reference found in service "%s": target service "%s" is not shared.', $this->currentId, $id)); | |
36 } | |
37 | 33 |
38 return $value; | 34 return $value; |
39 } | 35 } |
40 } | 36 } |