@@ -35,12 +35,12 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | - protected $guarded = []; |
|
| 38 | + protected $guarded = [ ]; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $casts = []; |
|
| 43 | + protected $casts = [ ]; |
|
| 44 | 44 | |
| 45 | 45 | protected $dates = [ |
| 46 | 46 | 'created_at', |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * @var array |
| 22 | 22 | */ |
| 23 | - protected $guarded = []; |
|
| 23 | + protected $guarded = [ ]; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @var array |
| 27 | 27 | */ |
| 28 | - protected $casts = []; |
|
| 28 | + protected $casts = [ ]; |
|
| 29 | 29 | |
| 30 | 30 | protected $dates = [ |
| 31 | 31 | 'created_at', |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * @var array |
| 29 | 29 | */ |
| 30 | - protected $guarded = []; |
|
| 30 | + protected $guarded = [ ]; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $casts = []; |
|
| 35 | + protected $casts = [ ]; |
|
| 36 | 36 | |
| 37 | 37 | protected $dates = [ |
| 38 | 38 | 'created_at', |
@@ -40,15 +40,15 @@ discard block |
||
| 40 | 40 | 'deleted_at', |
| 41 | 41 | ]; |
| 42 | 42 | |
| 43 | - public function reply(){ |
|
| 43 | + public function reply() { |
|
| 44 | 44 | return $this->embedsOne(ScriptReviewReply::class); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function script(){ |
|
| 47 | + public function script() { |
|
| 48 | 48 | return $this->belongsTo(Script::class); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - public function user(){ |
|
| 51 | + public function user() { |
|
| 52 | 52 | return $this->belongsTo(User::class); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -19,12 +19,12 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * @var array |
| 21 | 21 | */ |
| 22 | - protected $guarded = []; |
|
| 22 | + protected $guarded = [ ]; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * @var array |
| 26 | 26 | */ |
| 27 | - protected $casts = []; |
|
| 27 | + protected $casts = [ ]; |
|
| 28 | 28 | |
| 29 | 29 | protected $dates = [ |
| 30 | 30 | 'created_at', |
@@ -21,12 +21,12 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * @var array |
| 23 | 23 | */ |
| 24 | - protected $guarded = []; |
|
| 24 | + protected $guarded = [ ]; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var array |
| 28 | 28 | */ |
| 29 | - protected $casts = []; |
|
| 29 | + protected $casts = [ ]; |
|
| 30 | 30 | |
| 31 | 31 | protected $dates = [ |
| 32 | 32 | 'created_at', |
@@ -40,37 +40,37 @@ |
||
| 40 | 40 | /** |
| 41 | 41 | * |
| 42 | 42 | */ |
| 43 | - public function generate(){ |
|
| 43 | + public function generate() { |
|
| 44 | 44 | |
| 45 | 45 | $this->moduleFactory->addModel($this->moduleName, true, true); |
| 46 | 46 | |
| 47 | - $this->moduleFactory->addService($this->moduleName . 'Service'); |
|
| 47 | + $this->moduleFactory->addService($this->moduleName.'Service'); |
|
| 48 | 48 | |
| 49 | - $this->moduleFactory->addController($this->moduleName . "Controller"); |
|
| 49 | + $this->moduleFactory->addController($this->moduleName."Controller"); |
|
| 50 | 50 | |
| 51 | - $this->moduleFactory->addTest($this->moduleName . 'ServiceTest', 'service'); |
|
| 52 | - $this->moduleFactory->addTest($this->moduleName . 'HttpTest', 'http'); |
|
| 53 | - $this->moduleFactory->addTest($this->moduleName . 'UnitTest', 'unit'); |
|
| 51 | + $this->moduleFactory->addTest($this->moduleName.'ServiceTest', 'service'); |
|
| 52 | + $this->moduleFactory->addTest($this->moduleName.'HttpTest', 'http'); |
|
| 53 | + $this->moduleFactory->addTest($this->moduleName.'UnitTest', 'unit'); |
|
| 54 | 54 | |
| 55 | - $this->moduleFactory->addEvent($this->moduleName . 'WasCreatedEvent'); |
|
| 56 | - $this->moduleFactory->addEvent($this->moduleName . 'WasUpdatedEvent'); |
|
| 57 | - $this->moduleFactory->addEvent($this->moduleName . 'WasDeletedEvent'); |
|
| 55 | + $this->moduleFactory->addEvent($this->moduleName.'WasCreatedEvent'); |
|
| 56 | + $this->moduleFactory->addEvent($this->moduleName.'WasUpdatedEvent'); |
|
| 57 | + $this->moduleFactory->addEvent($this->moduleName.'WasDeletedEvent'); |
|
| 58 | 58 | |
| 59 | - $this->moduleFactory->addRequest('Find'.$this->moduleName . 'Request'); |
|
| 60 | - $this->moduleFactory->addRequest('Index'.$this->moduleName . 'Request'); |
|
| 61 | - $this->moduleFactory->addRequest('Create'.$this->moduleName . 'Request'); |
|
| 62 | - $this->moduleFactory->addRequest('Update'.$this->moduleName . 'Request'); |
|
| 63 | - $this->moduleFactory->addRequest('Delete'.$this->moduleName . 'Request'); |
|
| 59 | + $this->moduleFactory->addRequest('Find'.$this->moduleName.'Request'); |
|
| 60 | + $this->moduleFactory->addRequest('Index'.$this->moduleName.'Request'); |
|
| 61 | + $this->moduleFactory->addRequest('Create'.$this->moduleName.'Request'); |
|
| 62 | + $this->moduleFactory->addRequest('Update'.$this->moduleName.'Request'); |
|
| 63 | + $this->moduleFactory->addRequest('Delete'.$this->moduleName.'Request'); |
|
| 64 | 64 | |
| 65 | - $this->moduleFactory->addPermission($this->moduleName . 'Permission'); |
|
| 65 | + $this->moduleFactory->addPermission($this->moduleName.'Permission'); |
|
| 66 | 66 | |
| 67 | - $this->moduleFactory->addPolicy($this->moduleName . 'Policy'); |
|
| 67 | + $this->moduleFactory->addPolicy($this->moduleName.'Policy'); |
|
| 68 | 68 | |
| 69 | 69 | $this->moduleFactory->addFactory($this->moduleName); |
| 70 | 70 | |
| 71 | 71 | $this->moduleFactory->addTransformer($this->moduleName.'Transformer', $this->moduleName); |
| 72 | 72 | |
| 73 | - $this->moduleFactory->addServiceProvider($this->moduleName . 'ServiceProvider'); |
|
| 73 | + $this->moduleFactory->addServiceProvider($this->moduleName.'ServiceProvider'); |
|
| 74 | 74 | |
| 75 | 75 | $this->moduleFactory->addRoute('v1'); |
| 76 | 76 | |
@@ -71,20 +71,20 @@ |
||
| 71 | 71 | $this->info("Don't forget to add permissions to the Permission model!"); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - protected function handleVersioningOption($shortcut, $type, $question, $default){ |
|
| 75 | - return $this->anticipate('What is the version of the route?',['v1','v2','v3','v4','v5'],$default); |
|
| 74 | + protected function handleVersioningOption($shortcut, $type, $question, $default) { |
|
| 75 | + return $this->anticipate('What is the version of the route?', [ 'v1', 'v2', 'v3', 'v4', 'v5' ], $default); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | protected function setOptions(): array |
| 79 | 79 | { |
| 80 | 80 | return [ |
| 81 | - ['versioning', null, InputOption::VALUE_OPTIONAL, 'The route version', 'v1'], |
|
| 81 | + [ 'versioning', null, InputOption::VALUE_OPTIONAL, 'The route version', 'v1' ], |
|
| 82 | 82 | ]; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | protected function getFileName() :string |
| 86 | 86 | { |
| 87 | - return strtolower(Str::plural($this->getModuleName())).'.'.$this->getVersion() . '.php'; |
|
| 87 | + return strtolower(Str::plural($this->getModuleName())).'.'.$this->getVersion().'.php'; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $type = $this->getType(); |
| 75 | 75 | |
| 76 | 76 | if (in_array($type, $this->types)) |
| 77 | - return "test-" . $type . ".stub"; |
|
| 77 | + return "test-".$type.".stub"; |
|
| 78 | 78 | |
| 79 | 79 | throw new Exception("Test type not supported"); |
| 80 | 80 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | protected function setOptions(): array |
| 88 | 88 | { |
| 89 | 89 | return [ |
| 90 | - ['type', $this->types, InputOption::VALUE_OPTIONAL, 'Indicates the type of the test.', $this->types[0]] |
|
| 90 | + [ 'type', $this->types, InputOption::VALUE_OPTIONAL, 'Indicates the type of the test.', $this->types[ 0 ] ] |
|
| 91 | 91 | ]; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -73,8 +73,9 @@ |
||
| 73 | 73 | { |
| 74 | 74 | $type = $this->getType(); |
| 75 | 75 | |
| 76 | - if (in_array($type, $this->types)) |
|
| 77 | - return "test-" . $type . ".stub"; |
|
| 76 | + if (in_array($type, $this->types)) { |
|
| 77 | + return "test-" . $type . ".stub"; |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | throw new Exception("Test type not supported"); |
| 80 | 81 | } |