@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | protected $pluralizedEntity; |
| 18 | 18 | protected $requestStoreName; |
| 19 | 19 | protected $requestUpdateName; |
| 20 | - protected $additionalSteps = []; |
|
| 21 | - protected $tableContents = []; |
|
| 22 | - protected $tableHeaders = ['Artefact', 'Filename and/or Location']; |
|
| 20 | + protected $additionalSteps = [ ]; |
|
| 21 | + protected $tableContents = [ ]; |
|
| 22 | + protected $tableHeaders = [ 'Artefact', 'Filename and/or Location' ]; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * The name and signature of the console command. |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | $this->addToTable('Model', $this->modelNamespace.'/'.$this->modelName); |
| 192 | 192 | |
| 193 | - $this->info($this->data['artefact'].' created.'); |
|
| 193 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -203,12 +203,12 @@ discard block |
||
| 203 | 203 | $path = app_path(config('entity.model.custom_base_directory')); |
| 204 | 204 | $file = $path.'/'.config('entity.model.custom_base_name').'.php'; |
| 205 | 205 | |
| 206 | - if (! $this->files->exists($file)) { |
|
| 206 | + if (!$this->files->exists($file)) { |
|
| 207 | 207 | $stub = $this->files->get(__DIR__.'/stubs/model.base.custom.stub'); |
| 208 | 208 | |
| 209 | 209 | $classNamepace = 'App'; |
| 210 | 210 | |
| 211 | - if (! empty(config('entity.model.custom_base_directory'))) { |
|
| 211 | + if (!empty(config('entity.model.custom_base_directory'))) { |
|
| 212 | 212 | $classNamepace .= '\\'.config('entity.model.custom_base_directory'); |
| 213 | 213 | } |
| 214 | 214 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | $customBaseModelNamepace = ''; |
| 253 | 253 | |
| 254 | - if (! empty(config('entity.model.custom_base_directory'))) { |
|
| 254 | + if (!empty(config('entity.model.custom_base_directory'))) { |
|
| 255 | 255 | $customBaseModelNamepace = config('entity.model.custom_base_directory').'\\'; |
| 256 | 256 | } |
| 257 | 257 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | $this->addToTable('Migration', $migration.'.php'); |
| 290 | 290 | |
| 291 | - $this->info($this->data['artefact'].' created.'); |
|
| 291 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | if ($this->option('request')) { |
| 461 | - $this->info($this->data['artefact'].' created.'); |
|
| 461 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | } |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | if ($this->option('controller')) { |
| 551 | - $this->info($this->data['artefact'].' created.'); |
|
| 551 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 552 | 552 | } |
| 553 | 553 | } |
| 554 | 554 | } |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | |
| 614 | 614 | $this->addToTable('Factory', $factory.'.php'); |
| 615 | 615 | |
| 616 | - $this->info($this->data['artefact'].' created.'); |
|
| 616 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 617 | 617 | } |
| 618 | 618 | } |
| 619 | 619 | |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | |
| 662 | 662 | $this->addToTable('Policy', $policy.'.php'); |
| 663 | 663 | |
| 664 | - $this->info($this->data['artefact'].' created.'); |
|
| 664 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 665 | 665 | |
| 666 | 666 | array_push($this->additionalSteps, 'Register the Policy'); |
| 667 | 667 | } |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | |
| 695 | 695 | $this->addToTable('Table Seeder', $seederTable); |
| 696 | 696 | |
| 697 | - $this->info($this->data['artefact'].' created.'); |
|
| 697 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 698 | 698 | |
| 699 | 699 | array_push($this->additionalSteps, 'Call the Table Seeder in DatabaseSeeder'); |
| 700 | 700 | } |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | |
| 722 | 722 | $this->addToTable('Dummy Seeder', config('entity.dummy.dummies').$seederDummy); |
| 723 | 723 | |
| 724 | - $this->info($this->data['artefact'].' created.'); |
|
| 724 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 725 | 725 | |
| 726 | 726 | array_push($this->additionalSteps, 'Call the Dummy seeder in DummyDataSeeder'); |
| 727 | 727 | } |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | */ |
| 759 | 759 | protected function makeDummyDataSeeder() |
| 760 | 760 | { |
| 761 | - if (! $this->files->exists( |
|
| 761 | + if (!$this->files->exists( |
|
| 762 | 762 | $path = database_path('seeds/DummyDataSeeder.php') |
| 763 | 763 | )) { |
| 764 | 764 | $stub = $this->files->get(__DIR__.'/stubs/dataseeder.dummy.stub'); |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | |
| 795 | 795 | $this->addToTable('Test: Feature', 'Feature/'.$test.'.php'); |
| 796 | 796 | |
| 797 | - $this->info($this->data['artefact'].' created.'); |
|
| 797 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 800 | /** Unit test */ |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | |
| 815 | 815 | $this->addToTable('Test: Unit', 'Unit/'.$test.'.php'); |
| 816 | 816 | |
| 817 | - $this->info($this->data['artefact'].' created.'); |
|
| 817 | + $this->info($this->data[ 'artefact' ].' created.'); |
|
| 818 | 818 | } |
| 819 | 819 | } |
| 820 | 820 | } |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | */ |
| 828 | 828 | protected function makeDirectory($path) |
| 829 | 829 | { |
| 830 | - if (! $this->files->isDirectory(dirname($path))) { |
|
| 830 | + if (!$this->files->isDirectory(dirname($path))) { |
|
| 831 | 831 | $this->files->makeDirectory(dirname($path), 0777, true, true); |
| 832 | 832 | } |
| 833 | 833 | } |
@@ -892,8 +892,8 @@ discard block |
||
| 892 | 892 | */ |
| 893 | 893 | protected function addToTable($artefact, $location) |
| 894 | 894 | { |
| 895 | - $this->data['artefact'] = $artefact; |
|
| 896 | - $this->data['location'] = $location; |
|
| 895 | + $this->data[ 'artefact' ] = $artefact; |
|
| 896 | + $this->data[ 'location' ] = $location; |
|
| 897 | 897 | |
| 898 | 898 | array_push($this->tableContents, $this->data); |
| 899 | 899 | } |
@@ -160,8 +160,7 @@ discard block |
||
| 160 | 160 | 'Use existing model', |
| 161 | 161 | 'Abort' |
| 162 | 162 | ]); |
| 163 | - } |
|
| 164 | - else { |
|
| 163 | + } else { |
|
| 165 | 164 | $this->makeDirectory($this->modelFullPath); |
| 166 | 165 | |
| 167 | 166 | $modelChoice = 'No model'; |
@@ -181,8 +180,7 @@ discard block |
||
| 181 | 180 | { |
| 182 | 181 | if (config('entity.model.should_use_default_base') === true) { |
| 183 | 182 | $this->compileModelStub($this->modelFullPath); |
| 184 | - } |
|
| 185 | - else { |
|
| 183 | + } else { |
|
| 186 | 184 | $this->makeCustomBaseModel(); |
| 187 | 185 | |
| 188 | 186 | $this->compileCustomModelStub($this->modelFullPath); |
@@ -320,8 +318,7 @@ discard block |
||
| 320 | 318 | $this->input->setOption('request', false); |
| 321 | 319 | |
| 322 | 320 | $this->line($fileExistsMessage.' '.config('entity.namespace.backend').'/'.$this->requestStoreName); |
| 323 | - } |
|
| 324 | - else { |
|
| 321 | + } else { |
|
| 325 | 322 | $this->callSilent('make:request', [ |
| 326 | 323 | 'name' => config('entity.namespace.backend').'/'.$this->removeFileExtension($this->requestStoreName) |
| 327 | 324 | ]); |
@@ -337,8 +334,7 @@ discard block |
||
| 337 | 334 | $this->input->setOption('request', false); |
| 338 | 335 | |
| 339 | 336 | $this->line($fileExistsMessage.' '.config('entity.namespace.backend').'/'.$this->requestUpdateName); |
| 340 | - } |
|
| 341 | - else { |
|
| 337 | + } else { |
|
| 342 | 338 | $this->callSilent('make:request', [ |
| 343 | 339 | 'name' => config('entity.namespace.backend').'/'.$this->removeFileExtension($this->requestUpdateName) |
| 344 | 340 | ]); |
@@ -354,8 +350,7 @@ discard block |
||
| 354 | 350 | $this->input->setOption('request', false); |
| 355 | 351 | |
| 356 | 352 | $this->line($fileExistsMessage.' '.config('entity.namespace.frontend').'/'.$this->requestStoreName); |
| 357 | - } |
|
| 358 | - else { |
|
| 353 | + } else { |
|
| 359 | 354 | $this->callSilent('make:request', [ |
| 360 | 355 | 'name' => config('entity.namespace.frontend').'/'.$this->removeFileExtension($this->requestStoreName) |
| 361 | 356 | ]); |
@@ -371,8 +366,7 @@ discard block |
||
| 371 | 366 | $this->input->setOption('request', false); |
| 372 | 367 | |
| 373 | 368 | $this->line($fileExistsMessage.' '.config('entity.namespace.frontend').'/'.$this->requestUpdateName); |
| 374 | - } |
|
| 375 | - else { |
|
| 369 | + } else { |
|
| 376 | 370 | $this->callSilent('make:request', [ |
| 377 | 371 | 'name' => config('entity.namespace.frontend').'/'.$this->removeFileExtension($this->requestUpdateName) |
| 378 | 372 | ]); |
@@ -391,8 +385,7 @@ discard block |
||
| 391 | 385 | $this->input->setOption('request', false); |
| 392 | 386 | |
| 393 | 387 | $this->line($fileExistsMessage.' '.$this->requestStoreName); |
| 394 | - } |
|
| 395 | - else { |
|
| 388 | + } else { |
|
| 396 | 389 | $this->callSilent('make:request', [ |
| 397 | 390 | 'name' => $this->removeFileExtension($this->requestStoreName) |
| 398 | 391 | ]); |
@@ -408,8 +401,7 @@ discard block |
||
| 408 | 401 | $this->input->setOption('request', false); |
| 409 | 402 | |
| 410 | 403 | $this->line($fileExistsMessage.' '.$this->requestUpdateName); |
| 411 | - } |
|
| 412 | - else { |
|
| 404 | + } else { |
|
| 413 | 405 | $this->callSilent('make:request', [ |
| 414 | 406 | 'name' => $this->removeFileExtension($this->requestUpdateName) |
| 415 | 407 | ]); |
@@ -428,8 +420,7 @@ discard block |
||
| 428 | 420 | $this->input->setOption('request', false); |
| 429 | 421 | |
| 430 | 422 | $this->line($fileExistsMessage.' '.$this->namespace.'/'.$this->requestStoreName); |
| 431 | - } |
|
| 432 | - else { |
|
| 423 | + } else { |
|
| 433 | 424 | $this->callSilent('make:request', [ |
| 434 | 425 | 'name' => $this->namespace.'/'.$this->removeFileExtension($this->requestStoreName) |
| 435 | 426 | ]); |
@@ -445,8 +436,7 @@ discard block |
||
| 445 | 436 | $this->input->setOption('request', false); |
| 446 | 437 | |
| 447 | 438 | $this->line($fileExistsMessage.' '.$this->namespace.'/'.$this->requestUpdateName); |
| 448 | - } |
|
| 449 | - else { |
|
| 439 | + } else { |
|
| 450 | 440 | $this->callSilent('make:request', [ |
| 451 | 441 | 'name' => $this->namespace.'/'.$this->removeFileExtension($this->requestUpdateName) |
| 452 | 442 | ]); |
@@ -490,8 +480,7 @@ discard block |
||
| 490 | 480 | $this->input->setOption('controller', false); |
| 491 | 481 | |
| 492 | 482 | $this->line($fileExistsMessage.' '.config('entity.namespace.backend').'/'.$this->controllerName); |
| 493 | - } |
|
| 494 | - else { |
|
| 483 | + } else { |
|
| 495 | 484 | $this->compileControllerStub($path, config('entity.namespace.backend')); |
| 496 | 485 | |
| 497 | 486 | $this->addToTable('Controller', config('entity.namespace.backend').'/'.$this->controllerName); |
@@ -505,8 +494,7 @@ discard block |
||
| 505 | 494 | $this->input->setOption('controller', false); |
| 506 | 495 | |
| 507 | 496 | $this->line($fileExistsMessage.' '.config('entity.namespace.frontend').'/'.$this->controllerName); |
| 508 | - } |
|
| 509 | - else { |
|
| 497 | + } else { |
|
| 510 | 498 | $this->compileControllerStub($path, config('entity.namespace.frontend')); |
| 511 | 499 | |
| 512 | 500 | $this->addToTable('Controller', config('entity.namespace.frontend').'/'.$this->controllerName); |
@@ -521,8 +509,7 @@ discard block |
||
| 521 | 509 | $this->input->setOption('controller', false); |
| 522 | 510 | |
| 523 | 511 | $this->line($fileExistsMessage.' '.$this->controllerName); |
| 524 | - } |
|
| 525 | - else { |
|
| 512 | + } else { |
|
| 526 | 513 | $this->compileControllerStub($path); |
| 527 | 514 | |
| 528 | 515 | $this->addToTable('Controller', $this->controllerName); |
@@ -537,8 +524,7 @@ discard block |
||
| 537 | 524 | $this->input->setOption('controller', false); |
| 538 | 525 | |
| 539 | 526 | $this->line($fileExistsMessage.' '.$this->namespace.'/'.$this->controllerName); |
| 540 | - } |
|
| 541 | - else { |
|
| 527 | + } else { |
|
| 542 | 528 | $this->compileControllerStub($path, $this->namespace); |
| 543 | 529 | |
| 544 | 530 | $this->addToTable('Controller', $this->namespace.'/'.$this->controllerName); |
@@ -563,8 +549,7 @@ discard block |
||
| 563 | 549 | { |
| 564 | 550 | if ($namespace) { |
| 565 | 551 | $stub = $this->files->get(__DIR__.'/stubs/controller.stub'); |
| 566 | - } |
|
| 567 | - else { |
|
| 552 | + } else { |
|
| 568 | 553 | $stub = $this->files->get(__DIR__.'/stubs/controller.none.stub'); |
| 569 | 554 | } |
| 570 | 555 | |
@@ -686,8 +671,7 @@ discard block |
||
| 686 | 671 | $this->input->setOption('seeder', false); |
| 687 | 672 | |
| 688 | 673 | $this->line('Table Seeder already exists: '.$seederTable); |
| 689 | - } |
|
| 690 | - else { |
|
| 674 | + } else { |
|
| 691 | 675 | $this->callSilent('make:seeder', [ |
| 692 | 676 | 'name' => $this->removeFileExtension($seederTable) |
| 693 | 677 | ]); |
@@ -713,8 +697,7 @@ discard block |
||
| 713 | 697 | $this->input->setOption('dummy', false); |
| 714 | 698 | |
| 715 | 699 | $this->line('Dummy Seeder already exists: '.config('entity.dummy.dummies').$seederDummy); |
| 716 | - } |
|
| 717 | - else { |
|
| 700 | + } else { |
|
| 718 | 701 | $this->compileDummySeederStub($path); |
| 719 | 702 | |
| 720 | 703 | $this->makeDummyDataSeeder(); |
@@ -786,8 +769,7 @@ discard block |
||
| 786 | 769 | $this->input->setOption('test', false); |
| 787 | 770 | |
| 788 | 771 | $this->line('Test: Feature already exists: Feature/'.$test.'.php'); |
| 789 | - } |
|
| 790 | - else { |
|
| 772 | + } else { |
|
| 791 | 773 | $this->callSilent('make:test', [ |
| 792 | 774 | 'name' => $test |
| 793 | 775 | ]); |
@@ -805,8 +787,7 @@ discard block |
||
| 805 | 787 | $this->input->setOption('test', false); |
| 806 | 788 | |
| 807 | 789 | $this->line('Test: Unit already exists: Unit/'.$test.'.php'); |
| 808 | - } |
|
| 809 | - else { |
|
| 790 | + } else { |
|
| 810 | 791 | $this->callSilent('make:test', [ |
| 811 | 792 | 'name' => $test, |
| 812 | 793 | '--unit' => true, |
@@ -843,8 +824,7 @@ discard block |
||
| 843 | 824 | ($this->option('controller') && $this->option('request'))) { |
| 844 | 825 | |
| 845 | 826 | array_push($this->additionalSteps, 'Define a route for the generated Controller'); |
| 846 | - } |
|
| 847 | - else if ($this->option('request')) { |
|
| 827 | + } else if ($this->option('request')) { |
|
| 848 | 828 | |
| 849 | 829 | array_push($this->additionalSteps, 'Use generated Requests for the Controller'); |
| 850 | 830 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function boot() |
| 16 | 16 | { |
| 17 | 17 | if ($this->app->runningInConsole()) { |
| 18 | - $this->commands([EntityMake::class]); |
|
| 18 | + $this->commands([ EntityMake::class ]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $this->publishes([ |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * The entity's model namespace. |
| 24 | 24 | * |
| 25 | 25 | */ |
| 26 | - 'namespace' => 'Modelmu', // output: namespace App\Models; |
|
| 26 | + 'namespace' => 'Modelmu', // output: namespace App\Models; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Set a base model for your entity |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * It purpose is to make a dummy (obviously) data |
| 46 | 46 | */ |
| 47 | 47 | 'dummy' => [ |
| 48 | - 'should_create' => true, // Whether the dummy seeds has to be created |
|
| 49 | - 'directory' => 'dummies', // /database/seeds/dummies |
|
| 48 | + 'should_create' => true, // Whether the dummy seeds has to be created |
|
| 49 | + 'directory' => 'dummies', // /database/seeds/dummies |
|
| 50 | 50 | ], |
| 51 | 51 | ]; |