[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/symfony/http-kernel/DependencyInjection/ -> ControllerArgumentValueResolverPass.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the Symfony package.
   5   *
   6   * (c) Fabien Potencier <fabien@symfony.com>
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  namespace Symfony\Component\HttpKernel\DependencyInjection;
  13  
  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;
  18  
  19  /**
  20   * Gathers and configures the argument value resolvers.
  21   *
  22   * @author Iltar van der Berg <kjarli@gmail.com>
  23   */
  24  class ControllerArgumentValueResolverPass implements CompilerPassInterface
  25  {
  26      use PriorityTaggedServiceTrait;
  27  
  28      private $argumentResolverService;
  29      private $argumentValueResolverTag;
  30  
  31      public function __construct($argumentResolverService = 'argument_resolver', $argumentValueResolverTag = 'controller.argument_value_resolver')
  32      {
  33          $this->argumentResolverService = $argumentResolverService;
  34          $this->argumentValueResolverTag = $argumentValueResolverTag;
  35      }
  36  
  37      public function process(ContainerBuilder $container)
  38      {
  39          if (!$container->hasDefinition($this->argumentResolverService)) {
  40              return;
  41          }
  42  
  43          $container
  44              ->getDefinition($this->argumentResolverService)
  45              ->replaceArgument(1, new IteratorArgument($this->findAndSortTaggedServices($this->argumentValueResolverTag, $container)))
  46          ;
  47      }
  48  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1