Total Complexity | 5 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | abstract class AbstractMakeRuleSet extends GeneratorCommand |
||
10 | { |
||
11 | /** |
||
12 | * The console command name. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $name; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description; |
||
24 | |||
25 | /** |
||
26 | * The type of class being generated. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $type; |
||
31 | |||
32 | protected $stub; |
||
33 | |||
34 | /** |
||
35 | * Get the stub file for the generator. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | protected function getStub() |
||
40 | { |
||
41 | return $this->stub; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * Get the default namespace for the class. |
||
46 | * |
||
47 | * @param string $rootNamespace |
||
48 | * @return string |
||
49 | */ |
||
50 | protected function getDefaultNamespace($rootNamespace) |
||
51 | { |
||
52 | if ($this->isCustomNamespace()) { |
||
53 | return $rootNamespace; |
||
54 | } |
||
55 | |||
56 | return "$rootNamespace\\Rules\\{$this->type}s"; |
||
57 | } |
||
58 | |||
59 | protected function getOptions() |
||
63 | ]; |
||
64 | } |
||
65 | |||
66 | protected function isCustomNamespace(): bool |
||
69 | } |
||
70 | } |
||
71 |