GenerateCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 37
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInputCommand() 0 14 3
1
<?php
2
/**
3
 * Reddogs (https://github.com/reddogs-at)
4
 *
5
 * @see https://github.com/reddogs-at/reddogs-doctrine-migrations for the canonical source repository
6
 * @license https://github.com/reddogs-at/reddogs-doctrine-migrations/blob/master/LICENSE MIT License
7
 */
8
namespace Reddogs\Doctrine\Migrations;
9
10
use ZF\Console\Route;
11
12
/**
13
 * Command for generating new blank module migration classes
14
 */
15
class GenerateCommand extends AbstractCommand
16
{
17
    /**
18
     * Boolean rout params
19
     *
20
     * @var array
21
     */
22
    protected $booleanParams = [
23
        '--quiet',
24
        '-q',
25
        '-n',
26
        '--verbose',
27
        '-v',
28
        '-vv',
29
        '-vvv'
30
    ];
31
32
    /**
33
     * Get input command
34
     * {@inheritDoc}
35
     * @see \Reddogs\Doctrine\Migrations\AbstractCommand::getInputCommand()
36
     */
37
    public function getInputCommand(Route $route)
38
    {
39
        $matches = $route->getMatches();
40
        $inputCommand =  'migrations:generate';
41
42
        if (is_array($matches)) {
43
            $params = [];
44
            $params = $this->applyBooleanParams($params, $matches);
45
            if (! empty($params)) {
46
                $inputCommand .= ' ' . implode(' ', $params);
47
            }
48
        }
49
        return $inputCommand;
50
    }
51
}