@@ -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 | } |
@@ -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 | } |
@@ -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:service')] |
|
| 10 | +#[AsCommand(name: 'magic:service') ] |
|
| 11 | 11 | class MagicServiceCommand 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}Service"; |
| 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 service already exists'], |
|
| 128 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this service class'], |
|
| 129 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this service class'], |
|
| 127 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the service already exists' ], |
|
| 128 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this service class' ], |
|
| 129 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this service class' ], |
|
| 130 | 130 | ]; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -141,6 +141,6 @@ discard block |
||
| 141 | 141 | $name = "{$name}Service"; |
| 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 | } |