Completed
Push — master ( 926f1e...80db42 )
by Anton
10:25 queued 07:09
created

CreateCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 22
loc 22
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 16 16 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * @copyright Bluz PHP Team
4
 * @link https://github.com/bluzphp/bluzman
5
 */
6
7
namespace Bluzman\Command\Db;
8
9
use Bluzman\Input\InputArgument;
10
11
/**
12
 * Create migration command
13
 *
14
 * @package  Bluzman\Command\Db
15
 * @author   Anton Shevchuk
16
 */
17 View Code Duplication
class CreateCommand extends AbstractDbCommand
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...
18
{
19
    /**
20
     * Command configuration
21
     */
22 14
    protected function configure()
23
    {
24
        $this
25
            // the name of the command (the part after "bin/bluzman")
26 14
            ->setName('db:create')
27
            // the short description shown while running "php bin/bluzman list"
28 14
            ->setDescription('Create DB migrations')
29
            // the full command description shown when running the command with
30
            // the "--help" option
31 14
            ->setHelp('This command is shorthand to phinx tool')
32
        ;
33
34 14
        $name = new InputArgument('name', InputArgument::REQUIRED, 'Migration name is required');
35
36 14
        $this->getDefinition()->addArgument($name);
37 14
    }
38
}
39