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

GraphQLGeneratorCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PWWEB\Artomator\Commands\GraphQL;
4
5
use PWWEB\Artomator\Commands\BaseCommand;
6
use PWWEB\Artomator\Common\CommandData;
7
8
class GraphQLGeneratorCommand extends BaseCommand
9
{
10
    /**
11
     * The console command name.
12
     *
13
     * @var string
14
     */
15
    protected $name = 'artomator:graphql';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Create a full CRUD GraphQL 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_GRAPHQL);
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->generateGraphQLItems();
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