YamlFixturesPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 13 3
1
<?php
2
namespace Khepin\YamlFixturesBundle\DependencyInjection\Compiler;
3
4
use Symfony\Component\DependencyInjection\Reference;
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
8
class YamlFixturesPass implements CompilerPassInterface
9
{
10
    public function process(ContainerBuilder $container)
11
    {
12
        if (!$container->has('problematic.acl_manager')) {
13
            return;
14
        }
15
        // If there was a call registered to set the acl manager, we can now
16
        // set it with the proper reference
17
        $definition = $container->getDefinition('khepin.yaml_loader');
18
        if ($definition->hasMethodCall('setAclManager')) {
19
            $definition->removeMethodCall('setAclManager');
20
            $definition->addMethodCall('setAclManager', array(new Reference('problematic.acl_manager')));
21
        }
22
    }
23
}
24