@@ -64,168 +64,168 @@ |
||
| 64 | 64 | { |
| 65 | 65 | $this->app->singleton( |
| 66 | 66 | 'artomator.publish', |
| 67 | - function ($app) { |
|
| 67 | + function($app) { |
|
| 68 | 68 | return new GeneratorPublishCommand(); |
| 69 | 69 | } |
| 70 | 70 | ); |
| 71 | 71 | |
| 72 | 72 | $this->app->singleton( |
| 73 | 73 | 'artomator.api', |
| 74 | - function ($app) { |
|
| 74 | + function($app) { |
|
| 75 | 75 | return new APIGeneratorCommand(); |
| 76 | 76 | } |
| 77 | 77 | ); |
| 78 | 78 | |
| 79 | 79 | $this->app->singleton( |
| 80 | 80 | 'artomator.scaffold', |
| 81 | - function ($app) { |
|
| 81 | + function($app) { |
|
| 82 | 82 | return new ScaffoldGeneratorCommand(); |
| 83 | 83 | } |
| 84 | 84 | ); |
| 85 | 85 | |
| 86 | 86 | $this->app->singleton( |
| 87 | 87 | 'artomator.publish.layout', |
| 88 | - function ($app) { |
|
| 88 | + function($app) { |
|
| 89 | 89 | return new LayoutPublishCommand(); |
| 90 | 90 | } |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | 93 | $this->app->singleton( |
| 94 | 94 | 'artomator.publish.templates', |
| 95 | - function ($app) { |
|
| 95 | + function($app) { |
|
| 96 | 96 | return new PublishTemplateCommand(); |
| 97 | 97 | } |
| 98 | 98 | ); |
| 99 | 99 | |
| 100 | 100 | $this->app->singleton( |
| 101 | 101 | 'artomator.api_scaffold', |
| 102 | - function ($app) { |
|
| 102 | + function($app) { |
|
| 103 | 103 | return new APIScaffoldGeneratorCommand(); |
| 104 | 104 | } |
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | 107 | $this->app->singleton( |
| 108 | 108 | 'artomator.migration', |
| 109 | - function ($app) { |
|
| 109 | + function($app) { |
|
| 110 | 110 | return new MigrationGeneratorCommand(); |
| 111 | 111 | } |
| 112 | 112 | ); |
| 113 | 113 | |
| 114 | 114 | $this->app->singleton( |
| 115 | 115 | 'artomator.model', |
| 116 | - function ($app) { |
|
| 116 | + function($app) { |
|
| 117 | 117 | return new ModelGeneratorCommand(); |
| 118 | 118 | } |
| 119 | 119 | ); |
| 120 | 120 | |
| 121 | 121 | $this->app->singleton( |
| 122 | 122 | 'artomator.repository', |
| 123 | - function ($app) { |
|
| 123 | + function($app) { |
|
| 124 | 124 | return new RepositoryGeneratorCommand(); |
| 125 | 125 | } |
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | 128 | $this->app->singleton( |
| 129 | 129 | 'artomator.api.controller', |
| 130 | - function ($app) { |
|
| 130 | + function($app) { |
|
| 131 | 131 | return new APIControllerGeneratorCommand(); |
| 132 | 132 | } |
| 133 | 133 | ); |
| 134 | 134 | |
| 135 | 135 | $this->app->singleton( |
| 136 | 136 | 'artomator.api.requests', |
| 137 | - function ($app) { |
|
| 137 | + function($app) { |
|
| 138 | 138 | return new APIRequestsGeneratorCommand(); |
| 139 | 139 | } |
| 140 | 140 | ); |
| 141 | 141 | |
| 142 | 142 | $this->app->singleton( |
| 143 | 143 | 'artomator.api.tests', |
| 144 | - function ($app) { |
|
| 144 | + function($app) { |
|
| 145 | 145 | return new TestsGeneratorCommand(); |
| 146 | 146 | } |
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | $this->app->singleton( |
| 150 | 150 | 'artomator.scaffold.controller', |
| 151 | - function ($app) { |
|
| 151 | + function($app) { |
|
| 152 | 152 | return new ControllerGeneratorCommand(); |
| 153 | 153 | } |
| 154 | 154 | ); |
| 155 | 155 | |
| 156 | 156 | $this->app->singleton( |
| 157 | 157 | 'artomator.scaffold.requests', |
| 158 | - function ($app) { |
|
| 158 | + function($app) { |
|
| 159 | 159 | return new RequestsGeneratorCommand(); |
| 160 | 160 | } |
| 161 | 161 | ); |
| 162 | 162 | |
| 163 | 163 | $this->app->singleton( |
| 164 | 164 | 'artomator.scaffold.views', |
| 165 | - function ($app) { |
|
| 165 | + function($app) { |
|
| 166 | 166 | return new ViewsGeneratorCommand(); |
| 167 | 167 | } |
| 168 | 168 | ); |
| 169 | 169 | |
| 170 | 170 | $this->app->singleton( |
| 171 | 171 | 'artomator.scaffold.routes', |
| 172 | - function ($app) { |
|
| 172 | + function($app) { |
|
| 173 | 173 | return new RoutesGeneratorCommand(); |
| 174 | 174 | } |
| 175 | 175 | ); |
| 176 | 176 | |
| 177 | 177 | $this->app->singleton( |
| 178 | 178 | 'artomator.rollback', |
| 179 | - function ($app) { |
|
| 179 | + function($app) { |
|
| 180 | 180 | return new RollbackGeneratorCommand(); |
| 181 | 181 | } |
| 182 | 182 | ); |
| 183 | 183 | |
| 184 | 184 | $this->app->singleton( |
| 185 | 185 | 'artomator.publish.user', |
| 186 | - function ($app) { |
|
| 186 | + function($app) { |
|
| 187 | 187 | return new PublishUserCommand(); |
| 188 | 188 | } |
| 189 | 189 | ); |
| 190 | 190 | |
| 191 | 191 | $this->app->singleton( |
| 192 | 192 | 'artomator.graphql', |
| 193 | - function ($app) { |
|
| 193 | + function($app) { |
|
| 194 | 194 | return new GraphQLGeneratorCommand(); |
| 195 | 195 | } |
| 196 | 196 | ); |
| 197 | 197 | |
| 198 | 198 | $this->app->singleton( |
| 199 | 199 | 'artomator.graphql_scaffold', |
| 200 | - function ($app) { |
|
| 200 | + function($app) { |
|
| 201 | 201 | return new GraphQLScaffoldGeneratorCommand(); |
| 202 | 202 | } |
| 203 | 203 | ); |
| 204 | 204 | |
| 205 | 205 | $this->app->singleton( |
| 206 | 206 | 'artomator.graphql.query', |
| 207 | - function ($app) { |
|
| 207 | + function($app) { |
|
| 208 | 208 | return new GraphQLQueryGeneratorCommand(); |
| 209 | 209 | } |
| 210 | 210 | ); |
| 211 | 211 | |
| 212 | 212 | $this->app->singleton( |
| 213 | 213 | 'artomator.graphql.mutations', |
| 214 | - function ($app) { |
|
| 214 | + function($app) { |
|
| 215 | 215 | return new GraphQLMutationsGeneratorCommand(); |
| 216 | 216 | } |
| 217 | 217 | ); |
| 218 | 218 | |
| 219 | 219 | $this->app->singleton( |
| 220 | 220 | 'artomator.graphql.type', |
| 221 | - function ($app) { |
|
| 221 | + function($app) { |
|
| 222 | 222 | return new GraphQLTypeGeneratorCommand(); |
| 223 | 223 | } |
| 224 | 224 | ); |
| 225 | 225 | |
| 226 | 226 | $this->app->singleton( |
| 227 | 227 | 'artomator.graphql.subscription', |
| 228 | - function ($app) { |
|
| 228 | + function($app) { |
|
| 229 | 229 | return new GraphQLSubscriptionGeneratorCommand(); |
| 230 | 230 | } |
| 231 | 231 | ); |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | $prefix = $this->prefixes['ns']; |
| 60 | 60 | |
| 61 | - if (! empty($prefix)) { |
|
| 61 | + if (!empty($prefix)) { |
|
| 62 | 62 | $prefix = '\\'.$prefix; |
| 63 | 63 | } |
| 64 | 64 | $this->nsInterface = config('pwweb.artomator.namespace.interface', 'App\Interfaces').$prefix; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function generate() |
| 35 | 35 | { |
| 36 | - if (! file_exists($this->path)) { |
|
| 36 | + if (!file_exists($this->path)) { |
|
| 37 | 37 | mkdir($this->path, 0755, true); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $tableBodyFields = []; |
| 139 | 139 | |
| 140 | 140 | foreach ($this->commandData->fields as $field) { |
| 141 | - if (! $field->inIndex) { |
|
| 141 | + if (!$field->inIndex) { |
|
| 142 | 142 | continue; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $headerFields = []; |
| 171 | 171 | |
| 172 | 172 | foreach ($this->commandData->fields as $field) { |
| 173 | - if (! $field->inIndex) { |
|
| 173 | + if (!$field->inIndex) { |
|
| 174 | 174 | continue; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -240,14 +240,14 @@ discard block |
||
| 240 | 240 | $this->htmlFields = []; |
| 241 | 241 | |
| 242 | 242 | foreach ($this->commandData->fields as $field) { |
| 243 | - if (! $field->inForm) { |
|
| 243 | + if (!$field->inForm) { |
|
| 244 | 244 | continue; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | $validations = explode('|', $field->validations); |
| 248 | 248 | $minMaxRules = ''; |
| 249 | 249 | foreach ($validations as $validation) { |
| 250 | - if (! Str::contains($validation, ['max:', 'min:'])) { |
|
| 250 | + if (!Str::contains($validation, ['max:', 'min:'])) { |
|
| 251 | 251 | continue; |
| 252 | 252 | } |
| 253 | 253 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $inputArr = explode(',', $field->htmlValues[1]); |
| 271 | 271 | $columns = ''; |
| 272 | 272 | foreach ($inputArr as $item) { |
| 273 | - $columns .= "'$item'".','; //e.g 'email,id,' |
|
| 273 | + $columns .= "'$item'".','; //e.g 'email,id,' |
|
| 274 | 274 | } |
| 275 | 275 | $columns = substr_replace($columns, '', -1); // remove last , |
| 276 | 276 | |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | $tableName = $this->commandData->config->tableName; |
| 285 | 285 | $viewPath = $this->commandData->config->prefixes['view']; |
| 286 | - if (! empty($viewPath)) { |
|
| 286 | + if (!empty($viewPath)) { |
|
| 287 | 287 | $tableName = $viewPath.'.'.$tableName; |
| 288 | 288 | } |
| 289 | 289 | |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $fieldTemplate = $this->generateViewComposer($tableName, $variableName, $columns, $selectTable, $modalName); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - if (! empty($fieldTemplate)) { |
|
| 295 | + if (!empty($fieldTemplate)) { |
|
| 296 | 296 | $fieldTemplate = fill_template_with_field_data( |
| 297 | 297 | $this->commandData->dynamicVars, |
| 298 | 298 | $this->commandData->fieldNamesMapping, |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $fieldsStr = ''; |
| 377 | 377 | |
| 378 | 378 | foreach ($this->commandData->fields as $field) { |
| 379 | - if (! $field->inView) { |
|
| 379 | + if (!$field->inView) { |
|
| 380 | 380 | continue; |
| 381 | 381 | } |
| 382 | 382 | $singleFieldStr = str_replace( |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | 'show_fields.blade.php', |
| 423 | 423 | ]; |
| 424 | 424 | |
| 425 | - if (! empty($views)) { |
|
| 425 | + if (!empty($views)) { |
|
| 426 | 426 | $files = []; |
| 427 | 427 | foreach ($views as $view) { |
| 428 | 428 | $files[] = $view.'.blade.php'; |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | { |
| 30 | 30 | parent::generateCommonItems(); |
| 31 | 31 | |
| 32 | - if (! $this->isSkip('repository') && $this->commandData->getOption('repositoryPattern')) { |
|
| 32 | + if (!$this->isSkip('repository') && $this->commandData->getOption('repositoryPattern')) { |
|
| 33 | 33 | $interfaceGenerator = new InterfaceGenerator($this->commandData); |
| 34 | 34 | $interfaceGenerator->generate(); |
| 35 | 35 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function addViewVariables($views, $variableName, $columns, $tableName, $modelName = null) |
| 54 | 54 | { |
| 55 | - if (! empty($modelName)) { |
|
| 55 | + if (!empty($modelName)) { |
|
| 56 | 56 | $model = $modelName; |
| 57 | 57 | } else { |
| 58 | 58 | $model = model_name_from_table_name($tableName); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $customProviders = strpos($file, $searchFor); |
| 103 | 103 | |
| 104 | 104 | $isExist = strpos($file, "App\Providers\ViewServiceProvider::class"); |
| 105 | - if ($customProviders && ! $isExist) { |
|
| 105 | + if ($customProviders && !$isExist) { |
|
| 106 | 106 | $newChanges = substr_replace( |
| 107 | 107 | $file, |
| 108 | 108 | infy_nl().infy_tab(8).'\App\Providers\ViewServiceProvider::class,', |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $newModelStatement = 'use '.$this->commandData->config->nsInterface.'\\'.$model.'RepositoryInterface as '.$model.';'; |
| 119 | 119 | $isNameSpaceExist = strpos($mainViewContent, $newModelStatement); |
| 120 | 120 | $newModelStatement = infy_nl().$newModelStatement; |
| 121 | - if (! $isNameSpaceExist) { |
|
| 121 | + if (!$isNameSpaceExist) { |
|
| 122 | 122 | preg_match_all('/namespace(.*)/', $mainViewContent, $matches); |
| 123 | 123 | $totalMatches = count($matches[0]); |
| 124 | 124 | $nameSpaceStatement = $matches[0][$totalMatches - 1]; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $length = strlen($newModelStatement); |
| 222 | 222 | $isNameSpaceExist = strpos($mainViewContent, $newModelStatement); |
| 223 | 223 | $newModelStatement = infy_nl().$newModelStatement.infy_nl_tab().'\''.$view.'\','.infy_nl(); |
| 224 | - if (! $isNameSpaceExist) { |
|
| 224 | + if (!$isNameSpaceExist) { |
|
| 225 | 225 | preg_match_all('/selects = \[/', $mainViewContent, $matches); |
| 226 | 226 | $totalMatches = count($matches[0]); |
| 227 | 227 | $nameSpaceStatement = $matches[0][$totalMatches - 1]; |