MigrateCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 21
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 4 2
A configure() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Database\Communication\Console\Command;
6
7
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
use Xervice\Console\Business\Model\Command\AbstractCommand;
11
12
/**
13
 * @method \Xervice\Database\Business\DatabaseFacade getFacade()
14
 */
15
class MigrateCommand extends AbstractCommand
16
{
17
    /**
18
     * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
19
     */
20
    protected function configure(): void
21
    {
22
        $this->setName('propel:migrate')
23
             ->setDescription('Migrate propel');
24
    }
25
26
    /**
27
     * @param \Symfony\Component\Console\Input\InputInterface $input
28
     * @param \Symfony\Component\Console\Output\OutputInterface $output
29
     *
30
     * @return int|null|void
31
     */
32
    protected function execute(InputInterface $input, OutputInterface $output)
33
    {
34
        foreach ($this->getFacade()->migrate() as $line) {
35
            $output->write($line);
36
        }
37
    }
38
}
39