anonymous//src/ThrusterDoctrineActionsBundle.php$0   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 18
ccs 0
cts 0
cp 0
rs 10
1
<?php
2
3
namespace Thruster\Bundle\DoctrineActionsBundle;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Definition;
8
use Symfony\Component\DependencyInjection\Reference;
9
use Symfony\Component\HttpKernel\Bundle\Bundle;
10
11
/**
12
 * Class ThrusterDoctrineActionsBundle
13
 *
14
 * @package Thruster\Bundle\DoctrineActionsBundle
15
 * @author  Aurimas Niekis <[email protected]>
16
 */
17
class ThrusterDoctrineActionsBundle extends Bundle
18
{
19
    /**
20
     * @inheritDoc
21
     */
22 1
    public function build(ContainerBuilder $container)
23
    {
24 1
        parent::build($container);
25
26 1
        $container->addCompilerPass(
27
            new class implements CompilerPassInterface
28
            {
29
                /**
30
                 * @inheritDoc
31
                 */
32
                public function process(ContainerBuilder $container)
33
                {
34
                    $executorId         = 'thruster_doctrine_actions.doctrine_persist_action.executor';
35
                    $executorDefinition = new Definition(
36
                        'Thruster\Bundle\DoctrineActionsBundle\DoctrinePersistActionExecutor',
37
                        [new Reference('doctrine')]
38
                    );
39
40
                    $executorDefinition->addTag('thruster_action_executor', []);
41
42
                    $container->setDefinition($executorId, $executorDefinition);
43
                }
44
            }
45
        );
46 1
    }
47
}
48