@@ -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,13 +54,13 @@ discard block |
||
| 54 | 54 | $model = $this->option('model'); |
| 55 | 55 | |
| 56 | 56 | if ($this->option('contract')) { |
| 57 | - $interface = $model . "RepositoryInterface"; |
|
| 58 | - $this->call('make:interfaceclass', ['name' => $interface, '--model' => $model]); |
|
| 57 | + $interface = $model."RepositoryInterface"; |
|
| 58 | + $this->call('make:interfaceclass', [ 'name' => $interface, '--model' => $model ]); |
|
| 59 | 59 | } else { |
| 60 | 60 | $interface = $this->option('interface'); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if (! Str::startsWith($model, [ |
|
| 63 | + if (!Str::startsWith($model, [ |
|
| 64 | 64 | $this->laravel->getNamespace(), |
| 65 | 65 | 'Illuminate', |
| 66 | 66 | '\\', |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $model = $this->laravel->getNamespace().'Models\\'.str_replace('/', '\\', $model); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if (! Str::startsWith($interface, [ |
|
| 71 | + if (!Str::startsWith($interface, [ |
|
| 72 | 72 | $this->laravel->getNamespace(), |
| 73 | 73 | 'Illuminate', |
| 74 | 74 | '\\', |
@@ -77,19 +77,19 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $stub = str_replace( |
| 80 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
| 80 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
| 81 | 81 | ); |
| 82 | 82 | |
| 83 | 83 | $stub = str_replace( |
| 84 | - ['DummyFullModel', '{{ modelNamespace }}'], trim($model, '\\'), $stub |
|
| 84 | + [ 'DummyFullModel', '{{ modelNamespace }}' ], trim($model, '\\'), $stub |
|
| 85 | 85 | ); |
| 86 | 86 | |
| 87 | 87 | $stub = str_replace( |
| 88 | - ['DummyInterface', '{{ interface }}'], class_basename($interface), $stub |
|
| 88 | + [ 'DummyInterface', '{{ interface }}' ], class_basename($interface), $stub |
|
| 89 | 89 | ); |
| 90 | 90 | |
| 91 | 91 | return str_replace( |
| 92 | - ['DummyFullInterface', '{{ interfaceNamespace }}'], trim($interface, '\\'), $stub |
|
| 92 | + [ 'DummyFullInterface', '{{ interfaceNamespace }}' ], trim($interface, '\\'), $stub |
|
| 93 | 93 | ); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -147,10 +147,10 @@ discard block |
||
| 147 | 147 | protected function getOptions() |
| 148 | 148 | { |
| 149 | 149 | return [ |
| 150 | - ['contract', 'c', InputOption::VALUE_NONE, 'Create an interface class for this repository'], |
|
| 151 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists'], |
|
| 152 | - ['interface', 'i', InputOption::VALUE_OPTIONAL, 'Create an interface namespace for this repository'], |
|
| 153 | - ['model', 'm', InputOption::VALUE_REQUIRED, 'Create a model namespace for this repository'], |
|
| 150 | + [ 'contract', 'c', InputOption::VALUE_NONE, 'Create an interface class for this repository' ], |
|
| 151 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists' ], |
|
| 152 | + [ 'interface', 'i', InputOption::VALUE_OPTIONAL, 'Create an interface namespace for this repository' ], |
|
| 153 | + [ 'model', 'm', InputOption::VALUE_REQUIRED, 'Create a model namespace for this repository' ], |
|
| 154 | 154 | ]; |
| 155 | 155 | } |
| 156 | 156 | |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $path = $this->getPath($name); |
| 178 | 178 | |
| 179 | - if ((! $this->hasOption('force') || |
|
| 180 | - ! $this->option('force')) && |
|
| 179 | + if ((!$this->hasOption('force') || |
|
| 180 | + !$this->option('force')) && |
|
| 181 | 181 | $this->alreadyExists($this->getNameInput())) { |
| 182 | 182 | $this->components->error($this->type.' already exists.'); |
| 183 | 183 | |