‪TYPO3CMS  ‪main
Services.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 namespace ‪TYPO3\CMS\Fluid;
6 
7 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
8 use Symfony\Component\DependencyInjection\ContainerBuilder;
9 use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
10 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface;
11 
12 return static function (ContainerConfigurator $container, ContainerBuilder $containerBuilder) {
13  $containerBuilder->registerForAutoconfiguration(ViewHelperInterface::class)->addTag('fluid.viewhelper');
14 
15  $containerBuilder->addCompilerPass(new class () implements CompilerPassInterface {
16  public function process(ContainerBuilder $container)
17  {
18  foreach ($container->findTaggedServiceIds('fluid.viewhelper') as $id => $tags) {
19  $container->findDefinition($id)->setPublic(true)->setShared(false);
20  }
21  }
22  });
23 };
‪TYPO3\CMS\Fluid