Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

InputParserPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use Symfony\Component\DependencyInjection\Reference;
12
19 class InputParserPass implements CompilerPassInterface
20 {
21 public function process(ContainerBuilder $container)
22 {
23 if (!$container->hasDefinition('ezpublish_rest.input.parsing_dispatcher')) {
24 return;
25 }
26
27 $definition = $container->getDefinition('ezpublish_rest.input.parsing_dispatcher');
28
29 foreach ($container->findTaggedServiceIds('ezpublish_rest.input.parser') as $id => $attributes) {
30 foreach ($attributes as $attribute) {
31 if (!isset($attribute['mediaType'])) {
32 throw new \LogicException('ezpublish_rest.input.parser service tag needs a "mediaType" attribute to identify the input parser. None given.');
33 }
34
35 $definition->addMethodCall(
36 'addParser',
37 [$attribute['mediaType'], new Reference($id)]
38 );
39 }
40 }
41 }
42 }
eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler\InputParserPass
Container compiler processor for the ezpublish_rest.input.parser service tag.
Definition: InputParserPass.php:20
eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler\InputParserPass\process
process(ContainerBuilder $container)
Definition: InputParserPass.php:21
eZ\Bundle\EzPublishRestBundle\DependencyInjection\Compiler
Definition: FieldTypeProcessorPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.