Skip to content

Commit 81a6f40

Browse files
committedOct 2, 2024
[Twig][Icons][Map] fix wiring of ComponentRuntime
1 parent ee18195 commit 81a6f40

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed
 

‎src/DependencyInjection/TwigComponentExtension.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
1818
use Symfony\Component\Config\FileLocator;
1919
use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
20+
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
21+
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
2022
use Symfony\Component\DependencyInjection\ChildDefinition;
2123
use Symfony\Component\DependencyInjection\ContainerBuilder;
2224
use Symfony\Component\DependencyInjection\Exception\LogicException;
@@ -36,8 +38,6 @@
3638
use Symfony\UX\TwigComponent\Twig\ComponentLexer;
3739
use Symfony\UX\TwigComponent\Twig\ComponentRuntime;
3840
use Symfony\UX\TwigComponent\Twig\TwigEnvironmentConfigurator;
39-
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
40-
use function Symfony\Component\DependencyInjection\Loader\Configurator\service_locator;
4141

4242
/**
4343
* @author Kevin Bond <kevinbond@gmail.com>
@@ -110,10 +110,7 @@ class_exists(AbstractArgument::class) ? new AbstractArgument(\sprintf('Added in
110110
$container->register('.ux.twig_component.twig.component_runtime', ComponentRuntime::class)
111111
->setArguments([
112112
new Reference('ux.twig_component.component_renderer'),
113-
service_locator([
114-
'ux:icon' => service('.ux_icons.twig_icon_runtime')->nullOnInvalid(),
115-
'ux:map' => service('ux_map.twig_runtime')->nullOnInvalid(),
116-
]),
113+
new ServiceLocatorArgument(new TaggedIteratorArgument('ux.twig_component.twig_renderer', indexAttribute: 'key', needsIndexes: true)),
117114
])
118115
->addTag('twig.runtime')
119116
;

0 commit comments

Comments
 (0)
Please sign in to comment.