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

GraphQLGeneratorCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
dl 0
loc 60
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handle() 0 9 1
A getArguments() 0 3 1
A getOptions() 0 3 1
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