@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | if (File::exists(base_path('scaffolder-config/cache/view_index_' . $hash . self::CACHE_EXT))) |
| 27 | 27 | { |
| 28 | 28 | return $this->store($modelName, $scaffolderConfig, '', new FileToCompile(true, $hash)); |
| 29 | - } |
|
| 30 | - else |
|
| 29 | + } else |
|
| 31 | 30 | { |
| 32 | 31 | $this->stub = $stub; |
| 33 | 32 | |
@@ -58,8 +57,7 @@ discard block |
||
| 58 | 57 | if ($fileToCompile->cached) |
| 59 | 58 | { |
| 60 | 59 | File::copy(base_path('scaffolder-config/cache/view_index_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
| 61 | - } |
|
| 62 | - else |
|
| 60 | + } else |
|
| 63 | 61 | { |
| 64 | 62 | File::put(base_path('scaffolder-config/cache/view_index_' . $fileToCompile->hash . self::CACHE_EXT), $compiled); |
| 65 | 63 | File::copy(base_path('scaffolder-config/cache/view_index_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
@@ -89,8 +87,7 @@ discard block |
||
| 89 | 87 | { |
| 90 | 88 | $fields .= sprintf("{ data: '%s', name: '%s' }," . PHP_EOL, $field->name, $field->name); |
| 91 | 89 | $firstIteration = false; |
| 92 | - } |
|
| 93 | - else |
|
| 90 | + } else |
|
| 94 | 91 | { |
| 95 | 92 | $fields .= sprintf("\t\t\t\t{ data: '%s', name: '%s' }," . PHP_EOL, $field->name, $field->name); |
| 96 | 93 | } |
@@ -124,8 +121,7 @@ discard block |
||
| 124 | 121 | $fields .= sprintf("<th>%s</th>" . PHP_EOL, ucfirst($field->name)); |
| 125 | 122 | $firstIteration = false; |
| 126 | 123 | |
| 127 | - } |
|
| 128 | - else |
|
| 124 | + } else |
|
| 129 | 125 | { |
| 130 | 126 | $fields .= sprintf("\t\t\t<th>%s</th>" . PHP_EOL, ucfirst($field->name)); |
| 131 | 127 | } |
@@ -16,8 +16,7 @@ |
||
| 16 | 16 | if ($fieldData->type->ui == 'text') |
| 17 | 17 | { |
| 18 | 18 | return '{!! Form::text(\'%s\', (isset($model)) ? $model->' . $fieldData->name . ' : null) !!}'; |
| 19 | - } |
|
| 20 | - elseif ($fieldData->type->ui == 'textarea') |
|
| 19 | + } elseif ($fieldData->type->ui == 'textarea') |
|
| 21 | 20 | { |
| 22 | 21 | return '{!! Form::textarea(\'%s\', (isset($model)) ? $model->' . $fieldData->name . ' : null) !!}'; |
| 23 | 22 | } |
@@ -18,33 +18,26 @@ |
||
| 18 | 18 | if (head($path) == 'app') |
| 19 | 19 | { |
| 20 | 20 | $path = app_path(last($path)); |
| 21 | - } |
|
| 22 | - elseif (head($path) == 'base') |
|
| 21 | + } elseif (head($path) == 'base') |
|
| 23 | 22 | { |
| 24 | 23 | $path = base_path(last($path)); |
| 25 | - } |
|
| 26 | - elseif (head($path) == 'config') |
|
| 24 | + } elseif (head($path) == 'config') |
|
| 27 | 25 | { |
| 28 | 26 | $path = config_path(last($path)); |
| 29 | - } |
|
| 30 | - elseif (head($path) == 'database') |
|
| 27 | + } elseif (head($path) == 'database') |
|
| 31 | 28 | { |
| 32 | 29 | $path = database_path(last($path)); |
| 33 | - } |
|
| 34 | - elseif (head($path) == 'public') |
|
| 30 | + } elseif (head($path) == 'public') |
|
| 35 | 31 | { |
| 36 | 32 | $path = public_path(last($path)); |
| 37 | - } |
|
| 38 | - elseif (head($path) == 'storage') |
|
| 33 | + } elseif (head($path) == 'storage') |
|
| 39 | 34 | { |
| 40 | 35 | $path = storage_path(last($path)); |
| 41 | - } |
|
| 42 | - else |
|
| 36 | + } else |
|
| 43 | 37 | { |
| 44 | 38 | $path = head($path); |
| 45 | 39 | } |
| 46 | - } |
|
| 47 | - else |
|
| 40 | + } else |
|
| 48 | 41 | { |
| 49 | 42 | $path = head($path); |
| 50 | 43 | } |
@@ -27,8 +27,11 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | array_walk_recursive($models, function (&$item) |
| 29 | 29 | { |
| 30 | - if ($item == 'true') $item = true; |
|
| 31 | - elseif ($item == 'false') $item = false; |
|
| 30 | + if ($item == 'true') { |
|
| 31 | + $item = true; |
|
| 32 | + } elseif ($item == 'false') { |
|
| 33 | + $item = false; |
|
| 34 | + } |
|
| 32 | 35 | }); |
| 33 | 36 | |
| 34 | 37 | // Generate app.json |
@@ -51,8 +54,11 @@ discard block |
||
| 51 | 54 | |
| 52 | 55 | array_walk_recursive($models, function (&$item) |
| 53 | 56 | { |
| 54 | - if ($item == 'true') $item = true; |
|
| 55 | - elseif ($item == 'false') $item = false; |
|
| 57 | + if ($item == 'true') { |
|
| 58 | + $item = true; |
|
| 59 | + } elseif ($item == 'false') { |
|
| 60 | + $item = false; |
|
| 61 | + } |
|
| 56 | 62 | }); |
| 57 | 63 | |
| 58 | 64 | // Generate app.json |
@@ -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 | { |