Passed
Push — master ( 5b94bc...5b9a89 )
by Richard
18:39 queued 14:59
created

RoutesGeneratorCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PWWEB\Artomator\Commands\Scaffold;
4
5
use PWWEB\Artomator\Commands\BaseCommand as Base;
6
use PWWEB\Artomator\Common\CommandData;
7
use PWWEB\Artomator\Generators\Scaffold\RoutesGenerator;
8
use Symfony\Component\Console\Input\InputArgument;
9
10
class RoutesGeneratorCommand extends Base
11
{
12
    /**
13
     * The console command name.
14
     *
15
     * @var string
16
     */
17
    protected $name = 'artomator.scaffold:routes';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Create routes command';
25
26
    /**
27
     * Create a new command instance.
28
     */
29
    public function __construct()
30
    {
31
        parent::__construct();
32
33
        $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_SCAFFOLD);
34
    }
35
36
    /**
37
     * Execute the command.
38
     *
39
     * @return void
40
     */
41
    public function handle()
42
    {
43
        parent::handle();
44
45
        $routesGenerator = new RoutesGenerator($this->commandData);
46
        $routesGenerator->regenerate();
47
48
        $this->performPostActions();
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
        return [
70
            ['model', InputArgument::OPTIONAL, 'Singular Model name'],
71
        ];
72
    }
73
}
74