@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | class BaseCommand extends Command { |
11 | 11 | |
12 | 12 | protected $fs; |
13 | - protected $templates; |
|
13 | + protected $templates; |
|
14 | 14 | |
15 | - public function __construct(Filesystem $fs) |
|
16 | - { |
|
15 | + public function __construct(Filesystem $fs) |
|
16 | + { |
|
17 | 17 | parent::__construct(); |
18 | 18 | |
19 | 19 | $this->fs = $fs; |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function getNamespace(string $path = null): string |
58 | 58 | { |
59 | - if (! $path) { |
|
60 | - $path = $this->option('path'); |
|
61 | - } |
|
59 | + if (! $path) { |
|
60 | + $path = $this->option('path'); |
|
61 | + } |
|
62 | 62 | |
63 | - return implode('\\', array_map('studly_case', array_filter(array_map('trim', explode('/', $path)), function($value) { |
|
63 | + return implode('\\', array_map('studly_case', array_filter(array_map('trim', explode('/', $path)), function($value) { |
|
64 | 64 | return !empty($value); |
65 | 65 | }))); |
66 | 66 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | return $this->templates->load($name); |
27 | 27 | } |
28 | 28 | |
29 | - protected function getArgumentParser($name){ |
|
29 | + protected function getArgumentParser($name) { |
|
30 | 30 | $format = $this->argumentFormatLoader->load($name); |
31 | 31 | return new ArgumentParser($format); |
32 | 32 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function getNamespace(string $path = null): string |
58 | 58 | { |
59 | - if (! $path) { |
|
59 | + if (!$path) { |
|
60 | 60 | $path = $this->option('path'); |
61 | 61 | } |
62 | 62 | |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | |
68 | 68 | protected function parseValue($value, string $parser) |
69 | 69 | { |
70 | - if(! $value){ |
|
70 | + if (!$value) { |
|
71 | 71 | return false; |
72 | 72 | } |
73 | 73 | |
74 | - if(! $this->option('parsed')){ |
|
74 | + if (!$this->option('parsed')) { |
|
75 | 75 | return $this->getArgumentParser($parser)->parse($value); |
76 | 76 | } |
77 | 77 |
@@ -21,6 +21,9 @@ discard block |
||
21 | 21 | $this->argumentFormatLoader = new ArgumentFormatLoader($fs); |
22 | 22 | } |
23 | 23 | |
24 | + /** |
|
25 | + * @param string $name |
|
26 | + */ |
|
24 | 27 | protected function getTemplate($name) |
25 | 28 | { |
26 | 29 | return $this->templates->load($name); |
@@ -31,6 +34,9 @@ discard block |
||
31 | 34 | return new ArgumentParser($format); |
32 | 35 | } |
33 | 36 | |
37 | + /** |
|
38 | + * @param string $content |
|
39 | + */ |
|
34 | 40 | protected function save($content, $path, $name, $force = false) |
35 | 41 | { |
36 | 42 | if (!$force && $this->fs->exists($path) && $this->input->hasOption('force') && !$this->option('force')) { |
@@ -49,6 +55,9 @@ discard block |
||
49 | 55 | } |
50 | 56 | } |
51 | 57 | |
58 | + /** |
|
59 | + * @param integer $n |
|
60 | + */ |
|
52 | 61 | protected function spaces($n): string |
53 | 62 | { |
54 | 63 | return str_repeat(' ', $n); |