Completed
Push — master ( cfe86b...492fac )
by Derek Stephen
09:03
created

Migration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 28
ccs 0
cts 18
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 4 1
A configure() 0 16 1
1
<?php
2
namespace Del\Common\Command;
3
4
use Symfony\Component\Console\Command\Command;
5
use Doctrine\DBAL\Migrations\Configuration\Configuration;
6
use Doctrine\DBAL\Migrations\Migration as DoctrineMigration;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
use Symfony\Component\Console\Input\InputArgument;
10
use Symfony\Component\Console\Input\InputOption;
11
12
13
class Migration extends Command
14
{
15
    private $migrationPaths = ['migrations'];
0 ignored issues
show
Unused Code introduced by
The property $migrationPaths is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
16
    private $entityPaths = ['src/Entity'];
0 ignored issues
show
Unused Code introduced by
The property $entityPaths is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
17
18
    public function execute(InputInterface $input, OutputInterface $output)
19
    {
20
        die('do shit!');
0 ignored issues
show
Coding Style Compatibility introduced by
The method execute() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
21
    }
22
23
24
    protected function configure()
25
    {
26
        $this
27
            ->setName('delboy1978uk:migrate')
28
            ->setDescription('Execute migrations in a vendor package')
29
            ->addArgument('migrations-directory', InputArgument::REQUIRED, 'The directory containing the migrations.')
30
            ->addArgument('entity-directory', InputArgument::REQUIRED, 'The directory containing the migrations.')
31
            ->setHelp(<<<EOT
32
The <info>%command.name%</info> command executes migrate in a specified directory
33
34
    <info>%command.full_name% foldername</info>
35
EOT
36
            );
37
38
        parent::configure();
39
    }
40
}