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

APIGeneratorCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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