From c2cd7e7b91886f755c7c8a8a8810498c8360fc51 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Sat, 15 Jul 2017 23:25:31 +0200 Subject: [PATCH] [DI] Reintroduce !service_locator in favor of !iterator --- .../Argument/RewindableGenerator.php | 23 ++++++++++++-- .../DependencyInjection/ContainerBuilder.php | 23 +++++++++++++- .../DependencyInjection/Dumper/PhpDumper.php | 23 +++++++++++--- .../Argument/RewindableGeneratorTest.php | 23 ++++++++++++-- .../Tests/Fixtures/php/services1-1.php | 1 + .../Tests/Fixtures/php/services1.php | 1 + .../Tests/Fixtures/php/services10.php | 1 + .../Tests/Fixtures/php/services12.php | 1 + .../Tests/Fixtures/php/services13.php | 1 + .../Tests/Fixtures/php/services19.php | 1 + .../Tests/Fixtures/php/services24.php | 1 + .../Tests/Fixtures/php/services26.php | 1 + .../Tests/Fixtures/php/services31.php | 1 + .../Tests/Fixtures/php/services33.php | 1 + .../Tests/Fixtures/php/services8.php | 1 + .../Tests/Fixtures/php/services9.php | 31 ++++++++++++++++--- .../Tests/Fixtures/php/services9_compiled.php | 30 +++++++++++++++--- .../Fixtures/php/services_array_params.php | 1 + .../Tests/Fixtures/php/services_locator.php | 1 + .../Fixtures/php/services_private_frozen.php | 1 + .../Fixtures/php/services_subscriber.php | 1 + 21 files changed, 149 insertions(+), 19 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php b/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php index e162a7c34deca..f8ef92cb7e9eb 100644 --- a/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php +++ b/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php @@ -11,24 +11,43 @@ namespace Symfony\Component\DependencyInjection\Argument; +use Psr\Container\ContainerInterface; + /** * @internal */ -class RewindableGenerator implements \IteratorAggregate, \Countable +class RewindableGenerator implements ContainerInterface, \IteratorAggregate, \Countable { + private $factory; private $generator; private $count; /** + * @param callable $factory * @param callable $generator * @param int|callable $count */ - public function __construct(callable $generator, $count) + public function __construct(callable $factory, callable $generator, $count) { + $this->factory = $factory; $this->generator = $generator; $this->count = $count; } + public function has($id) + { + $factory = $this->factory; + + return $factory($id, true); + } + + public function get($id) + { + $factory = $this->factory; + + return $factory($id); + } + public function getIterator() { $g = $this->generator; diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 14dd957e9ea13..85d6c5e760ca7 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -1132,7 +1132,28 @@ public function resolveServices($value) return $this->resolveServices($reference); }; } elseif ($value instanceof IteratorArgument) { - $value = new RewindableGenerator(function () use ($value) { + $value = new RewindableGenerator(function ($k, $bool = false) use ($value) { + $values = $value->getValues(); + if (!isset($values[$k])) { + if ($bool) { + return false; + } + + throw new ServiceNotFoundException($k, null, null, array_keys($values)); + } + if ($bool) { + return true; + } + if (true === $v = $values[$k]) { + throw new ServiceCircularReferenceException($k, array($k, $k)); + } + $values[$k] = true; + try { + return $this->resolveServices($v); + } finally { + $values[$k] = $v; + } + }, function () use ($value) { foreach ($value->getValues() as $k => $v) { foreach (self::getServiceConditionals($v) as $s) { if (!$this->has($s)) { diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 1cd0d21fae183..626c56af35c8a 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -784,6 +784,7 @@ private function startClass($class, $baseClass, $namespace) use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; $bagClass /*{$this->docStar} @@ -1430,26 +1431,38 @@ private function dumpValue($value, $interpolate = true) if ($value instanceof IteratorArgument) { $operands = array(0); $code = array(); - $code[] = 'new RewindableGenerator(function () {'; + $code[] = 'new RewindableGenerator(function ($k, $b = false) {'; if (!$values = $value->getValues()) { + $code[] = ' if ($b) { return false; }'; + $code[] = ' throw new ServiceNotFoundException($k);'; + $code[] = ' }, function() {'; $code[] = ' return new \EmptyIterator();'; } else { - $countCode = array(); - $countCode[] = 'function () {'; + $code[] = ' switch ($k) {'; + $genCode = array(); + $countCode = array('function () {'); foreach ($values as $k => $v) { ($c = $this->getServiceConditionals($v)) ? $operands[] = "(int) ($c)" : ++$operands[0]; - $v = $this->wrapServiceConditionals($v, sprintf(" yield %s => %s;\n", $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate))); + $v = $this->wrapServiceConditionals($v, sprintf(" yield %s => %s;\n", $this->dumpValue($k, $interpolate), $vDump = $this->dumpValue($v, $interpolate))); + $code[] = sprintf(' case %s: $o = %s; break;', $this->dumpValue($k, false), $vDump); foreach (explode("\n", $v) as $v) { if ($v) { - $code[] = ' '.$v; + $genCode[] = ' '.$v; } } } $countCode[] = sprintf(' return %s;', implode(' + ', $operands)); $countCode[] = ' }'; + + $code[] = ' }'; + $code[] = ' if ($b) { return isset($o); }'; + $code[] = ' if (isset($o)) { return $o; }'; + $code[] = sprintf(' throw new ServiceNotFoundException($k, null, null, %s);', $this->dumpValue(array_keys($values), false)); + $code[] = ' }, function() {'; + $code[] = implode("\n", $genCode); } $code[] = sprintf(' }, %s)', count($operands) > 1 ? implode("\n", $countCode) : $operands[0]); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Argument/RewindableGeneratorTest.php b/src/Symfony/Component/DependencyInjection/Tests/Argument/RewindableGeneratorTest.php index 1415869a4f1e9..bf248c132fa16 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Argument/RewindableGeneratorTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Argument/RewindableGeneratorTest.php @@ -18,14 +18,16 @@ class RewindableGeneratorTest extends TestCase { public function testImplementsCountable() { - $this->assertInstanceOf(\Countable::class, new RewindableGenerator(function () { + $this->assertInstanceOf(\Countable::class, new RewindableGenerator(function ($k, $b = false) { + }, function () { yield 1; }, 1)); } public function testCountUsesProvidedValue() { - $generator = new RewindableGenerator(function () { + $generator = new RewindableGenerator(function ($k, $b = false) { + }, function () { yield 1; }, 3); @@ -35,7 +37,8 @@ public function testCountUsesProvidedValue() public function testCountUsesProvidedValueAsCallback() { $called = 0; - $generator = new RewindableGenerator(function () { + $generator = new RewindableGenerator(function ($k, $b = false) { + }, function () { yield 1; }, function () use (&$called) { ++$called; @@ -50,4 +53,18 @@ public function testCountUsesProvidedValueAsCallback() $this->assertSame(1, $called, 'Count callback is called only once'); } + + public function testPsrContainer() + { + $generator = new RewindableGenerator(function ($k, $b = false) { + return $b ? 'a' === $k : ('a' === $k ? 0 : 1); + }, function () { + yield 'a' => 0; + }, 1); + + $this->assertTrue($generator->has('a')); + $this->assertFalse($generator->has('b')); + $this->assertSame(0, $generator->get('a')); + $this->assertSame(1, $generator->get('b')); + } } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php index 44631328ce606..e2e822fc8ce7f 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php @@ -8,6 +8,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php index 9ad021ece802b..5aca6c7ce6a92 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php index a5c3fd454c706..0aeeb260834ff 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php index 1ff201baf495b..a4187e7c3c5c5 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php index 1cffb23b7b878..4d6848f9963bb 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php index 8718efe078d3d..7232d3bdfa167 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php index 6ccbbd31949f6..b54e8dc8b6283 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php index b2b2da68ffa81..069bad9bfdddf 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services31.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services31.php index daf0ed5d60a19..fb348cac21fd2 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services31.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services31.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php index fe0510cc2602c..61d0349408591 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php index f85e3251be8bd..33f5cb5c50893 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php index 2f8de5c8c0eb1..3a84dc3568cd3 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; /** @@ -304,10 +305,21 @@ protected function getFooWithInlineService() */ protected function getLazyContextService() { - return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () { + return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function ($k, $b = false) { + switch ($k) { + case 'k1': $o = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; break; + case 'k2': $o = $this; break; + } + if ($b) { return isset($o); } + if (isset($o)) { return $o; } + throw new ServiceNotFoundException($k, null, null, array(0 => 'k1', 1 => 'k2')); + }, function() { yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; yield 'k2' => $this; - }, 2), new RewindableGenerator(function () { + }, 2), new RewindableGenerator(function ($k, $b = false) { + if ($b) { return false; } + throw new ServiceNotFoundException($k); + }, function() { return new \EmptyIterator(); }, 0)); } @@ -322,14 +334,25 @@ protected function getLazyContextService() */ protected function getLazyContextIgnoreInvalidRefService() { - return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () { + return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function ($k, $b = false) { + switch ($k) { + case 0: $o = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; break; + case 1: $o = $this->get('invalid', ContainerInterface::NULL_ON_INVALID_REFERENCE); break; + } + if ($b) { return isset($o); } + if (isset($o)) { return $o; } + throw new ServiceNotFoundException($k, null, null, array(0 => 0, 1 => 1)); + }, function() { yield 0 => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; if ($this->has('invalid')) { yield 1 => $this->get('invalid', ContainerInterface::NULL_ON_INVALID_REFERENCE); } }, function () { return 1 + (int) ($this->has('invalid')); - }), new RewindableGenerator(function () { + }), new RewindableGenerator(function ($k, $b = false) { + if ($b) { return false; } + throw new ServiceNotFoundException($k); + }, function() { return new \EmptyIterator(); }, 0)); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php index 76f0b74938bd3..96d2230cb2239 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** @@ -307,10 +308,21 @@ protected function getFooWithInlineService() */ protected function getLazyContextService() { - return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () { + return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function ($k, $b = false) { + switch ($k) { + case 'k1': $o = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; break; + case 'k2': $o = $this; break; + } + if ($b) { return isset($o); } + if (isset($o)) { return $o; } + throw new ServiceNotFoundException($k, null, null, array(0 => 'k1', 1 => 'k2')); + }, function() { yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; yield 'k2' => $this; - }, 2), new RewindableGenerator(function () { + }, 2), new RewindableGenerator(function ($k, $b = false) { + if ($b) { return false; } + throw new ServiceNotFoundException($k); + }, function() { return new \EmptyIterator(); }, 0)); } @@ -325,9 +337,19 @@ protected function getLazyContextService() */ protected function getLazyContextIgnoreInvalidRefService() { - return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () { + return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function ($k, $b = false) { + switch ($k) { + case 0: $o = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; break; + } + if ($b) { return isset($o); } + if (isset($o)) { return $o; } + throw new ServiceNotFoundException($k, null, null, array(0 => 0)); + }, function() { yield 0 => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}; - }, 1), new RewindableGenerator(function () { + }, 1), new RewindableGenerator(function ($k, $b = false) { + if ($b) { return false; } + throw new ServiceNotFoundException($k); + }, function() { return new \EmptyIterator(); }, 0)); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php index befc22d9cbefb..5c9b46d4b590e 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php index d623194c3ee6e..d37721e51e075 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php index 1fbfc52e4a077..1b84c0c89862b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php index df5603572497f..669bad271f628 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php @@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; /**