Passed
Pull Request — master (#6)
by
unknown
02:45
created

FormatPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 9
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace ElevenLabs\ApiServiceBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
/**
9
 * Class FormatPass.
10
 */
11
class FormatPass implements CompilerPassInterface
12
{
13
    /**
14
     * @param ContainerBuilder $container
15
     */
16
    public function process(ContainerBuilder $container)
17
    {
18
        $definition = $container->getDefinition('api_service.decoder.symfony');
19
20
        $ids = [];
21
        foreach ($container->findTaggedServiceIds('serializer.encoder') as $id => $configs) {
22
            $ids[] = $container->getDefinition($id);
23
        }
24
        $definition->setArgument(0, $ids);
25
    }
26
}
27