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