Completed
Pull Request — master (#175)
by Ahmed Mohamed Abd El
01:54
created

SolutionMakeCommand::getDefaultNamespace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Facade\Ignition\Commands;
4
5
use Illuminate\Console\GeneratorCommand;
6
use Symfony\Component\Console\Input\InputOption;
7
8
class SolutionMakeCommand extends GeneratorCommand
9
{
10
    /**
11
     * The console command name.
12
     *
13
     * @var string
14
     */
15
    protected $name = 'make:solution';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Create a new custom Ignition solution class';
23
24
    /**
25
     * The type of class being generated.
26
     *
27
     * @var string
28
     */
29
    protected $type = 'Solution';
30
31
    /**
32
     * Get the stub file for the generator.
33
     *
34
     * @return string
35
     */
36
    protected function getStub()
37
    {
38
        return $this->option('runnable')
39
            ? __DIR__.'/stubs/runnable-solution.stub'
40
            : __DIR__.'/stubs/solution.stub';
41
    }
42
43
    /**
44
     * Get the default namespace for the class.
45
     *
46
     * @param  string  $rootNamespace
47
     * @return string
48
     */
49
    protected function getDefaultNamespace($rootNamespace)
50
    {
51
        return $rootNamespace.'\Solutions';
52
    }
53
54
    /**
55
     * Get the console command options.
56
     *
57
     * @return array
58
     */
59
    protected function getOptions()
60
    {
61
        return [
62
            ['runnable', null, InputOption::VALUE_NONE, 'Create runnable solution'],
63
        ];
64
    }
65
}
66