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

FormatPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 14
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 9 2
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