Completed
Push — master ( 8bc203...e5859f )
by recca
09:43
created

GeneratorCommand::getArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Recca0120\Generator\Console;
4
5
use Illuminate\Console\Command;
6
use Recca0120\Generator\Generator;
7
use Symfony\Component\Console\Input\InputArgument;
8
9
class GeneratorCommand extends Command
10
{
11
    private $generator;
12
13
    private $command;
14
15
    public function __construct(Generator $generator, $command)
16
    {
17
        $this->generator = $generator;
18
        $this->command = $command;
19
        $this->name = 'generate:'.$command;
20
21
        parent::__construct();
22
    }
23
24
    public function handle()
25
    {
26
        $this->generator->generate($this->command, $this->argument('name'))->store();
27
    }
28
29
    /**
30
     * Get the console command arguments.
31
     *
32
     * @return array
33
     */
34
    protected function getArguments()
35
    {
36
        return [
37
            ['name', InputArgument::REQUIRED, 'name'],
38
        ];
39
    }
40
}
41