@@ -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: 'make:interfaceclass')] |
|
| 10 | +#[AsCommand(name: 'make:interfaceclass') ] |
|
| 11 | 11 | class MakeInterfaceCommand extends GeneratorCommand |
| 12 | 12 | { |
| 13 | 13 | /** |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $model = $this->option('model'); |
| 54 | 54 | |
| 55 | - if (! Str::startsWith($model, [ |
|
| 55 | + if (!Str::startsWith($model, [ |
|
| 56 | 56 | $this->laravel->getNamespace(), |
| 57 | 57 | 'Illuminate', |
| 58 | 58 | '\\', |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $stub = str_replace( |
| 64 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 64 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | return str_replace( |
| 68 | - ['DummyFullModel', '{{ modelNamespace }}'], trim($model, '\\'), $stub |
|
| 68 | + [ 'DummyFullModel', '{{ modelNamespace }}' ], trim($model, '\\'), $stub |
|
| 69 | 69 | ); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | protected function getOptions() |
| 132 | 132 | { |
| 133 | 133 | return [ |
| 134 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the interface already exists'], |
|
| 135 | - ['model', 'm', InputOption::VALUE_REQUIRED, 'Create a model namespace for this interface'], |
|
| 136 | - ['user', 'u', InputOption::VALUE_NONE, 'Create extra fetch by user id functions for this repository'], |
|
| 134 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the interface already exists' ], |
|
| 135 | + [ 'model', 'm', InputOption::VALUE_REQUIRED, 'Create a model namespace for this interface' ], |
|
| 136 | + [ 'user', 'u', InputOption::VALUE_NONE, 'Create extra fetch by user id functions for this repository' ], |
|
| 137 | 137 | ]; |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | use Symfony\Component\Console\Attribute\AsCommand; |
| 9 | 9 | use Symfony\Component\Console\Input\InputOption; |
| 10 | 10 | |
| 11 | -#[AsCommand(name: 'make:repository')] |
|
| 11 | +#[AsCommand(name: 'make:repository') ] |
|
| 12 | 12 | class MakeRepositoryCommand extends GeneratorCommand |
| 13 | 13 | { |
| 14 | 14 | /** |
@@ -54,18 +54,18 @@ discard block |
||
| 54 | 54 | $model = $this->option('model'); |
| 55 | 55 | |
| 56 | 56 | if ($this->option('contract')) { |
| 57 | - $interface = $model . "RepositoryInterface"; |
|
| 57 | + $interface = $model."RepositoryInterface"; |
|
| 58 | 58 | |
| 59 | 59 | if ($this->option('user')) { |
| 60 | - $this->call('make:interfaceclass', ['name' => $interface, '--model' => $model, '--user' => null]); |
|
| 60 | + $this->call('make:interfaceclass', [ 'name' => $interface, '--model' => $model, '--user' => null ]); |
|
| 61 | 61 | } else { |
| 62 | - $this->call('make:interfaceclass', ['name' => $interface, '--model' => $model]); |
|
| 62 | + $this->call('make:interfaceclass', [ 'name' => $interface, '--model' => $model ]); |
|
| 63 | 63 | } |
| 64 | 64 | } else { |
| 65 | 65 | $interface = $this->option('interface'); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - if (! Str::startsWith($model, [ |
|
| 68 | + if (!Str::startsWith($model, [ |
|
| 69 | 69 | $this->laravel->getNamespace(), |
| 70 | 70 | 'Illuminate', |
| 71 | 71 | '\\', |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $model = $this->laravel->getNamespace().'Models\\'.str_replace('/', '\\', $model); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if (! Str::startsWith($interface, [ |
|
| 76 | + if (!Str::startsWith($interface, [ |
|
| 77 | 77 | $this->laravel->getNamespace(), |
| 78 | 78 | 'Illuminate', |
| 79 | 79 | '\\', |
@@ -82,19 +82,19 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $stub = str_replace( |
| 85 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 85 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | 88 | $stub = str_replace( |
| 89 | - ['DummyFullModel', '{{ modelNamespace }}'], trim($model, '\\'), $stub |
|
| 89 | + [ 'DummyFullModel', '{{ modelNamespace }}' ], trim($model, '\\'), $stub |
|
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | 92 | $stub = str_replace( |
| 93 | - ['DummyInterface', '{{ interface }}'], class_basename($interface), $stub |
|
| 93 | + [ 'DummyInterface', '{{ interface }}' ], class_basename($interface), $stub |
|
| 94 | 94 | ); |
| 95 | 95 | |
| 96 | 96 | return str_replace( |
| 97 | - ['DummyFullInterface', '{{ interfaceNamespace }}'], trim($interface, '\\'), $stub |
|
| 97 | + [ 'DummyFullInterface', '{{ interfaceNamespace }}' ], trim($interface, '\\'), $stub |
|
| 98 | 98 | ); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | protected function getOptions() |
| 157 | 157 | { |
| 158 | 158 | return [ |
| 159 | - ['contract', 'c', InputOption::VALUE_NONE, 'Create an interface class for this repository'], |
|
| 160 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists'], |
|
| 161 | - ['interface', 'i', InputOption::VALUE_OPTIONAL, 'Create an interface namespace for this repository'], |
|
| 162 | - ['model', 'm', InputOption::VALUE_REQUIRED, 'Create a model namespace for this repository'], |
|
| 163 | - ['user', 'u', InputOption::VALUE_NONE, 'Create extra fetch by user id functions for this repository'], |
|
| 159 | + [ 'contract', 'c', InputOption::VALUE_NONE, 'Create an interface class for this repository' ], |
|
| 160 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists' ], |
|
| 161 | + [ 'interface', 'i', InputOption::VALUE_OPTIONAL, 'Create an interface namespace for this repository' ], |
|
| 162 | + [ 'model', 'm', InputOption::VALUE_REQUIRED, 'Create a model namespace for this repository' ], |
|
| 163 | + [ 'user', 'u', InputOption::VALUE_NONE, 'Create extra fetch by user id functions for this repository' ], |
|
| 164 | 164 | ]; |
| 165 | 165 | } |
| 166 | 166 | |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $path = $this->getPath($name); |
| 188 | 188 | |
| 189 | - if ((! $this->hasOption('force') || |
|
| 190 | - ! $this->option('force')) && |
|
| 189 | + if ((!$this->hasOption('force') || |
|
| 190 | + !$this->option('force')) && |
|
| 191 | 191 | $this->alreadyExists($this->getNameInput())) { |
| 192 | 192 | $this->components->error($this->type.' already exists.'); |
| 193 | 193 | |