createMigrationInstance()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
crap 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