GendoriaCommandQueueBundle   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 7
dl 0
loc 31
ccs 11
cts 11
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContainerExtension() 0 8 3
A build() 0 7 1
1
<?php
2
3
namespace Gendoria\CommandQueueBundle;
4
5
use Gendoria\CommandQueueBundle\DependencyInjection\GendoriaCommandQueueExtension;
6
use Gendoria\CommandQueueBundle\DependencyInjection\Pass\CommandProcessorPass;
7
use Gendoria\CommandQueueBundle\DependencyInjection\Pass\PoolsPass;
8
use Gendoria\CommandQueueBundle\DependencyInjection\Pass\RegisterSerializerDriversPass;
9
use Gendoria\CommandQueueBundle\DependencyInjection\Pass\WorkerRunnersPass;
10
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
use Symfony\Component\HttpKernel\Bundle\Bundle;
13
14
/**
15
 * Command queue bundle.
16
 *
17
 * @author Tomasz Struczyński <[email protected]>
18
 */
19
class GendoriaCommandQueueBundle extends Bundle
20
{
21
    /**
22
     * Get default extension class instance.
23
     *
24
     * @return GendoriaCommandQueueExtension
25
     */
26 1
    public function getContainerExtension()
27
    {
28 1
        if (null === $this->extension || false === $this->extension) {
29 1
            $this->extension = new GendoriaCommandQueueExtension();
30 1
        }
31
32 1
        return $this->extension;
33
    }
34
35
    /**
36
     * Build bundle.
37
     *
38
     * During build, two compile passes are registered: for fetching command processors and pool configurations.
39
     *
40
     * @param ContainerBuilder $container Container builder.
41
     */
42 1
    public function build(ContainerBuilder $container)
43
    {
44 1
        $container->addCompilerPass(new CommandProcessorPass(), PassConfig::TYPE_BEFORE_REMOVING);
45 1
        $container->addCompilerPass(new PoolsPass());
46 1
        $container->addCompilerPass(new RegisterSerializerDriversPass());
47 1
        $container->addCompilerPass(new WorkerRunnersPass());
48 1
    }
49
}
50