@@ -21,16 +21,25 @@ 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); |
| 27 | 30 | } |
| 28 | 31 | |
| 32 | + /** |
|
| 33 | + * @param string $name |
|
| 34 | + */ |
|
| 29 | 35 | protected function getArgumentParser($name){ |
| 30 | 36 | $format = $this->argumentFormatLoader->load($name); |
| 31 | 37 | return new ArgumentParser($format); |
| 32 | 38 | } |
| 33 | 39 | |
| 40 | + /** |
|
| 41 | + * @param string $content |
|
| 42 | + */ |
|
| 34 | 43 | protected function save($content, $path, $name, $force = false) |
| 35 | 44 | { |
| 36 | 45 | if (!$force && $this->fs->exists($path) && $this->input->hasOption('force') && !$this->option('force')) { |
@@ -49,6 +58,9 @@ discard block |
||
| 49 | 58 | } |
| 50 | 59 | } |
| 51 | 60 | |
| 61 | + /** |
|
| 62 | + * @param integer $n |
|
| 63 | + */ |
|
| 52 | 64 | protected function spaces($n) |
| 53 | 65 | { |
| 54 | 66 | return str_repeat(' ', $n); |
@@ -111,6 +111,9 @@ |
||
| 111 | 111 | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | + /** |
|
| 115 | + * @param string $tag |
|
| 116 | + */ |
|
| 114 | 117 | protected function fieldsHavingTag($tag) |
| 115 | 118 | { |
| 116 | 119 | return array_map(function($field){ |
@@ -135,6 +135,10 @@ |
||
| 135 | 135 | return $string; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $old |
|
| 140 | + * @param string $new |
|
| 141 | + */ |
|
| 138 | 142 | protected function convertArray($list, $old, $new) |
| 139 | 143 | { |
| 140 | 144 | return implode($new, array_filter(explode($old, $list), function($item){ |
@@ -43,6 +43,9 @@ discard block |
||
| 43 | 43 | $this->save($content, "./{$path}/{$name}.php", "{$name} model"); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | + /** |
|
| 47 | + * @param string $rule |
|
| 48 | + */ |
|
| 46 | 49 | protected function getFieldByRuleAsArrayFields($rule, $allowPartialMatch = false) |
| 47 | 50 | { |
| 48 | 51 | $rules = $this->getRules(false); |
@@ -63,6 +66,9 @@ discard block |
||
| 63 | 66 | }, $fields)); |
| 64 | 67 | } |
| 65 | 68 | |
| 69 | + /** |
|
| 70 | + * @param string $arg |
|
| 71 | + */ |
|
| 66 | 72 | protected function getAsArrayFields($arg, $isOption = true) |
| 67 | 73 | { |
| 68 | 74 | $arg = ($isOption) ? $this->option($arg) : $this->argument($arg); |
@@ -97,6 +103,10 @@ discard block |
||
| 97 | 103 | return implode(PHP_EOL, $relations); |
| 98 | 104 | } |
| 99 | 105 | |
| 106 | + /** |
|
| 107 | + * @param string $type |
|
| 108 | + * @param string $option |
|
| 109 | + */ |
|
| 100 | 110 | protected function getRelationsByType($type, $option, $withTimestamps = false) |
| 101 | 111 | { |
| 102 | 112 | $relations = []; |