ContainerAwareMigrationService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createMigrationInstance() 0 10 2
1
<?php
2
3
namespace Mongrate\MongrateBundle\Service;
4
5
use Mongrate\Model\Name;
6
use Symfony\Component\Console\Output\OutputInterface;
7
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
9
use Mongrate\Service\MigrationService;
10
11
class ContainerAwareMigrationService extends MigrationService implements ContainerAwareInterface
12
{
13
    use ContainerAwareTrait;
14
15
    /**
16
     * {@inheritdoc}
17
     */
18 1
    public function createMigrationInstance(Name $name, OutputInterface $output)
19
    {
20 1
        $migration = parent::createMigrationInstance($name, $output);
21
22 1
        if ($migration instanceof ContainerAwareInterface) {
23 1
            $migration->setContainer($this->container);
24 1
        }
25
26 1
        return $migration;
27
    }
28
}
29