4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\DependencyInjection;
14 use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
15 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16 use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
17 use Symfony\Component\DependencyInjection\ContainerBuilder;
20 * Gathers and configures the argument value resolvers.
22 * @author Iltar van der Berg <kjarli@gmail.com>
24 class ControllerArgumentValueResolverPass implements CompilerPassInterface
26 use PriorityTaggedServiceTrait;
28 private $argumentResolverService;
29 private $argumentValueResolverTag;
31 public function __construct($argumentResolverService = 'argument_resolver', $argumentValueResolverTag = 'controller.argument_value_resolver')
33 $this->argumentResolverService = $argumentResolverService;
34 $this->argumentValueResolverTag = $argumentValueResolverTag;
37 public function process(ContainerBuilder $container)
39 if (!$container->hasDefinition($this->argumentResolverService)) {
44 ->getDefinition($this->argumentResolverService)
45 ->replaceArgument(1, new IteratorArgument($this->findAndSortTaggedServices($this->argumentValueResolverTag, $container)))