‪TYPO3CMS  10.4
PublicServicePass.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
21 use Symfony\Component\DependencyInjection\ContainerBuilder;
22 
26 final class ‪PublicServicePass implements CompilerPassInterface
27 {
31  private ‪$tagName;
32 
36  public function ‪__construct(string ‪$tagName)
37  {
38  $this->tagName = ‪$tagName;
39  }
40 
44  public function ‪process(ContainerBuilder $container)
45  {
46  foreach ($container->findTaggedServiceIds($this->tagName) as $id => $tags) {
47  $definition = $container->findDefinition($id);
48  if (!$definition->isAutoconfigured() || $definition->isAbstract()) {
49  continue;
50  }
51 
52  $definition->setPublic(true);
53  }
54  }
55 }
‪TYPO3\CMS\Core\DependencyInjection\PublicServicePass\process
‪process(ContainerBuilder $container)
Definition: PublicServicePass.php:43
‪TYPO3\CMS\Core\DependencyInjection
Definition: AutowireInjectMethodsPass.php:18
‪TYPO3\CMS\Core\DependencyInjection\PublicServicePass\$tagName
‪string $tagName
Definition: PublicServicePass.php:30
‪TYPO3\CMS\Core\DependencyInjection\PublicServicePass
Definition: PublicServicePass.php:27
‪TYPO3\CMS\Core\DependencyInjection\PublicServicePass\__construct
‪__construct(string $tagName)
Definition: PublicServicePass.php:35