ModelBuildCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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 ModelBuildCommand extends AbstractCommand
16
{
17
18
    /**
19
     *
20
     * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
21
     */
22
    protected function configure(): void
23
    {
24
        $this->setName('propel:model:build')
25
             ->setDescription('Generate propel models');
26
    }
27
28
    /**
29
     * @param \Symfony\Component\Console\Input\InputInterface $input
30
     * @param \Symfony\Component\Console\Output\OutputInterface $output
31
     *
32
     * @return int|null|void
33
     */
34
    protected function execute(InputInterface $input, OutputInterface $output)
35
    {
36
        foreach ($this->getFacade()->buildModel() as $line) {
37
            $output->write($line);
38
        }
39
    }
40
}
41