Configuration   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 46
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setContainer() 0 4 1
A configure() 0 12 3
1
<?php
2
3
namespace Liip\MonitorBundle\DoctrineMigrations;
4
5
use Doctrine\Bundle\MigrationsBundle\Command\DoctrineCommand;
6
use Doctrine\Migrations\Configuration\Configuration as BaseConfiguration;
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
9
/**
10
 * Class Configuration.
11
 */
12
class Configuration extends BaseConfiguration
13
{
14
    /**
15
     * Flag whether doctrine migrations bundle is installed.
16
     *
17
     * @var bool
18
     */
19
    private static $haveMigrationBundle;
20
21
    /**
22
     * Service container.
23
     *
24
     * @var ContainerInterface
25
     */
26
    private $container;
27
28
    /**
29
     * Set service container.
30
     *
31
     * @param ContainerInterface $container Service container
32
     *
33
     * @return void
34
     */
35
    public function setContainer(ContainerInterface $container)
36
    {
37
        $this->container = $container;
38
    }
39
40
    /**
41
     * Tune this configuration parameters according to migrations bundle.
42
     *
43
     * @return void
44
     */
45
    public function configure()
46
    {
47
        if (null === self::$haveMigrationBundle) {
48
            self::$haveMigrationBundle = class_exists(DoctrineCommand::class);
49
        }
50
51
        if (!self::$haveMigrationBundle) {
52
            return;
53
        }
54
55
        DoctrineCommand::configureMigrations($this->container, $this);
56
    }
57
}
58