Completed
Push — master ( 90700d...2d56b7 )
by Amy
03:23
created

ContainerAwareMigrationService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

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
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
    public function createMigrationInstance(Name $name, OutputInterface $output)
19
    {
20
        $migration = parent::createMigrationInstance($name, $output);
21
22
        if ($migration instanceof ContainerAwareInterface) {
23
            $migration->setContainer($this->container);
24
        }
25
26
        return $migration;
27
    }
28
}
29