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

DownCommand::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Mongrate\MongrateBundle\Command;
4
5
use Mongrate\Configuration;
6
use Mongrate\MongrateBundle\Service\ContainerAwareMigrationService;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9 7
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
10
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
11 7
12 7 View Code Duplication
class DownCommand extends \Mongrate\Command\DownCommand implements ContainerAwareInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    use ExtendsStandaloneMongrateCommandTrait;
15
    use ContainerAwareTrait;
16
17
    /**
18
     * @var ContainerAwareMigrationService
19
     */
20
    protected $service;
21
22
    public function __construct(array $config)
23
    {
24
        parent::__construct(null, $config);
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function getMigrationService(Configuration $configuration)
31
    {
32
        return new ContainerAwareMigrationService($configuration);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function initialize(InputInterface $input, OutputInterface $output)
39
    {
40
        $this->service->setContainer($this->container);
41
    }
42
}
43