Passed
Push — feature/lg ( 3c06af...b2e7fb )
by Richard
03:07
created

MigrationGeneratorCommand::getArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PWWEB\Artomator\Commands\Common;
4
5
use InfyOm\Generator\Generators\MigrationGenerator;
6
use PWWEB\Artomator\Commands\BaseCommand;
7
use PWWEB\Artomator\Common\CommandData;
8
9
class MigrationGeneratorCommand extends BaseCommand
10
{
11
    /**
12
     * The console command name.
13
     *
14
     * @var string
15
     */
16
    protected $name = 'artomator:migration';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Create migration command';
24
25
    /**
26
     * Create a new command instance.
27
     */
28
    public function __construct()
29
    {
30
        parent::__construct();
31
32
        $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);
33
    }
34
35
    /**
36
     * Execute the command.
37
     *
38
     * @return void
39
     */
40
    public function handle()
41
    {
42
        parent::handle();
43
44
        if ($this->commandData->getOption('fromTable')) {
45
            $this->error('fromTable option is not allowed to use with migration generator');
46
47
            return;
48
        }
49
50
        $migrationGenerator = new MigrationGenerator($this->commandData);
51
        $migrationGenerator->generate();
52
53
        $this->performPostActionsWithMigration();
54
    }
55
56
    /**
57
     * Get the console command options.
58
     *
59
     * @return array
60
     */
61
    public function getOptions()
62
    {
63
        return array_merge(parent::getOptions(), []);
64
    }
65
66
    /**
67
     * Get the console command arguments.
68
     *
69
     * @return array
70
     */
71
    protected function getArguments()
72
    {
73
        return array_merge(parent::getArguments(), []);
74
    }
75
}
76