MigrateListCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
/**
3
 * Created by IntelliJ IDEA.
4
 * User: gerk
5
 * Date: 20.04.17
6
 * Time: 00:47
7
 */
8
9
namespace PeekAndPoke\Component\Slumber\FrameworkIntegration\Cli;
10
11
use PeekAndPoke\Component\Slumber\Data\Migration\MigrationExecutor;
12
use Symfony\Component\Console\Command\Command;
13
use Symfony\Component\Console\Input\InputInterface;
14
use Symfony\Component\Console\Output\OutputInterface;
15
16
17
/**
18
 * @author Karsten J. Gerber <[email protected]>
19
 */
20
class MigrateListCommand extends Command
21
{
22
    /** @var MigrationExecutor */
23
    private $migrationExecutor;
24
25
    public function __construct(MigrationExecutor $migrationExecutor)
26
    {
27
        parent::__construct('slumber:migrate');
28
29
        $this->setDescription('List available and executed migrations');
30
31
        $this->migrationExecutor = $migrationExecutor;
32
    }
33
34
    /**
35
     * @param InputInterface  $input
36
     * @param OutputInterface $output
37
     *
38
     * @return mixed
39
     */
40
    protected function execute(InputInterface $input, OutputInterface $output)
41
    {
42
        $this->migrationExecutor->logStats();
43
44
        return 0;
45
    }
46
}
47