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

APIScaffoldGeneratorCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 12
c 2
b 0
f 0
dl 0
loc 62
rs 10

4 Methods

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