@@ -116,6 +116,9 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | |
119 | + /** |
|
120 | + * @param boolean $overwrite |
|
121 | + */ |
|
119 | 122 | public function copyApiFiles($overwrite) { |
120 | 123 | |
121 | 124 | $command = sprintf('cp -r %s "%s/." "%s"', |
@@ -128,6 +131,9 @@ discard block |
||
128 | 131 | $this->info('- Api files copied'); |
129 | 132 | } |
130 | 133 | |
134 | + /** |
|
135 | + * @param boolean $overwrite |
|
136 | + */ |
|
131 | 137 | public function copyAngularjsFiles($overwrite) { |
132 | 138 | |
133 | 139 | // resource angular js path |
@@ -34,13 +34,15 @@ |
||
34 | 34 | |
35 | 35 | $overwrite = false; |
36 | 36 | |
37 | - if($this->option('overwrite')) |
|
38 | - $overwrite = true; |
|
37 | + if($this->option('overwrite')) { |
|
38 | + $overwrite = true; |
|
39 | + } |
|
39 | 40 | |
40 | 41 | $generate = false; |
41 | 42 | |
42 | - if($this->option('generate')) |
|
43 | - $generate = true; |
|
43 | + if($this->option('generate')) { |
|
44 | + $generate = true; |
|
45 | + } |
|
44 | 46 | |
45 | 47 | |
46 | 48 | switch ($this->argument('app')) { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Replace and store the Stub. |
24 | 24 | * |
25 | - * @return string |
|
25 | + * @return IndexApiCompiler |
|
26 | 26 | */ |
27 | 27 | public function replaceAndStore() |
28 | 28 | { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @param null $extra |
36 | 36 | * |
37 | - * @return string |
|
37 | + * @return IndexApiCompiler |
|
38 | 38 | */ |
39 | 39 | public function compile($extra = null) |
40 | 40 | { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * Get output filename |
54 | 54 | * |
55 | 55 | * |
56 | - * @return $this |
|
56 | + * @return string |
|
57 | 57 | */ |
58 | 58 | protected function getOutputFilename() |
59 | 59 | { |
@@ -41,8 +41,7 @@ |
||
41 | 41 | if (File::exists(base_path('scaffolder-config/cache/' . $this->cachePrefix . self::CACHE_EXT))) |
42 | 42 | { |
43 | 43 | return $this->store(new FileToCompile(true, $this->cachePrefix)); |
44 | - } |
|
45 | - else |
|
44 | + } else |
|
46 | 45 | { |
47 | 46 | |
48 | 47 | return $this->replaceAndStore(); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * Compiles a group of routes. |
46 | 46 | * |
47 | 47 | * @param $hash |
48 | - * @param null $extra |
|
48 | + * @param string $compiledIndexes |
|
49 | 49 | * |
50 | 50 | * @return mixed |
51 | 51 | */ |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * Get output filename |
64 | 64 | * |
65 | 65 | * |
66 | - * @return $this |
|
66 | + * @return string |
|
67 | 67 | */ |
68 | 68 | protected function getOutputFilename() |
69 | 69 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Replace and store the Stub. |
24 | 24 | * |
25 | - * @return string |
|
25 | + * @return ListChooseColumnsCompiler |
|
26 | 26 | */ |
27 | 27 | public function replaceAndStore() |
28 | 28 | { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * Get output filename |
36 | 36 | * |
37 | 37 | * |
38 | - * @return $this |
|
38 | + * @return string |
|
39 | 39 | */ |
40 | 40 | protected function getOutputFilename() |
41 | 41 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Replace and store the Stub. |
24 | 24 | * |
25 | - * @return string |
|
25 | + * @return ListControllerCompiler |
|
26 | 26 | */ |
27 | 27 | public function replaceAndStore() |
28 | 28 | { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * Get output filename |
78 | 78 | * |
79 | 79 | * |
80 | - * @return $this |
|
80 | + * @return string |
|
81 | 81 | */ |
82 | 82 | protected function getOutputFilename() |
83 | 83 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Replace and store the Stub. |
24 | 24 | * |
25 | - * @return string |
|
25 | + * @return ListDetailCompiler |
|
26 | 26 | */ |
27 | 27 | public function replaceAndStore() |
28 | 28 | { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * Get output filename |
36 | 36 | * |
37 | 37 | * |
38 | - * @return $this |
|
38 | + * @return string |
|
39 | 39 | */ |
40 | 40 | protected function getOutputFilename() |
41 | 41 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Replace and store the Stub. |
24 | 24 | * |
25 | - * @return string |
|
25 | + * @return ListModuleCompiler |
|
26 | 26 | */ |
27 | 27 | public function replaceAndStore() |
28 | 28 | { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * Get output filename |
36 | 36 | * |
37 | 37 | * |
38 | - * @return $this |
|
38 | + * @return string |
|
39 | 39 | */ |
40 | 40 | protected function getOutputFilename() |
41 | 41 | { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * Replace and store the Stub. |
27 | 27 | * |
28 | - * @return string |
|
28 | + * @return ListTemplateCompiler |
|
29 | 29 | */ |
30 | 30 | public function replaceAndStore() |
31 | 31 | { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * get search conditions |
55 | 55 | * |
56 | - * @return $this |
|
56 | + * @return string |
|
57 | 57 | */ |
58 | 58 | public function getInputFields(){ |
59 | 59 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param string $field |
98 | 98 | * @param string $fieldStub |
99 | 99 | * |
100 | - * @return $this |
|
100 | + * @return string |
|
101 | 101 | */ |
102 | 102 | protected function replaceFieldInput($field, $fieldStub){ |
103 | 103 | $fieldStub = $this->replaceFieldStrings($field, $fieldStub) ; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * @param string $field |
113 | 113 | * @param string $fieldStub |
114 | 114 | * |
115 | - * @return $this |
|
115 | + * @return string |
|
116 | 116 | */ |
117 | 117 | protected function replaceFieldValidations($field, $fieldStub){ |
118 | 118 | $fieldStub = $this->replaceFieldStrings($field, $fieldStub) ; |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * Get output filename |
200 | 200 | * |
201 | 201 | * |
202 | - * @return $this |
|
202 | + * @return string |
|
203 | 203 | */ |
204 | 204 | protected function getOutputFilename() |
205 | 205 | { |
@@ -122,10 +122,11 @@ discard block |
||
122 | 122 | $inputValidations = '' ; |
123 | 123 | |
124 | 124 | foreach ($validationsConverted as $attribute => $value) { |
125 | - if($value) |
|
126 | - $inputValidations .= ' '.$attribute.'="'. $value.'"' ; |
|
127 | - else |
|
128 | - $inputValidations .= ' '.$attribute ; |
|
125 | + if($value) { |
|
126 | + $inputValidations .= ' '.$attribute.'="'. $value.'"' ; |
|
127 | + } else { |
|
128 | + $inputValidations .= ' '.$attribute ; |
|
129 | + } |
|
129 | 130 | } |
130 | 131 | |
131 | 132 | $fieldStub = str_replace('{{field_validation}}', $inputValidations, $fieldStub); |
@@ -174,21 +175,19 @@ discard block |
||
174 | 175 | |
175 | 176 | if($field->index == 'primary'){ |
176 | 177 | $uiType = 'primary' ; |
177 | - } |
|
178 | - elseif(isset($field->foreignKey) && $field->foreignKey){ |
|
179 | - if(isset($field->foreignKey->eager) && $field->foreignKey->eager) |
|
180 | - $uiType = 'foreign_eager' ; |
|
181 | - else |
|
182 | - $uiType = $field->type->ui ; |
|
183 | - } |
|
184 | - else { |
|
178 | + } elseif(isset($field->foreignKey) && $field->foreignKey){ |
|
179 | + if(isset($field->foreignKey->eager) && $field->foreignKey->eager) { |
|
180 | + $uiType = 'foreign_eager' ; |
|
181 | + } else { |
|
182 | + $uiType = $field->type->ui ; |
|
183 | + } |
|
184 | + } else { |
|
185 | 185 | $uiType = $field->type->ui ; |
186 | 186 | } |
187 | 187 | |
188 | 188 | if(array_key_exists($uiType, $this->inputStub)){ |
189 | 189 | return $this->inputStub[$uiType]; |
190 | - } |
|
191 | - else { |
|
190 | + } else { |
|
192 | 191 | $this->inputStub[$uiType] = File::get($this->stubsDirectory . 'List/'. CamelCase::convertToCamelCase($uiType). '.html'); |
193 | 192 | |
194 | 193 | return $this->inputStub[$uiType]; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Replace and store the Stub. |
24 | 24 | * |
25 | - * @return string |
|
25 | + * @return ModuleCompiler |
|
26 | 26 | */ |
27 | 27 | public function replaceAndStore() |
28 | 28 | { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * Get output filename |
36 | 36 | * |
37 | 37 | * |
38 | - * @return $this |
|
38 | + * @return string |
|
39 | 39 | */ |
40 | 40 | protected function getOutputFilename() |
41 | 41 | { |