Passed
Push — master ( 9de3df...49c81a )
by Richard
11:22 queued 11s
created

GraphQLScaffoldGeneratorCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PWWEB\Artomator\Commands;
4
5
use PWWEB\Artomator\Common\CommandData;
6
7
class GraphQLScaffoldGeneratorCommand extends BaseCommand
8
{
9
    /**
10
     * The console command name.
11
     *
12
     * @var string
13
     */
14
    protected $name = 'artomator:graphql_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->generateGraphQLItems();
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