@@ -39,11 +39,8 @@ |
||
| 39 | 39 | use Scaffolder\Support\Json; |
| 40 | 40 | use Scaffolder\Support\Arrays; |
| 41 | 41 | use Scaffolder\Support\CamelCase; |
| 42 | -use Scaffolder\Themes\IScaffolderThemeLayouts; |
|
| 43 | -use Scaffolder\Themes\IScaffolderThemeViews; |
|
| 44 | 42 | use Scaffolder\Compilers\Support\PathParser; |
| 45 | - |
|
| 46 | -use stdClass ; |
|
| 43 | +use stdClass; |
|
| 47 | 44 | |
| 48 | 45 | class GeneratorCommand extends Command |
| 49 | 46 | { |
@@ -289,8 +289,9 @@ |
||
| 289 | 289 | //array_push($listChooseColumnsCompilerOutput, $listChooseColumnsCompiler->compile()); |
| 290 | 290 | |
| 291 | 291 | $compiledIndexes .= $indexModuleCompiler->replaceResource($modelData); |
| 292 | - if ($intKey < count($modelsData)) |
|
| 293 | - $compiledIndexes .= ","; |
|
| 292 | + if ($intKey < count($modelsData)) { |
|
| 293 | + $compiledIndexes .= ","; |
|
| 294 | + } |
|
| 294 | 295 | |
| 295 | 296 | $intKey++; |
| 296 | 297 | // Advance progress |
@@ -3,15 +3,10 @@ |
||
| 3 | 3 | namespace Scaffolder\Commands; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Console\Command; |
| 6 | -use Illuminate\Support\Facades\File; |
|
| 7 | - |
|
| 8 | -use stdClass ; |
|
| 9 | 6 | |
| 10 | 7 | // Support classes |
| 11 | 8 | use Scaffolder\Support\Directory; |
| 12 | 9 | use Scaffolder\Support\Json; |
| 13 | -use Scaffolder\Support\Arrays; |
|
| 14 | -use Scaffolder\Support\CamelCase; |
|
| 15 | 10 | use Scaffolder\Compilers\Support\PathParser; |
| 16 | 11 | |
| 17 | 12 | |
@@ -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')) { |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Scaffolder\Compilers\AbstractCompiler; |
| 7 | 7 | use Scaffolder\Compilers\Support\FileToCompile; |
| 8 | 8 | use Scaffolder\Compilers\Support\PathParser; |
| 9 | -use Scaffolder\Support\Directory; |
|
| 10 | 9 | |
| 11 | 10 | class IndexApiCompiler extends AbstractCompiler |
| 12 | 11 | { |
@@ -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(); |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Scaffolder\Compilers\AbstractCompiler; |
| 7 | 7 | use Scaffolder\Compilers\Support\FileToCompile; |
| 8 | 8 | use Scaffolder\Compilers\Support\PathParser; |
| 9 | -use Scaffolder\Support\CamelCase; |
|
| 10 | 9 | |
| 11 | 10 | class IndexModuleCompiler extends AbstractCompiler |
| 12 | 11 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Scaffolder\Compilers\AngularJs; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Facades\File; |
|
| 6 | 5 | use Scaffolder\Compilers\AbstractCompiler; |
| 7 | 6 | use Scaffolder\Compilers\Support\FileToCompile; |
| 8 | 7 | use Scaffolder\Compilers\Support\PathParser; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Scaffolder\Compilers\AngularJs; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Facades\File; |
|
| 6 | 5 | use Scaffolder\Compilers\AbstractCompiler; |
| 7 | 6 | use Scaffolder\Compilers\Support\FileToCompile; |
| 8 | 7 | use Scaffolder\Compilers\Support\PathParser; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Scaffolder\Compilers\AngularJs; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Facades\File; |
|
| 6 | 5 | use Scaffolder\Compilers\AbstractCompiler; |
| 7 | 6 | use Scaffolder\Compilers\Support\FileToCompile; |
| 8 | 7 | use Scaffolder\Compilers\Support\PathParser; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Scaffolder\Compilers\AngularJs; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Facades\File; |
|
| 6 | 5 | use Scaffolder\Compilers\AbstractCompiler; |
| 7 | 6 | use Scaffolder\Compilers\Support\FileToCompile; |
| 8 | 7 | use Scaffolder\Compilers\Support\PathParser; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Scaffolder\Support\Directory; |
| 10 | 10 | use Scaffolder\Support\CamelCase; |
| 11 | 11 | use Scaffolder\Support\Validator; |
| 12 | -use stdClass ; |
|
| 13 | 12 | |
| 14 | 13 | class ListTemplateCompiler extends AbstractCompiler |
| 15 | 14 | { |
@@ -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]; |