@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | 8 | use Symfony\Component\Console\Input\InputOption; |
| 9 | 9 | |
| 10 | -#[AsCommand(name: 'magic:repository')] |
|
| 10 | +#[AsCommand(name: 'magic:repository') ] |
|
| 11 | 11 | class MagicRepositoryCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -51,21 +51,21 @@ discard block |
||
| 51 | 51 | protected function buildClass($name) |
| 52 | 52 | { |
| 53 | 53 | $ary = explode("\\", $name); |
| 54 | - $model = $ary[count($ary) - 1]; |
|
| 54 | + $model = $ary[ count($ary) - 1 ]; |
|
| 55 | 55 | $modelVariable = $this->option('variable'); |
| 56 | 56 | $modelUnderScore = $this->option('underscore'); |
| 57 | 57 | $name = "{$name}Repository"; |
| 58 | 58 | |
| 59 | 59 | $stub = str_replace( |
| 60 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 60 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | 63 | $stub = str_replace( |
| 64 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 64 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | return str_replace( |
| 68 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 68 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | } |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | protected function getOptions() |
| 125 | 125 | { |
| 126 | 126 | return [ |
| 127 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists'], |
|
| 128 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this repository class'], |
|
| 129 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this repository class'], |
|
| 127 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists' ], |
|
| 128 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this repository class' ], |
|
| 129 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this repository class' ], |
|
| 130 | 130 | ]; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -141,6 +141,6 @@ discard block |
||
| 141 | 141 | $name = "{$name}Repository"; |
| 142 | 142 | $name = Str::replaceFirst($this->rootNamespace(), '', $name); |
| 143 | 143 | |
| 144 | - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 144 | + return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 145 | 145 | } |
| 146 | 146 | } |
@@ -72,26 +72,26 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $this->handleResourcesPath(); |
| 74 | 74 | |
| 75 | - $this->callSilently("vendor:publish", ["--provider" => "Laragear\TwoFactor\TwoFactorServiceProvider"]); |
|
| 75 | + $this->callSilently("vendor:publish", [ "--provider" => "Laragear\TwoFactor\TwoFactorServiceProvider" ]); |
|
| 76 | 76 | $this->components->info("Laragear TwoFactor migration and config file published"); |
| 77 | 77 | |
| 78 | - $this->callSilently("vendor:publish", ["--provider" => "Spatie\Activitylog\ActivitylogServiceProvider", "--tag" => "activitylog-migrations"]); |
|
| 78 | + $this->callSilently("vendor:publish", [ "--provider" => "Spatie\Activitylog\ActivitylogServiceProvider", "--tag" => "activitylog-migrations" ]); |
|
| 79 | 79 | $this->components->info("Spatie ActivityLog migration and config file published"); |
| 80 | 80 | |
| 81 | - $this->callSilently("vendor:publish", ["--provider" => "Spatie\Permission\PermissionServiceProvider"]); |
|
| 81 | + $this->callSilently("vendor:publish", [ "--provider" => "Spatie\Permission\PermissionServiceProvider" ]); |
|
| 82 | 82 | $this->components->info("Spatie Permissions migration and config file published"); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | private function handleAppActionPath() |
| 86 | 86 | { |
| 87 | - if (! is_dir($directory = app_path('Actions'))) { |
|
| 87 | + if (!is_dir($directory = app_path('Actions'))) { |
|
| 88 | 88 | mkdir($directory, 0755, true); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $filesystem = new Filesystem; |
| 92 | 92 | |
| 93 | 93 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Actions')) |
| 94 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 94 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 95 | 95 | $filesystem->copy( |
| 96 | 96 | $file->getPathname(), |
| 97 | 97 | app_path('Actions/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -103,14 +103,14 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | private function handleAppContractsPath() |
| 105 | 105 | { |
| 106 | - if (! is_dir($directory = app_path('Contracts'))) { |
|
| 106 | + if (!is_dir($directory = app_path('Contracts'))) { |
|
| 107 | 107 | mkdir($directory, 0755, true); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $filesystem = new Filesystem; |
| 111 | 111 | |
| 112 | 112 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Contracts')) |
| 113 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 113 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 114 | 114 | $filesystem->copy( |
| 115 | 115 | $file->getPathname(), |
| 116 | 116 | app_path('Contracts/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -122,14 +122,14 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | private function handleAppEnumsPath() |
| 124 | 124 | { |
| 125 | - if (! is_dir($directory = app_path('Enums'))) { |
|
| 125 | + if (!is_dir($directory = app_path('Enums'))) { |
|
| 126 | 126 | mkdir($directory, 0755, true); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | $filesystem = new Filesystem; |
| 130 | 130 | |
| 131 | 131 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Enums')) |
| 132 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 132 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 133 | 133 | $filesystem->copy( |
| 134 | 134 | $file->getPathname(), |
| 135 | 135 | app_path('Enums/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | private function handleAppEventsPath() |
| 143 | 143 | { |
| 144 | - if (! is_dir($directory = app_path('Events'))) { |
|
| 144 | + if (!is_dir($directory = app_path('Events'))) { |
|
| 145 | 145 | mkdir($directory, 0755, true); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | $filesystem = new Filesystem; |
| 149 | 149 | |
| 150 | 150 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Events')) |
| 151 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 151 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 152 | 152 | $filesystem->copy( |
| 153 | 153 | $file->getPathname(), |
| 154 | 154 | app_path('Events/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -160,14 +160,14 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | private function handleAppExceptionsPath() |
| 162 | 162 | { |
| 163 | - if (! is_dir($directory = app_path('Exceptions'))) { |
|
| 163 | + if (!is_dir($directory = app_path('Exceptions'))) { |
|
| 164 | 164 | mkdir($directory, 0755, true); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $filesystem = new Filesystem; |
| 168 | 168 | |
| 169 | 169 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Exceptions')) |
| 170 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 170 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 171 | 171 | $filesystem->copy( |
| 172 | 172 | $file->getPathname(), |
| 173 | 173 | app_path('Exceptions/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | private function handleAppHttpPath() |
| 181 | 181 | { |
| 182 | - if (! is_dir($directory = app_path('Http'))) { |
|
| 182 | + if (!is_dir($directory = app_path('Http'))) { |
|
| 183 | 183 | mkdir($directory, 0755, true); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | $filesystem = new Filesystem; |
| 187 | 187 | |
| 188 | 188 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Http')) |
| 189 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 189 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 190 | 190 | $filesystem->copy( |
| 191 | 191 | $file->getPathname(), |
| 192 | 192 | app_path('Http/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -198,14 +198,14 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | private function handleAppHttpControllersPath() |
| 200 | 200 | { |
| 201 | - if (! is_dir($directory = app_path('Http/Controllers'))) { |
|
| 201 | + if (!is_dir($directory = app_path('Http/Controllers'))) { |
|
| 202 | 202 | mkdir($directory, 0755, true); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $filesystem = new Filesystem; |
| 206 | 206 | |
| 207 | 207 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Controllers')) |
| 208 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 208 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 209 | 209 | $filesystem->copy( |
| 210 | 210 | $file->getPathname(), |
| 211 | 211 | app_path('Http/Controllers/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -217,14 +217,14 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | private function handleAppHttpControllersAuthPath() |
| 219 | 219 | { |
| 220 | - if (! is_dir($directory = app_path('Http/Controllers/Auth'))) { |
|
| 220 | + if (!is_dir($directory = app_path('Http/Controllers/Auth'))) { |
|
| 221 | 221 | mkdir($directory, 0755, true); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | $filesystem = new Filesystem; |
| 225 | 225 | |
| 226 | 226 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/AuthControllers')) |
| 227 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 227 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 228 | 228 | $filesystem->copy( |
| 229 | 229 | $file->getPathname(), |
| 230 | 230 | app_path('Http/Controllers/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -236,14 +236,14 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | private function handleAppHttpMiddlewarePath() |
| 238 | 238 | { |
| 239 | - if (! is_dir($directory = app_path('Http/Middleware'))) { |
|
| 239 | + if (!is_dir($directory = app_path('Http/Middleware'))) { |
|
| 240 | 240 | mkdir($directory, 0755, true); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | $filesystem = new Filesystem; |
| 244 | 244 | |
| 245 | 245 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Middleware')) |
| 246 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 246 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 247 | 247 | $filesystem->copy( |
| 248 | 248 | $file->getPathname(), |
| 249 | 249 | app_path('Http/Middleware/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -255,14 +255,14 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | private function handleAppHttpRequestsPath() |
| 257 | 257 | { |
| 258 | - if (! is_dir($directory = app_path('Http/Requests'))) { |
|
| 258 | + if (!is_dir($directory = app_path('Http/Requests'))) { |
|
| 259 | 259 | mkdir($directory, 0755, true); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | $filesystem = new Filesystem; |
| 263 | 263 | |
| 264 | 264 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Requests')) |
| 265 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 265 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 266 | 266 | $filesystem->copy( |
| 267 | 267 | $file->getPathname(), |
| 268 | 268 | app_path('Http/Requests/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -274,14 +274,14 @@ discard block |
||
| 274 | 274 | |
| 275 | 275 | private function handleAppHttpRequestsAuthPath() |
| 276 | 276 | { |
| 277 | - if (! is_dir($directory = app_path('Http/Requests/Auth'))) { |
|
| 277 | + if (!is_dir($directory = app_path('Http/Requests/Auth'))) { |
|
| 278 | 278 | mkdir($directory, 0755, true); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | $filesystem = new Filesystem; |
| 282 | 282 | |
| 283 | 283 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/AuthRequests')) |
| 284 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 284 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 285 | 285 | $filesystem->copy( |
| 286 | 286 | $file->getPathname(), |
| 287 | 287 | app_path('Http/Requests/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -293,14 +293,14 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | private function handleAppListenersPath() |
| 295 | 295 | { |
| 296 | - if (! is_dir($directory = app_path('Listeners'))) { |
|
| 296 | + if (!is_dir($directory = app_path('Listeners'))) { |
|
| 297 | 297 | mkdir($directory, 0755, true); |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | $filesystem = new Filesystem; |
| 301 | 301 | |
| 302 | 302 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Listeners')) |
| 303 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 303 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 304 | 304 | $filesystem->copy( |
| 305 | 305 | $file->getPathname(), |
| 306 | 306 | app_path('Listeners/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -312,14 +312,14 @@ discard block |
||
| 312 | 312 | |
| 313 | 313 | private function handleAppModelsPath() |
| 314 | 314 | { |
| 315 | - if (! is_dir($directory = app_path('Models'))) { |
|
| 315 | + if (!is_dir($directory = app_path('Models'))) { |
|
| 316 | 316 | mkdir($directory, 0755, true); |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | $filesystem = new Filesystem; |
| 320 | 320 | |
| 321 | 321 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Models')) |
| 322 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 322 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 323 | 323 | $filesystem->copy( |
| 324 | 324 | $file->getPathname(), |
| 325 | 325 | app_path('Models/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -331,14 +331,14 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | private function handleAppModelsScopesPath() |
| 333 | 333 | { |
| 334 | - if (! is_dir($directory = app_path('Models/Scopes'))) { |
|
| 334 | + if (!is_dir($directory = app_path('Models/Scopes'))) { |
|
| 335 | 335 | mkdir($directory, 0755, true); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | $filesystem = new Filesystem; |
| 339 | 339 | |
| 340 | 340 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/ModelsScopes')) |
| 341 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 341 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 342 | 342 | $filesystem->copy( |
| 343 | 343 | $file->getPathname(), |
| 344 | 344 | app_path('Models/Scopes/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -350,14 +350,14 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | private function handleAppNotificationsPath() |
| 352 | 352 | { |
| 353 | - if (! is_dir($directory = app_path('Notifications'))) { |
|
| 353 | + if (!is_dir($directory = app_path('Notifications'))) { |
|
| 354 | 354 | mkdir($directory, 0755, true); |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | $filesystem = new Filesystem; |
| 358 | 358 | |
| 359 | 359 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Notifications')) |
| 360 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 360 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 361 | 361 | $filesystem->copy( |
| 362 | 362 | $file->getPathname(), |
| 363 | 363 | app_path('Notifications/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -369,14 +369,14 @@ discard block |
||
| 369 | 369 | |
| 370 | 370 | private function handleAppProvidersPath() |
| 371 | 371 | { |
| 372 | - if (! is_dir($directory = app_path('Providers'))) { |
|
| 372 | + if (!is_dir($directory = app_path('Providers'))) { |
|
| 373 | 373 | mkdir($directory, 0755, true); |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | $filesystem = new Filesystem; |
| 377 | 377 | |
| 378 | 378 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Providers')) |
| 379 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 379 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 380 | 380 | $filesystem->copy( |
| 381 | 381 | $file->getPathname(), |
| 382 | 382 | app_path('Providers/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -388,14 +388,14 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | private function handleAppRepositoriesPath() |
| 390 | 390 | { |
| 391 | - if (! is_dir($directory = app_path('Repositories'))) { |
|
| 391 | + if (!is_dir($directory = app_path('Repositories'))) { |
|
| 392 | 392 | mkdir($directory, 0755, true); |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | $filesystem = new Filesystem; |
| 396 | 396 | |
| 397 | 397 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Repositories')) |
| 398 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 398 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 399 | 399 | $filesystem->copy( |
| 400 | 400 | $file->getPathname(), |
| 401 | 401 | app_path('Repositories/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -407,14 +407,14 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | private function handleAppRulesPath() |
| 409 | 409 | { |
| 410 | - if (! is_dir($directory = app_path('Rules'))) { |
|
| 410 | + if (!is_dir($directory = app_path('Rules'))) { |
|
| 411 | 411 | mkdir($directory, 0755, true); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | $filesystem = new Filesystem; |
| 415 | 415 | |
| 416 | 416 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Rules')) |
| 417 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 417 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 418 | 418 | $filesystem->copy( |
| 419 | 419 | $file->getPathname(), |
| 420 | 420 | app_path('Rules/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -426,14 +426,14 @@ discard block |
||
| 426 | 426 | |
| 427 | 427 | private function handleAppServicesPath() |
| 428 | 428 | { |
| 429 | - if (! is_dir($directory = app_path('Services'))) { |
|
| 429 | + if (!is_dir($directory = app_path('Services'))) { |
|
| 430 | 430 | mkdir($directory, 0755, true); |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | $filesystem = new Filesystem; |
| 434 | 434 | |
| 435 | 435 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Services')) |
| 436 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 436 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 437 | 437 | $filesystem->copy( |
| 438 | 438 | $file->getPathname(), |
| 439 | 439 | app_path('Services/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -445,14 +445,14 @@ discard block |
||
| 445 | 445 | |
| 446 | 446 | private function handleAppServicesAuthPath() |
| 447 | 447 | { |
| 448 | - if (! is_dir($directory = app_path('Services/Auth'))) { |
|
| 448 | + if (!is_dir($directory = app_path('Services/Auth'))) { |
|
| 449 | 449 | mkdir($directory, 0755, true); |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | $filesystem = new Filesystem; |
| 453 | 453 | |
| 454 | 454 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/AuthServices')) |
| 455 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 455 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 456 | 456 | $filesystem->copy( |
| 457 | 457 | $file->getPathname(), |
| 458 | 458 | app_path('Services/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -464,14 +464,14 @@ discard block |
||
| 464 | 464 | |
| 465 | 465 | private function handleAppTraitsPath() |
| 466 | 466 | { |
| 467 | - if (! is_dir($directory = app_path('Traits'))) { |
|
| 467 | + if (!is_dir($directory = app_path('Traits'))) { |
|
| 468 | 468 | mkdir($directory, 0755, true); |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | $filesystem = new Filesystem; |
| 472 | 472 | |
| 473 | 473 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Traits')) |
| 474 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 474 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 475 | 475 | $filesystem->copy( |
| 476 | 476 | $file->getPathname(), |
| 477 | 477 | app_path('Traits/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -483,14 +483,14 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | private function handleConfigPath() |
| 485 | 485 | { |
| 486 | - if (! is_dir($directory = base_path('config'))) { |
|
| 486 | + if (!is_dir($directory = base_path('config'))) { |
|
| 487 | 487 | mkdir($directory, 0755, true); |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | $filesystem = new Filesystem; |
| 491 | 491 | |
| 492 | 492 | collect($filesystem->allFiles(__DIR__.'/stubs/init/config')) |
| 493 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 493 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 494 | 494 | $filesystem->copy( |
| 495 | 495 | $file->getPathname(), |
| 496 | 496 | base_path('config/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -502,18 +502,18 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | private function handleDatabasePath() |
| 504 | 504 | { |
| 505 | - if (! is_dir($directory = base_path('database/factories'))) { |
|
| 505 | + if (!is_dir($directory = base_path('database/factories'))) { |
|
| 506 | 506 | mkdir($directory, 0755, true); |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | - if (! is_dir($directory = base_path('database/migrations'))) { |
|
| 509 | + if (!is_dir($directory = base_path('database/migrations'))) { |
|
| 510 | 510 | mkdir($directory, 0755, true); |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | $filesystem = new Filesystem; |
| 514 | 514 | |
| 515 | 515 | collect($filesystem->allFiles(__DIR__.'/stubs/init/database/factories')) |
| 516 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 516 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 517 | 517 | $filesystem->copy( |
| 518 | 518 | $file->getPathname(), |
| 519 | 519 | base_path('database/factories/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | $this->components->info('database/factories files scaffolding generated successfully.'); |
| 524 | 524 | |
| 525 | 525 | collect($filesystem->allFiles(__DIR__.'/stubs/init/database/migrations')) |
| 526 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 526 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 527 | 527 | $filesystem->copy( |
| 528 | 528 | $file->getPathname(), |
| 529 | 529 | base_path('database/migrations/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -535,14 +535,14 @@ discard block |
||
| 535 | 535 | |
| 536 | 536 | private function handleLangPath() |
| 537 | 537 | { |
| 538 | - if (! is_dir($directory = base_path('lang/en'))) { |
|
| 538 | + if (!is_dir($directory = base_path('lang/en'))) { |
|
| 539 | 539 | mkdir($directory, 0755, true); |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | $filesystem = new Filesystem; |
| 543 | 543 | |
| 544 | 544 | collect($filesystem->allFiles(__DIR__.'/stubs/init/lang/en')) |
| 545 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 545 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 546 | 546 | $filesystem->copy( |
| 547 | 547 | $file->getPathname(), |
| 548 | 548 | base_path('lang/en/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -555,14 +555,14 @@ discard block |
||
| 555 | 555 | private function handleRoutesPath() |
| 556 | 556 | { |
| 557 | 557 | |
| 558 | - if (! is_dir($directory = base_path('routes/app'))) { |
|
| 558 | + if (!is_dir($directory = base_path('routes/app'))) { |
|
| 559 | 559 | mkdir($directory, 0755, true); |
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | $filesystem = new Filesystem; |
| 563 | 563 | |
| 564 | 564 | collect($filesystem->allFiles(__DIR__.'/stubs/init/routes/app')) |
| 565 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 565 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 566 | 566 | $filesystem->copy( |
| 567 | 567 | $file->getPathname(), |
| 568 | 568 | base_path('routes/app/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -588,14 +588,14 @@ discard block |
||
| 588 | 588 | |
| 589 | 589 | private function handleTestsPath() |
| 590 | 590 | { |
| 591 | - if (! is_dir($directory = base_path('tests/Feature'))) { |
|
| 591 | + if (!is_dir($directory = base_path('tests/Feature'))) { |
|
| 592 | 592 | mkdir($directory, 0755, true); |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | $filesystem = new Filesystem; |
| 596 | 596 | |
| 597 | 597 | collect($filesystem->allFiles(__DIR__.'/stubs/init/tests/Feature')) |
| 598 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 598 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 599 | 599 | $filesystem->copy( |
| 600 | 600 | $file->getPathname(), |
| 601 | 601 | base_path('tests/Feature/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -607,26 +607,26 @@ discard block |
||
| 607 | 607 | |
| 608 | 608 | private function handleResourcesPath() |
| 609 | 609 | { |
| 610 | - if (! is_dir($directory = base_path('resources/views/layouts'))) { |
|
| 610 | + if (!is_dir($directory = base_path('resources/views/layouts'))) { |
|
| 611 | 611 | mkdir($directory, 0755, true); |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | - if (! is_dir($directory = base_path('resources/views/passwords'))) { |
|
| 614 | + if (!is_dir($directory = base_path('resources/views/passwords'))) { |
|
| 615 | 615 | mkdir($directory, 0755, true); |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | - if (! is_dir($directory = base_path('resources/views/socialite'))) { |
|
| 618 | + if (!is_dir($directory = base_path('resources/views/socialite'))) { |
|
| 619 | 619 | mkdir($directory, 0755, true); |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | - if (! is_dir($directory = base_path('resources/views/twofactor'))) { |
|
| 622 | + if (!is_dir($directory = base_path('resources/views/twofactor'))) { |
|
| 623 | 623 | mkdir($directory, 0755, true); |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | $filesystem = new Filesystem; |
| 627 | 627 | |
| 628 | 628 | collect($filesystem->allFiles(__DIR__.'/stubs/init/resources/views/layouts')) |
| 629 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 629 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 630 | 630 | $filesystem->copy( |
| 631 | 631 | $file->getPathname(), |
| 632 | 632 | base_path('resources/views/layouts/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | $this->components->info('resources/views/layouts files scaffolding generated successfully.'); |
| 637 | 637 | |
| 638 | 638 | collect($filesystem->allFiles(__DIR__.'/stubs/init/resources/views/passwords')) |
| 639 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 639 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 640 | 640 | $filesystem->copy( |
| 641 | 641 | $file->getPathname(), |
| 642 | 642 | base_path('resources/views/passwords/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $this->components->info('resources/views/passwords files scaffolding generated successfully.'); |
| 647 | 647 | |
| 648 | 648 | collect($filesystem->allFiles(__DIR__.'/stubs/init/resources/views/socialite')) |
| 649 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 649 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 650 | 650 | $filesystem->copy( |
| 651 | 651 | $file->getPathname(), |
| 652 | 652 | base_path('resources/views/socialite/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | $this->components->info('resources/views/socialite files scaffolding generated successfully.'); |
| 657 | 657 | |
| 658 | 658 | collect($filesystem->allFiles(__DIR__.'/stubs/init/resources/views/twofactor')) |
| 659 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
| 659 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
| 660 | 660 | $filesystem->copy( |
| 661 | 661 | $file->getPathname(), |
| 662 | 662 | base_path('resources/views/twofactor/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | use Symfony\Component\Console\Attribute\AsCommand; |
| 11 | 11 | use Symfony\Component\Console\Input\InputOption; |
| 12 | 12 | |
| 13 | -#[AsCommand(name: 'magic:api')] |
|
| 13 | +#[AsCommand(name: 'magic:api') ] |
|
| 14 | 14 | class MagicApiCommand extends GeneratorCommand |
| 15 | 15 | { |
| 16 | 16 | /** |
@@ -59,15 +59,15 @@ discard block |
||
| 59 | 59 | $name = "{$name}Api"; |
| 60 | 60 | |
| 61 | 61 | $stub = str_replace( |
| 62 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 62 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 63 | 63 | ); |
| 64 | 64 | |
| 65 | 65 | $stub = str_replace( |
| 66 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 66 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 67 | 67 | ); |
| 68 | 68 | |
| 69 | 69 | return str_replace( |
| 70 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 70 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 71 | 71 | ); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | protected function getOptions() |
| 115 | 115 | { |
| 116 | 116 | return [ |
| 117 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the api already exists'], |
|
| 118 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this api class'], |
|
| 119 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this api class'], |
|
| 117 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the api already exists' ], |
|
| 118 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this api class' ], |
|
| 119 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this api class' ], |
|
| 120 | 120 | ]; |
| 121 | 121 | } |
| 122 | 122 | |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | 8 | use Symfony\Component\Console\Input\InputOption; |
| 9 | 9 | |
| 10 | -#[AsCommand(name: 'magic:contract')] |
|
| 10 | +#[AsCommand(name: 'magic:contract') ] |
|
| 11 | 11 | class MagicContractCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -51,21 +51,21 @@ discard block |
||
| 51 | 51 | protected function buildClass($name) |
| 52 | 52 | { |
| 53 | 53 | $ary = explode("\\", $name); |
| 54 | - $model = $ary[count($ary) - 1]; |
|
| 54 | + $model = $ary[ count($ary) - 1 ]; |
|
| 55 | 55 | $modelVariable = $this->option('variable'); |
| 56 | 56 | $modelUnderScore = $this->option('underscore'); |
| 57 | 57 | $name = "{$name}Contract"; |
| 58 | 58 | |
| 59 | 59 | $stub = str_replace( |
| 60 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 60 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | 63 | $stub = str_replace( |
| 64 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 64 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | return str_replace( |
| 68 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 68 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | } |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | protected function getOptions() |
| 125 | 125 | { |
| 126 | 126 | return [ |
| 127 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the contract already exists'], |
|
| 128 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this contract class'], |
|
| 129 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this contract class'], |
|
| 127 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the contract already exists' ], |
|
| 128 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this contract class' ], |
|
| 129 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this contract class' ], |
|
| 130 | 130 | ]; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -141,6 +141,6 @@ discard block |
||
| 141 | 141 | $name = "{$name}Contract"; |
| 142 | 142 | $name = Str::replaceFirst($this->rootNamespace(), '', $name); |
| 143 | 143 | |
| 144 | - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 144 | + return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 145 | 145 | } |
| 146 | 146 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | 8 | use Symfony\Component\Console\Input\InputOption; |
| 9 | 9 | |
| 10 | -#[AsCommand(name: 'magic:model')] |
|
| 10 | +#[AsCommand(name: 'magic:model') ] |
|
| 11 | 11 | class MagicModelCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -51,56 +51,56 @@ discard block |
||
| 51 | 51 | protected function buildClass($name) |
| 52 | 52 | { |
| 53 | 53 | $ary = explode("\\", $name); |
| 54 | - $model = $ary[count($ary) - 1]; |
|
| 54 | + $model = $ary[ count($ary) - 1 ]; |
|
| 55 | 55 | $modelVariable = lcfirst($model); |
| 56 | 56 | $modelUnderScore = Str::snake($modelVariable); |
| 57 | 57 | |
| 58 | - $this->callSilently("make:migration", ['name' => "create_{$modelUnderScore}s_table"]); |
|
| 58 | + $this->callSilently("make:migration", [ 'name' => "create_{$modelUnderScore}s_table" ]); |
|
| 59 | 59 | $this->components->info("Migration scaffolding for {$model} model generated successfully."); |
| 60 | 60 | |
| 61 | - $this->callSilently("magic:contract", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 61 | + $this->callSilently("magic:contract", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 62 | 62 | $this->components->info("Magic contract scaffolding for {$model} model generated successfully."); |
| 63 | 63 | |
| 64 | - $this->callSilently("magic:repository", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 64 | + $this->callSilently("magic:repository", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 65 | 65 | $this->components->info("Magic repository scaffolding for {$model} model generated successfully."); |
| 66 | 66 | |
| 67 | - $this->callSilently("magic:service", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 67 | + $this->callSilently("magic:service", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 68 | 68 | $this->components->info("Magic service scaffolding for {$model} model generated successfully."); |
| 69 | 69 | |
| 70 | - $this->callSilently("magic:controller", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 70 | + $this->callSilently("magic:controller", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 71 | 71 | $this->components->info("Magic controller scaffolding for {$model} model generated successfully."); |
| 72 | 72 | |
| 73 | - $this->callSilently("magic:createRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 73 | + $this->callSilently("magic:createRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 74 | 74 | $this->components->info("Magic create request scaffolding for {$model} model generated successfully."); |
| 75 | 75 | |
| 76 | - $this->callSilently("magic:updateRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 76 | + $this->callSilently("magic:updateRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 77 | 77 | $this->components->info("Magic update request scaffolding for {$model} model generated successfully."); |
| 78 | 78 | |
| 79 | - $this->callSilently("magic:deleteRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 79 | + $this->callSilently("magic:deleteRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 80 | 80 | $this->components->info("Magic delete request scaffolding for {$model} model generated successfully."); |
| 81 | 81 | |
| 82 | - $this->callSilently("magic:readRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 82 | + $this->callSilently("magic:readRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 83 | 83 | $this->components->info("Magic read request scaffolding for {$model} model generated successfully."); |
| 84 | 84 | |
| 85 | - $this->callSilently("magic:api", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 85 | + $this->callSilently("magic:api", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 86 | 86 | $this->components->info("Magic api route scaffolding for {$model} model generated successfully."); |
| 87 | 87 | |
| 88 | - $this->callSilently("magic:test", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 88 | + $this->callSilently("magic:test", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 89 | 89 | $this->components->info("Magic test scaffolding for {$model} model generated successfully."); |
| 90 | 90 | |
| 91 | - $this->callSilently("magic:factory", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]); |
|
| 91 | + $this->callSilently("magic:factory", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]); |
|
| 92 | 92 | $this->components->info("Magic factory scaffolding for {$model} model generated successfully."); |
| 93 | 93 | |
| 94 | 94 | $stub = str_replace( |
| 95 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 95 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 96 | 96 | ); |
| 97 | 97 | |
| 98 | 98 | $stub = str_replace( |
| 99 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 99 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 100 | 100 | ); |
| 101 | 101 | |
| 102 | 102 | return str_replace( |
| 103 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 103 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 104 | 104 | ); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | protected function getOptions() |
| 159 | 159 | { |
| 160 | 160 | return [ |
| 161 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the model already exists'], |
|
| 161 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the model already exists' ], |
|
| 162 | 162 | ]; |
| 163 | 163 | } |
| 164 | 164 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | 8 | use Symfony\Component\Console\Input\InputOption; |
| 9 | 9 | |
| 10 | -#[AsCommand(name: 'magic:controller')] |
|
| 10 | +#[AsCommand(name: 'magic:controller') ] |
|
| 11 | 11 | class MagicControllerCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | $modelUnderScore = $this->option('underscore'); |
| 56 | 56 | |
| 57 | 57 | $stub = str_replace( |
| 58 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 58 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | $stub = str_replace( |
| 62 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 62 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 63 | 63 | ); |
| 64 | 64 | |
| 65 | 65 | return str_replace( |
| 66 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 66 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 67 | 67 | ); |
| 68 | 68 | |
| 69 | 69 | } |
@@ -122,9 +122,9 @@ discard block |
||
| 122 | 122 | protected function getOptions() |
| 123 | 123 | { |
| 124 | 124 | return [ |
| 125 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the controller already exists'], |
|
| 126 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this controller class'], |
|
| 127 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this controller class'], |
|
| 125 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the controller already exists' ], |
|
| 126 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this controller class' ], |
|
| 127 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this controller class' ], |
|
| 128 | 128 | ]; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -139,6 +139,6 @@ discard block |
||
| 139 | 139 | $name = "{$name}Controller"; |
| 140 | 140 | $name = Str::replaceFirst($this->rootNamespace(), '', $name); |
| 141 | 141 | |
| 142 | - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 142 | + return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 143 | 143 | } |
| 144 | 144 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | 8 | use Symfony\Component\Console\Input\InputOption; |
| 9 | 9 | |
| 10 | -#[AsCommand(name: 'magic:createRequest')] |
|
| 10 | +#[AsCommand(name: 'magic:createRequest') ] |
|
| 11 | 11 | class MagicCreateRequestCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -56,15 +56,15 @@ discard block |
||
| 56 | 56 | $name = "{$name}CreateRequest"; |
| 57 | 57 | |
| 58 | 58 | $stub = str_replace( |
| 59 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 59 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 60 | 60 | ); |
| 61 | 61 | |
| 62 | 62 | $stub = str_replace( |
| 63 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 63 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | 66 | return str_replace( |
| 67 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 67 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | 70 | } |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | protected function getOptions() |
| 124 | 124 | { |
| 125 | 125 | return [ |
| 126 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the request already exists'], |
|
| 127 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this request class'], |
|
| 128 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this request class'], |
|
| 126 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the request already exists' ], |
|
| 127 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this request class' ], |
|
| 128 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this request class' ], |
|
| 129 | 129 | ]; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -140,6 +140,6 @@ discard block |
||
| 140 | 140 | $name = "{$name}CreateRequest"; |
| 141 | 141 | $name = Str::replaceFirst($this->rootNamespace(), '', $name); |
| 142 | 142 | |
| 143 | - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 143 | + return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | 8 | use Symfony\Component\Console\Input\InputOption; |
| 9 | 9 | |
| 10 | -#[AsCommand(name: 'magic:updateRequest')] |
|
| 10 | +#[AsCommand(name: 'magic:updateRequest') ] |
|
| 11 | 11 | class MagicUpdateRequestCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -56,15 +56,15 @@ discard block |
||
| 56 | 56 | $name = "{$name}UpdateRequest"; |
| 57 | 57 | |
| 58 | 58 | $stub = str_replace( |
| 59 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 59 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 60 | 60 | ); |
| 61 | 61 | |
| 62 | 62 | $stub = str_replace( |
| 63 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 63 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | 66 | return str_replace( |
| 67 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 67 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | 70 | } |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | protected function getOptions() |
| 124 | 124 | { |
| 125 | 125 | return [ |
| 126 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the request already exists'], |
|
| 127 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this request class'], |
|
| 128 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this request class'], |
|
| 126 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the request already exists' ], |
|
| 127 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this request class' ], |
|
| 128 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this request class' ], |
|
| 129 | 129 | ]; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -140,6 +140,6 @@ discard block |
||
| 140 | 140 | $name = "{$name}UpdateRequest"; |
| 141 | 141 | $name = Str::replaceFirst($this->rootNamespace(), '', $name); |
| 142 | 142 | |
| 143 | - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 143 | + return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | 8 | use Symfony\Component\Console\Input\InputOption; |
| 9 | 9 | |
| 10 | -#[AsCommand(name: 'magic:factory')] |
|
| 10 | +#[AsCommand(name: 'magic:factory') ] |
|
| 11 | 11 | class MagicFactoryCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -51,21 +51,21 @@ discard block |
||
| 51 | 51 | protected function buildClass($name) |
| 52 | 52 | { |
| 53 | 53 | $ary = explode("\\", $name); |
| 54 | - $model = $ary[count($ary) - 1]; |
|
| 54 | + $model = $ary[ count($ary) - 1 ]; |
|
| 55 | 55 | $modelVariable = $this->option('variable'); |
| 56 | 56 | $modelUnderScore = $this->option('underscore'); |
| 57 | 57 | $name = "{$name}Factory"; |
| 58 | 58 | |
| 59 | 59 | $stub = str_replace( |
| 60 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 60 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | 63 | $stub = str_replace( |
| 64 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
| 64 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | return str_replace( |
| 68 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
| 68 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | } |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | protected function getOptions() |
| 125 | 125 | { |
| 126 | 126 | return [ |
| 127 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the factory already exists'], |
|
| 128 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this factory class'], |
|
| 129 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this factory class'], |
|
| 127 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the factory already exists' ], |
|
| 128 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this factory class' ], |
|
| 129 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this factory class' ], |
|
| 130 | 130 | ]; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | protected function getPath($name) |
| 140 | 140 | { |
| 141 | 141 | $ary = explode("\\", $name); |
| 142 | - $name = $ary[count($ary) - 1]; |
|
| 142 | + $name = $ary[ count($ary) - 1 ]; |
|
| 143 | 143 | |
| 144 | 144 | return base_path("database/factories/{$name}Factory.php"); |
| 145 | 145 | } |