FormExtensionPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 11 2
1
<?php
2
3
namespace Psi\Bundle\ContentType\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Reference;
8
9
class FormExtensionPass implements CompilerPassInterface
10
{
11
    public function process(ContainerBuilder $container)
12
    {
13
        if (!$container->has('form.registry')) {
14
            return;
15
        }
16
17
        $registryDef = $container->getDefinition('form.registry');
18
        $extensions = $registryDef->getArgument(0);
19
        $extensions[] = new Reference('psi_content_type.form.extension.field');
20
        $registryDef->replaceArgument(0, $extensions);
21
    }
22
}
23