|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Symfony\Component\DependencyInjection\Loader\Configurator; |
| 4 | + |
| 5 | +return static function (ContainerConfigurator $container) { |
| 6 | + $services = $container->services(); |
| 7 | + |
| 8 | + $services->defaults() |
| 9 | + ->private() |
| 10 | + ->autowire() |
| 11 | + ->autoconfigure(); |
| 12 | + |
| 13 | + $services->set(\Webfactory\Bundle\NavigationBundle\Build\BuildDispatcher::class) |
| 14 | + ->share(false); |
| 15 | + |
| 16 | + $services->alias('webfactory_navigation.tree_factory.dispatcher', \Webfactory\Bundle\NavigationBundle\Build\BuildDispatcher::class) |
| 17 | + ->public(); |
| 18 | + |
| 19 | + $services->set(\Webfactory\Bundle\NavigationBundle\Build\TreeFactory::class) |
| 20 | + ->lazy() |
| 21 | + ->args([ |
| 22 | + service('config_cache_factory'), |
| 23 | + '%kernel.cache_dir%/webfactory_navigation/tree.php', |
| 24 | + service(\Psr\Container\ContainerInterface::class), |
| 25 | + service('event_dispatcher'), |
| 26 | + service('logger')->nullOnInvalid(), |
| 27 | + service('debug.stopwatch')->nullOnInvalid(), |
| 28 | + ]) |
| 29 | + ->tag('monolog.logger', ['channel' => 'webfactory_navigation']) |
| 30 | + ->tag('container.service_subscriber'); |
| 31 | + |
| 32 | + $services->alias('webfactory_navigation.tree_factory', \Webfactory\Bundle\NavigationBundle\Build\TreeFactory::class) |
| 33 | + ->public(); |
| 34 | + |
| 35 | + $services->set(\Webfactory\Bundle\NavigationBundle\Tree\Tree::class) |
| 36 | + ->lazy() |
| 37 | + ->factory([service(\Webfactory\Bundle\NavigationBundle\Build\TreeFactory::class), 'getTree']); |
| 38 | + |
| 39 | + $services->alias('webfactory_navigation.tree', \Webfactory\Bundle\NavigationBundle\Tree\Tree::class) |
| 40 | + ->public(); |
| 41 | + |
| 42 | + $services->set(\Webfactory\Bundle\NavigationBundle\Event\ActiveNodeEventListener::class) |
| 43 | + ->tag('kernel.event_listener', ['event' => 'webfactory_navigation.tree_initialized', 'method' => 'initializeTree']); |
| 44 | + |
| 45 | + $services->alias('webfactory_navigation.event.active_node_event_listener', \Webfactory\Bundle\NavigationBundle\Event\ActiveNodeEventListener::class); |
| 46 | + |
| 47 | + $services->set(\Webfactory\Bundle\NavigationBundle\Twig\NavigationExtension::class) |
| 48 | + ->tag('twig.extension'); |
| 49 | + |
| 50 | + $services->alias('webfactory_navigation.twig_extension', \Webfactory\Bundle\NavigationBundle\Twig\NavigationExtension::class); |
| 51 | + |
| 52 | + $services->set(\Webfactory\Bundle\NavigationBundle\Command\DumpTreeCommand::class) |
| 53 | + ->tag('console.command'); |
| 54 | + |
| 55 | + $services->alias('webfactory_navigation.command.dump_tree_command', \Webfactory\Bundle\NavigationBundle\Command\DumpTreeCommand::class); |
| 56 | + |
| 57 | + $services->set(\Webfactory\Bundle\NavigationBundle\Command\LookupNodeCommand::class) |
| 58 | + ->tag('console.command'); |
| 59 | + |
| 60 | + $services->alias('webfactory_navigation.command.lookup_node_command', \Webfactory\Bundle\NavigationBundle\Command\LookupNodeCommand::class); |
| 61 | +}; |
0 commit comments