Debian Codegraph @

lib/3rdParty/composer/symfony/property-info/DependencyInjection/PropertyInfoConstructorPass.php

raw symbols SCIP
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
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\PropertyInfo\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 * Adds extractors to the property_info.constructor_extractor service.
21 *
22 * @author Dmitrii Poddubnyi <[email protected]>
23 */
24 final class PropertyInfoConstructorPass implements CompilerPassInterface
25 {
26 use PriorityTaggedServiceTrait;
27
28 public function process(ContainerBuilder $container): void
29 {
30 if (!$container->hasDefinition('property_info.constructor_extractor')) {
31 return;
32 }
33 $definition = $container->getDefinition('property_info.constructor_extractor');
34
35 $listExtractors = $this->findAndSortTaggedServices('property_info.constructor_extractor', $container);
36 $definition->replaceArgument(0, new IteratorArgument($listExtractors));
37 }
38 }