|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Symfony\Component\DependencyInjection\Loader\Configurator; |
| 4 | + |
| 5 | +return static function(ContainerConfigurator $container) { |
| 6 | + $services = $container->services(); |
| 7 | + $parameters = $container->parameters(); |
| 8 | + |
| 9 | + $services->defaults() |
| 10 | + ->private(); |
| 11 | + |
| 12 | + $services->set(\Thunder\Shortcode\HandlerContainer\HandlerContainer::class); |
| 13 | + |
| 14 | + $services->set('webfactory_shortcode.regular_parser', \Thunder\Shortcode\Parser\RegularParser::class); |
| 15 | + |
| 16 | + $services->set('webfactory_shortcode.regex_parser', \Thunder\Shortcode\Parser\RegexParser::class); |
| 17 | + |
| 18 | + $services->set(\Webfactory\ShortcodeBundle\Factory\ProcessorFactory::class) |
| 19 | + ->args([ |
| 20 | + service('webfactory_shortcode.parser'), |
| 21 | + service(\Thunder\Shortcode\HandlerContainer\HandlerContainer::class), |
| 22 | + service(\Thunder\Shortcode\EventContainer\EventContainer::class), |
| 23 | + '%webfactory_shortcode.recursion_depth%', |
| 24 | + '%webfactory_shortcode.max_iterations%', |
| 25 | + ]); |
| 26 | + |
| 27 | + $services->set(\Thunder\Shortcode\Processor\Processor::class) |
| 28 | + ->public() |
| 29 | + ->factory([service(\Webfactory\ShortcodeBundle\Factory\ProcessorFactory::class), 'create']); |
| 30 | + |
| 31 | + $services->set(\Thunder\Shortcode\EventContainer\EventContainer::class) |
| 32 | + ->call('addListener', [ |
| 33 | + \Thunder\Shortcode\Events::REPLACE_SHORTCODES, |
| 34 | + inline_service(\Webfactory\ShortcodeBundle\Handler\RemoveWrappingParagraphElementsEventHandler::class), |
| 35 | + ]); |
| 36 | + |
| 37 | + $services->set('Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.esi', \Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler::class) |
| 38 | + ->abstract() |
| 39 | + ->lazy() |
| 40 | + ->args([ |
| 41 | + service('fragment.handler'), |
| 42 | + '', |
| 43 | + 'esi', |
| 44 | + service('request_stack'), |
| 45 | + service('logger')->nullOnInvalid(), |
| 46 | + ]) |
| 47 | + ->tag('monolog.logger', ['channel' => 'shortcode']); |
| 48 | + |
| 49 | + $services->alias('webfactory.shortcode.embed_esi_for_shortcode_handler', 'Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.esi'); |
| 50 | + |
| 51 | + $services->set('Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.inline', \Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler::class) |
| 52 | + ->abstract() |
| 53 | + ->lazy() |
| 54 | + ->args([ |
| 55 | + service('fragment.handler'), |
| 56 | + '', |
| 57 | + 'inline', |
| 58 | + service('request_stack'), |
| 59 | + service('logger')->nullOnInvalid(), |
| 60 | + ]) |
| 61 | + ->tag('monolog.logger', ['channel' => 'shortcode']); |
| 62 | + |
| 63 | + $services->alias('webfactory.shortcode.embed_inline_for_shortcode_handler', 'Webfactory\ShortcodeBundle\Handler\EmbeddedShortcodeHandler.inline'); |
| 64 | + |
| 65 | + $services->set(\Webfactory\ShortcodeBundle\Twig\ShortcodeExtension::class, \Webfactory\ShortcodeBundle\Twig\ShortcodeExtension::class) |
| 66 | + ->args([service(\Thunder\Shortcode\Processor\Processor::class)]) |
| 67 | + ->tag('twig.extension'); |
| 68 | + |
| 69 | + $services->set(\Webfactory\ShortcodeBundle\Test\ShortcodeDefinitionTestHelper::class) |
| 70 | + ->public() |
| 71 | + ->args([ |
| 72 | + service('controller_resolver'), |
| 73 | + service(\Thunder\Shortcode\HandlerContainer\HandlerContainer::class), |
| 74 | + ]); |
| 75 | +}; |
0 commit comments