@@ -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 | /** |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $ary = explode("\\", $name); |
59 | - $model = $ary[count($ary) - 1]; |
|
59 | + $model = $ary[ count($ary) - 1 ]; |
|
60 | 60 | $modelVariable = $this->option('variable'); |
61 | 61 | $modelUnderScore = $this->option('underscore'); |
62 | 62 | $name = "{$name}Service"; |
63 | 63 | |
64 | 64 | $stub = str_replace( |
65 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
65 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | $stub = str_replace( |
69 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
69 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | return str_replace( |
73 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
73 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | } |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | protected function getOptions() |
130 | 130 | { |
131 | 131 | return [ |
132 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the service already exists'], |
|
133 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this service class'], |
|
134 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this service class'], |
|
132 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the service already exists' ], |
|
133 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this service class' ], |
|
134 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this service class' ], |
|
135 | 135 | ]; |
136 | 136 | } |
137 | 137 | |
@@ -146,6 +146,6 @@ discard block |
||
146 | 146 | $name = "{$name}Service"; |
147 | 147 | $name = Str::replaceFirst($this->rootNamespace(), '', $name); |
148 | 148 | |
149 | - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; |
|
149 | + return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php'; |
|
150 | 150 | } |
151 | 151 | } |
@@ -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 | /** |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $ary = explode("\\", $name); |
59 | - $model = $ary[count($ary) - 1]; |
|
59 | + $model = $ary[ count($ary) - 1 ]; |
|
60 | 60 | $modelVariable = $this->option('variable'); |
61 | 61 | $modelUnderScore = $this->option('underscore'); |
62 | 62 | $name = "{$name}Repository"; |
63 | 63 | |
64 | 64 | $stub = str_replace( |
65 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
65 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | $stub = str_replace( |
69 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
69 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | return str_replace( |
73 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
73 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | } |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | protected function getOptions() |
130 | 130 | { |
131 | 131 | return [ |
132 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists'], |
|
133 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this repository class'], |
|
134 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this repository class'], |
|
132 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists' ], |
|
133 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this repository class' ], |
|
134 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this repository class' ], |
|
135 | 135 | ]; |
136 | 136 | } |
137 | 137 | |
@@ -146,6 +146,6 @@ discard block |
||
146 | 146 | $name = "{$name}Repository"; |
147 | 147 | $name = Str::replaceFirst($this->rootNamespace(), '', $name); |
148 | 148 | |
149 | - return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php'; |
|
149 | + return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php'; |
|
150 | 150 | } |
151 | 151 | } |
@@ -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 | /** |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $ary = explode("\\", $name); |
59 | - $model = $ary[count($ary) - 1]; |
|
59 | + $model = $ary[ count($ary) - 1 ]; |
|
60 | 60 | $modelVariable = $this->option('variable'); |
61 | 61 | $modelUnderScore = $this->option('underscore'); |
62 | 62 | $name = "{$name}Factory"; |
63 | 63 | |
64 | 64 | $stub = str_replace( |
65 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
65 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | $stub = str_replace( |
69 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
69 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | return str_replace( |
73 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
73 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | } |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | protected function getOptions() |
130 | 130 | { |
131 | 131 | return [ |
132 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the factory already exists'], |
|
133 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this factory class'], |
|
134 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this factory class'], |
|
132 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the factory already exists' ], |
|
133 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this factory class' ], |
|
134 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this factory class' ], |
|
135 | 135 | ]; |
136 | 136 | } |
137 | 137 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | protected function getPath($name) |
145 | 145 | { |
146 | 146 | $ary = explode("\\", $name); |
147 | - $name = $ary[count($ary) - 1]; |
|
147 | + $name = $ary[ count($ary) - 1 ]; |
|
148 | 148 | |
149 | 149 | return base_path("database/factories/{$name}Factory.php"); |
150 | 150 | } |
@@ -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:test')] |
|
10 | +#[AsCommand(name: 'magic:test') ] |
|
11 | 11 | class MagicTestCommand extends GeneratorCommand |
12 | 12 | { |
13 | 13 | /** |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $ary = explode("\\", $name); |
59 | - $model = $ary[count($ary) - 1]; |
|
59 | + $model = $ary[ count($ary) - 1 ]; |
|
60 | 60 | $modelVariable = $this->option('variable'); |
61 | 61 | $modelUnderScore = $this->option('underscore'); |
62 | 62 | $name = "{$name}Test"; |
63 | 63 | |
64 | 64 | $stub = str_replace( |
65 | - ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name) |
|
65 | + [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name) |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | $stub = str_replace( |
69 | - ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub |
|
69 | + [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | return str_replace( |
73 | - ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub |
|
73 | + [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | } |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | protected function getOptions() |
130 | 130 | { |
131 | 131 | return [ |
132 | - ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the test already exists'], |
|
133 | - ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this test class'], |
|
134 | - ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this test class'], |
|
132 | + [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the test already exists' ], |
|
133 | + [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this test class' ], |
|
134 | + [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this test class' ], |
|
135 | 135 | ]; |
136 | 136 | } |
137 | 137 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | protected function getPath($name) |
145 | 145 | { |
146 | 146 | $ary = explode("\\", $name); |
147 | - $name = $ary[count($ary) - 1]; |
|
147 | + $name = $ary[ count($ary) - 1 ]; |
|
148 | 148 | |
149 | 149 | return base_path("tests/Feature/{$name}Test.php"); |
150 | 150 | } |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | |
20 | 20 | protected function handleAppContractsPath() |
21 | 21 | { |
22 | - if (! is_dir($directory = app_path('Contracts'))) { |
|
22 | + if (!is_dir($directory = app_path('Contracts'))) { |
|
23 | 23 | mkdir($directory, 0755, true); |
24 | 24 | } |
25 | 25 | |
26 | 26 | $filesystem = new Filesystem; |
27 | 27 | |
28 | 28 | collect($filesystem->allFiles(__DIR__.'/stubs/init/app/Contracts')) |
29 | - ->each(function (SplFileInfo $file) use ($filesystem) { |
|
29 | + ->each(function(SplFileInfo $file) use ($filesystem) { |
|
30 | 30 | $filesystem->copy( |
31 | 31 | $file->getPathname(), |
32 | 32 | app_path('Contracts/'.Str::replaceLast('.stub', '.php', $file->getFilename())) |
@@ -243,14 +243,14 @@ discard block |
||
243 | 243 | |
244 | 244 | private function handlePath(string $appPath, string $stubPath, string $name) |
245 | 245 | { |
246 | - if (! is_dir($directory = app_path($appPath))) { |
|
246 | + if (!is_dir($directory = app_path($appPath))) { |
|
247 | 247 | mkdir($directory, 0755, true); |
248 | 248 | } |
249 | 249 | |
250 | 250 | $filesystem = new Filesystem; |
251 | 251 | |
252 | 252 | collect($filesystem->allFiles($stubPath)) |
253 | - ->each(function (SplFileInfo $file) use ($filesystem, $appPath) { |
|
253 | + ->each(function(SplFileInfo $file) use ($filesystem, $appPath) { |
|
254 | 254 | $filesystem->copy( |
255 | 255 | $file->getPathname(), |
256 | 256 | app_path("{$appPath}/".Str::replaceLast('.stub', '.php', $file->getFilename())) |