@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | protected function getFileName() :string |
77 | 77 | { |
78 | - return strtolower(Str::plural($this->getModuleName())).'.'.$this->getVersion() . '.php'; |
|
78 | + return strtolower(Str::plural($this->getModuleName())).'.'.$this->getVersion().'.php'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | protected function setOptions(): array |
66 | 66 | { |
67 | 67 | return [ |
68 | - ['mongo', null, InputOption::VALUE_OPTIONAL, 'Mongo model.', false], |
|
69 | - ['migration', null, InputOption::VALUE_OPTIONAL, 'Create migration for the model.', true], |
|
68 | + [ 'mongo', null, InputOption::VALUE_OPTIONAL, 'Mongo model.', false ], |
|
69 | + [ 'migration', null, InputOption::VALUE_OPTIONAL, 'Create migration for the model.', true ], |
|
70 | 70 | ]; |
71 | 71 | } |
72 | 72 | |
73 | - protected function handleMongoOption($shortcut, $type, $question, $default){ |
|
73 | + protected function handleMongoOption($shortcut, $type, $question, $default) { |
|
74 | 74 | return $this->confirm('Is this model for a mongodb database?', $default); |
75 | 75 | } |
76 | 76 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | return $this->getOption('mongo'); |
80 | 80 | } |
81 | 81 | |
82 | - protected function handleMigrationOption($shortcut, $type, $question, $default){ |
|
82 | + protected function handleMigrationOption($shortcut, $type, $question, $default) { |
|
83 | 83 | return $this->confirm('Do you want to create a migration for this model?', $default); |
84 | 84 | } |
85 | 85 | |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | if ($this->needsMigration()) { |
94 | 94 | if ($this->isMongoModel()) { |
95 | 95 | GeneratorManager::module($this->getModuleName(), $this->isOverwriteable())->createMigration( |
96 | - "Create" . ucfirst($this->getClassName()) . "Collection", |
|
96 | + "Create".ucfirst($this->getClassName())."Collection", |
|
97 | 97 | strtolower(split_caps_to_underscore(Str::plural($this->getClassName()))), |
98 | 98 | true); |
99 | 99 | } else { |
100 | 100 | GeneratorManager::module($this->getModuleName(), $this->isOverwriteable())->createMigration( |
101 | - "Create" . ucfirst($this->getClassName() . "Table"), |
|
101 | + "Create".ucfirst($this->getClassName()."Table"), |
|
102 | 102 | strtolower(split_caps_to_underscore(Str::plural($this->getClassName()))), |
103 | 103 | false); |
104 | 104 | } |
@@ -18,11 +18,11 @@ |
||
18 | 18 | */ |
19 | 19 | class ModelGeneratedEvent extends ResourceGeneratedEvent |
20 | 20 | { |
21 | - public function isMongoModel(){ |
|
22 | - return $this->getStub()->getOptions()['MONGO']; |
|
21 | + public function isMongoModel() { |
|
22 | + return $this->getStub()->getOptions()[ 'MONGO' ]; |
|
23 | 23 | } |
24 | 24 | |
25 | - public function includesMigration(){ |
|
26 | - return $this->getStub()->getOptions()['MIGRATION']; |
|
25 | + public function includesMigration() { |
|
26 | + return $this->getStub()->getOptions()[ 'MIGRATION' ]; |
|
27 | 27 | } |
28 | 28 | } |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @var array |
56 | 56 | */ |
57 | - protected $optionData = []; |
|
57 | + protected $optionData = [ ]; |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * The data that is inputted from the arguments. |
61 | 61 | * |
62 | 62 | * @var array |
63 | 63 | */ |
64 | - protected $argumentData = []; |
|
64 | + protected $argumentData = [ ]; |
|
65 | 65 | |
66 | 66 | public function handle() |
67 | 67 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->beforeGeneration(); |
83 | 83 | |
84 | 84 | if ($this->event === null) |
85 | - throw new Exception("No Generator event specified on " . static::class); |
|
85 | + throw new Exception("No Generator event specified on ".static::class); |
|
86 | 86 | |
87 | 87 | event(new $this->event($path, $stub)); |
88 | 88 | $this->info("Created : {$path}"); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected function getDestinationFilePath(): string |
97 | 97 | { |
98 | - return $this->getModule()->getPath() . $this->filePath . '/' . $this->getFileName(); |
|
98 | + return $this->getModule()->getPath().$this->filePath.'/'.$this->getFileName(); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | final protected function getOptions() |
139 | 139 | { |
140 | 140 | $options = $this->setOptions(); |
141 | - $options[] = ['overwrite', null, InputOption::VALUE_NONE, 'Overwrite this file if it already exists?']; |
|
141 | + $options[ ] = [ 'overwrite', null, InputOption::VALUE_NONE, 'Overwrite this file if it already exists?' ]; |
|
142 | 142 | return $options; |
143 | 143 | } |
144 | 144 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | final protected function getArguments() |
151 | 151 | { |
152 | 152 | return array_merge([ |
153 | - ['module', InputArgument::OPTIONAL, 'The name of module will be used.'], |
|
153 | + [ 'module', InputArgument::OPTIONAL, 'The name of module will be used.' ], |
|
154 | 154 | ], |
155 | 155 | $this->setArguments()); |
156 | 156 | } |
@@ -187,24 +187,24 @@ discard block |
||
187 | 187 | protected function handleOptions() |
188 | 188 | { |
189 | 189 | foreach ($this->getOptions() as $option) { |
190 | - $method = 'handle' . ucfirst(strtolower($option[0])) . 'Option'; |
|
190 | + $method = 'handle'.ucfirst(strtolower($option[ 0 ])).'Option'; |
|
191 | 191 | $originalInput = $this->getOriginalOptionInput(); |
192 | - if (isset($originalInput[$option[0]])) { |
|
193 | - $this->optionData[$option[0]] = $originalInput[$option[0]]; |
|
192 | + if (isset($originalInput[ $option[ 0 ] ])) { |
|
193 | + $this->optionData[ $option[ 0 ] ] = $originalInput[ $option[ 0 ] ]; |
|
194 | 194 | } else { |
195 | - $this->optionData[$option[0]] = method_exists($this, $method) ? $this->$method($option[1], $option[2], $option[3], $option[4] ?? null) : $this->option($option[0]); |
|
195 | + $this->optionData[ $option[ 0 ] ] = method_exists($this, $method) ? $this->$method($option[ 1 ], $option[ 2 ], $option[ 3 ], $option[ 4 ] ?? null) : $this->option($option[ 0 ]); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | 200 | protected function handleModuleArgument() |
201 | 201 | { |
202 | - return $this->anticipate('For what module would you like to generate a ' . $this->getGeneratorName() . '.', Larapi::getModuleNames()); |
|
202 | + return $this->anticipate('For what module would you like to generate a '.$this->getGeneratorName().'.', Larapi::getModuleNames()); |
|
203 | 203 | } |
204 | 204 | |
205 | - protected function getModuleName(){ |
|
205 | + protected function getModuleName() { |
|
206 | 206 | $moduleName = $this->getArgument('module'); |
207 | - if($moduleName===null){ |
|
207 | + if ($moduleName === null) { |
|
208 | 208 | $this->error('module not specified'); |
209 | 209 | throw new \Exception('Name of module not specified.'); |
210 | 210 | } |
@@ -214,24 +214,24 @@ discard block |
||
214 | 214 | protected function handleArguments() |
215 | 215 | { |
216 | 216 | foreach ($this->getArguments() as $argument) { |
217 | - $method = 'handle' . ucfirst(strtolower($argument[0])) . 'Argument'; |
|
217 | + $method = 'handle'.ucfirst(strtolower($argument[ 0 ])).'Argument'; |
|
218 | 218 | $originalInput = $this->getOriginalArgumentInput(); |
219 | - if (isset($originalInput[$argument[0]])) { |
|
220 | - $this->argumentData[$argument[0]] = $originalInput[$argument[0]]; |
|
219 | + if (isset($originalInput[ $argument[ 0 ] ])) { |
|
220 | + $this->argumentData[ $argument[ 0 ] ] = $originalInput[ $argument[ 0 ] ]; |
|
221 | 221 | } else { |
222 | - $this->argumentData[$argument[0]] = method_exists($this, $method) ? $this->$method($argument[1], $argument[2], $argument[3] ?? null) : $this->option($argument[0]); |
|
222 | + $this->argumentData[ $argument[ 0 ] ] = method_exists($this, $method) ? $this->$method($argument[ 1 ], $argument[ 2 ], $argument[ 3 ] ?? null) : $this->option($argument[ 0 ]); |
|
223 | 223 | } |
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
227 | 227 | protected function getArgument(string $argument) |
228 | 228 | { |
229 | - return $this->argumentData[$argument]; |
|
229 | + return $this->argumentData[ $argument ]; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | protected function getOption(string $name) |
233 | 233 | { |
234 | - return $this->optionData[$name]; |
|
234 | + return $this->optionData[ $name ]; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | private function getOriginalOptionInput() |
@@ -254,6 +254,6 @@ discard block |
||
254 | 254 | { |
255 | 255 | $key = str_replace('get', '', $method); |
256 | 256 | if (array_key_exists(strtolower($method), $this->optionData)) |
257 | - return $this->optionData[$key]; |
|
257 | + return $this->optionData[ $key ]; |
|
258 | 258 | } |
259 | 259 | } |
@@ -81,8 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | $this->beforeGeneration(); |
83 | 83 | |
84 | - if ($this->event === null) |
|
85 | - throw new Exception("No Generator event specified on " . static::class); |
|
84 | + if ($this->event === null) { |
|
85 | + throw new Exception("No Generator event specified on " . static::class); |
|
86 | + } |
|
86 | 87 | |
87 | 88 | event(new $this->event($path, $stub)); |
88 | 89 | $this->info("Created : {$path}"); |
@@ -253,7 +254,8 @@ discard block |
||
253 | 254 | public function __call($method, $parameters) |
254 | 255 | { |
255 | 256 | $key = str_replace('get', '', $method); |
256 | - if (array_key_exists(strtolower($method), $this->optionData)) |
|
257 | - return $this->optionData[$key]; |
|
257 | + if (array_key_exists(strtolower($method), $this->optionData)) { |
|
258 | + return $this->optionData[$key]; |
|
259 | + } |
|
258 | 260 | } |
259 | 261 | } |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | protected function setArguments() :array |
28 | 28 | { |
29 | 29 | return [ |
30 | - ['name', InputArgument::OPTIONAL, 'The name of the ' . $this->getGeneratorName() . '.'] |
|
30 | + [ 'name', InputArgument::OPTIONAL, 'The name of the '.$this->getGeneratorName().'.' ] |
|
31 | 31 | ]; |
32 | 32 | } |
33 | 33 | |
34 | 34 | protected function handleNameArgument() |
35 | 35 | { |
36 | - return $this->ask('Specify the name of the ' . $this->getGeneratorName() . '.'); |
|
36 | + return $this->ask('Specify the name of the '.$this->getGeneratorName().'.'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function getFileName() :string |
43 | 43 | { |
44 | - return $this->getClassName() . '.php'; |
|
44 | + return $this->getClassName().'.php'; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getClassNamespace(): string |
54 | 54 | { |
55 | - return $this->getModule()->getNamespace() . str_replace('/', '\\', $this->filePath); |
|
55 | + return $this->getModule()->getNamespace().str_replace('/', '\\', $this->filePath); |
|
56 | 56 | } |
57 | 57 | |
58 | - protected function getClassName(){ |
|
58 | + protected function getClassName() { |
|
59 | 59 | $className = $this->getArgument('name'); |
60 | - if($className===null){ |
|
60 | + if ($className === null) { |
|
61 | 61 | $this->error('class name not specified'); |
62 | - throw new \Exception('Name of ' . $this->getGeneratorName() . ' not set.'); |
|
62 | + throw new \Exception('Name of '.$this->getGeneratorName().' not set.'); |
|
63 | 63 | } |
64 | 64 | return $className; |
65 | 65 | } |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | */ |
72 | 72 | protected function setOptions() :array |
73 | 73 | { |
74 | - return []; |
|
74 | + return [ ]; |
|
75 | 75 | } |
76 | 76 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $moduleName = "User"; |
88 | 88 | $this->getModuleGenerator($moduleName)->createFactory("User"); |
89 | 89 | |
90 | - $expectedFileName = Larapi::getModule($moduleName)->getFactories()->getPath() . '/UserFactory.php'; |
|
90 | + $expectedFileName = Larapi::getModule($moduleName)->getFactories()->getPath().'/UserFactory.php'; |
|
91 | 91 | $expectedStubName = "factory.stub"; |
92 | 92 | $expectedStubOptions = [ |
93 | 93 | 'CLASS' => 'UserFactory', |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $moduleName = "User"; |
110 | 110 | $this->getModuleGenerator($moduleName)->createController("UserController"); |
111 | 111 | |
112 | - $expectedFileName = Larapi::getModule($moduleName)->getControllers()->getPath() . '/UserController.php'; |
|
112 | + $expectedFileName = Larapi::getModule($moduleName)->getControllers()->getPath().'/UserController.php'; |
|
113 | 113 | $expectedStubName = "controller.stub"; |
114 | 114 | $expectedStubOptions = [ |
115 | 115 | 'CLASS' => 'UserController', |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $moduleName = "User"; |
131 | 131 | $this->getModuleGenerator($moduleName)->createListener("SendWelcomeMail", "UserRegisteredEvent"); |
132 | 132 | |
133 | - $expectedFileName = Larapi::getModule($moduleName)->getListeners()->getPath() . '/SendWelcomeMail.php'; |
|
133 | + $expectedFileName = Larapi::getModule($moduleName)->getListeners()->getPath().'/SendWelcomeMail.php'; |
|
134 | 134 | $expectedStubName = "listener.stub"; |
135 | 135 | $expectedStubOptions = [ |
136 | 136 | 'CLASS' => 'SendWelcomeMail', |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $fileName = "RandomUserJob"; |
165 | 165 | $this->getModuleGenerator($moduleName)->createJob($fileName, false); |
166 | 166 | |
167 | - $expectedFileName = Larapi::getModule($moduleName)->getJobs()->getPath() . "/$fileName.php"; |
|
167 | + $expectedFileName = Larapi::getModule($moduleName)->getJobs()->getPath()."/$fileName.php"; |
|
168 | 168 | $expectedStubName = "job-queued.stub"; |
169 | 169 | $expectedStubOptions = [ |
170 | 170 | 'NAMESPACE' => 'Modules\User\Jobs', |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | $this->getModuleGenerator($moduleName)->createCommand($fileName, $commandName); |
200 | 200 | |
201 | - $expectedFileName = Larapi::getModule($moduleName)->getCommands()->getPath() . "/$fileName.php"; |
|
201 | + $expectedFileName = Larapi::getModule($moduleName)->getCommands()->getPath()."/$fileName.php"; |
|
202 | 202 | $expectedStubName = "command.stub"; |
203 | 203 | $expectedStubOptions = [ |
204 | 204 | 'NAMESPACE' => 'Modules\User\Console', |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | $this->getModuleGenerator($moduleName)->createMiddleware($fileName); |
228 | 228 | |
229 | - $expectedFileName = Larapi::getModule($moduleName)->getMiddleWare()->getPath() . "/$fileName.php"; |
|
229 | + $expectedFileName = Larapi::getModule($moduleName)->getMiddleWare()->getPath()."/$fileName.php"; |
|
230 | 230 | $expectedStubName = "middleware.stub"; |
231 | 231 | $expectedStubOptions = [ |
232 | 232 | 'CLASS' => 'RandomMiddleware', |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | $this->getModuleGenerator($moduleName)->createServiceProvider($fileName); |
251 | 251 | |
252 | - $expectedFileName = Larapi::getModule($moduleName)->getServiceProviders()->getPath() . "/$fileName.php"; |
|
252 | + $expectedFileName = Larapi::getModule($moduleName)->getServiceProviders()->getPath()."/$fileName.php"; |
|
253 | 253 | $expectedStubName = "provider.stub"; |
254 | 254 | $expectedStubOptions = [ |
255 | 255 | 'NAMESPACE' => 'Modules\User\Providers', |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | $this->getModuleGenerator($moduleName)->createNotification($fileName); |
274 | 274 | |
275 | - $expectedFileName = Larapi::getModule($moduleName)->getNotifications()->getPath() . "/$fileName.php"; |
|
275 | + $expectedFileName = Larapi::getModule($moduleName)->getNotifications()->getPath()."/$fileName.php"; |
|
276 | 276 | $expectedStubName = "notification.stub"; |
277 | 277 | $expectedStubOptions = [ |
278 | 278 | 'NAMESPACE' => 'Modules\User\Notifications', |
@@ -293,9 +293,9 @@ discard block |
||
293 | 293 | $moduleName = "User"; |
294 | 294 | $fileName = "Address"; |
295 | 295 | |
296 | - $this->getModuleGenerator($moduleName)->createModel($moduleName . $fileName, false, true); |
|
296 | + $this->getModuleGenerator($moduleName)->createModel($moduleName.$fileName, false, true); |
|
297 | 297 | |
298 | - $expectedFileName = Larapi::getModule($moduleName)->getModels()->getPath() . "/$moduleName$fileName.php"; |
|
298 | + $expectedFileName = Larapi::getModule($moduleName)->getModels()->getPath()."/$moduleName$fileName.php"; |
|
299 | 299 | $expectedStubName = "model.stub"; |
300 | 300 | $expectedStubOptions = [ |
301 | 301 | 'NAMESPACE' => 'Modules\User\Entities', |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $this->getModuleGenerator($moduleName)->createPolicy($fileName); |
334 | 334 | |
335 | - $expectedFileName = Larapi::getModule($moduleName)->getPolicies()->getPath() . "/$fileName.php"; |
|
335 | + $expectedFileName = Larapi::getModule($moduleName)->getPolicies()->getPath()."/$fileName.php"; |
|
336 | 336 | $expectedStubName = "policy.stub"; |
337 | 337 | $expectedStubOptions = [ |
338 | 338 | 'NAMESPACE' => 'Modules\User\Policies', |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | |
356 | 356 | $this->getModuleGenerator($moduleName)->createTransformer($fileName, $model); |
357 | 357 | |
358 | - $expectedFileName = Larapi::getModule($moduleName)->getTransformers()->getPath() . "/$fileName.php"; |
|
358 | + $expectedFileName = Larapi::getModule($moduleName)->getTransformers()->getPath()."/$fileName.php"; |
|
359 | 359 | $expectedStubName = "transformer.stub"; |
360 | 360 | $expectedStubOptions = [ |
361 | 361 | 'NAMESPACE' => 'Modules\User\Transformers', |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | |
380 | 380 | $this->getModuleGenerator($moduleName)->createTest($fileName, 'unit'); |
381 | 381 | |
382 | - $expectedFileName = Larapi::getModule($moduleName)->getTests()->getPath() . "/$fileName.php"; |
|
382 | + $expectedFileName = Larapi::getModule($moduleName)->getTests()->getPath()."/$fileName.php"; |
|
383 | 383 | $expectedStubName = "unit-test.stub"; |
384 | 384 | $expectedStubOptions = [ |
385 | 385 | 'NAMESPACE' => 'Modules\User\Tests', |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | |
403 | 403 | $this->getModuleGenerator($moduleName)->createRequest($fileName); |
404 | 404 | |
405 | - $expectedFileName = Larapi::getModule($moduleName)->getRequests()->getPath() . "/$fileName.php"; |
|
405 | + $expectedFileName = Larapi::getModule($moduleName)->getRequests()->getPath()."/$fileName.php"; |
|
406 | 406 | $expectedStubName = "request.stub"; |
407 | 407 | $expectedStubOptions = [ |
408 | 408 | 'NAMESPACE' => 'Modules\User\Http\Requests', |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | |
425 | 425 | $this->getModuleGenerator($moduleName)->createRule($fileName); |
426 | 426 | |
427 | - $expectedFileName = Larapi::getModule($moduleName)->getRules()->getPath() . "/$fileName.php"; |
|
427 | + $expectedFileName = Larapi::getModule($moduleName)->getRules()->getPath()."/$fileName.php"; |
|
428 | 428 | $expectedStubName = "rule.stub"; |
429 | 429 | $expectedStubOptions = [ |
430 | 430 | 'NAMESPACE' => 'Modules\User\Rules', |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | |
447 | 447 | $this->getModuleGenerator($moduleName)->createSeeder($fileName); |
448 | 448 | |
449 | - $expectedFileName = Larapi::getModule($moduleName)->getSeeders()->getPath() . "/$fileName.php"; |
|
449 | + $expectedFileName = Larapi::getModule($moduleName)->getSeeders()->getPath()."/$fileName.php"; |
|
450 | 450 | $expectedStubName = "seeder.stub"; |
451 | 451 | $expectedStubOptions = [ |
452 | 452 | 'NAMESPACE' => 'Modules\User\Database\Seeders', |
@@ -464,11 +464,11 @@ discard block |
||
464 | 464 | public function testCreateRoute() |
465 | 465 | { |
466 | 466 | $moduleName = "Demo"; |
467 | - $routename = strtolower(Str::plural($moduleName)) . '.v1'; |
|
467 | + $routename = strtolower(Str::plural($moduleName)).'.v1'; |
|
468 | 468 | |
469 | 469 | $this->getModuleGenerator($moduleName)->createRoute(); |
470 | 470 | |
471 | - $expectedFileName = Larapi::getModule($moduleName)->getRoutes()->getPath() . "/$routename.php"; |
|
471 | + $expectedFileName = Larapi::getModule($moduleName)->getRoutes()->getPath()."/$routename.php"; |
|
472 | 472 | $expectedStubName = "route.stub"; |
473 | 473 | $expectedStubOptions = [ |
474 | 474 | 'MODULE_NAME' => 'Demo', |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | |
491 | 491 | $this->getModuleGenerator($moduleName)->createComposer(); |
492 | 492 | |
493 | - $expectedFileName = Larapi::getModule($moduleName)->getPath() . "/composer.json"; |
|
493 | + $expectedFileName = Larapi::getModule($moduleName)->getPath()."/composer.json"; |
|
494 | 494 | $expectedStubName = "composer.stub"; |
495 | 495 | $expectedStubOptions = [ |
496 | 496 | 'LOWER_MODULE_NAME' => 'demo', |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $pipeline = $this->generator->getPipeline(); |
56 | 56 | |
57 | 57 | $this->assertIsArray($pipeline); |
58 | - $this->assertEquals('Controller', $pipeline[0]['name']); |
|
58 | + $this->assertEquals('Controller', $pipeline[ 0 ][ 'name' ]); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | public function testModuleGeneration() |
@@ -107,14 +107,14 @@ discard block |
||
107 | 107 | $events = $this->getDispatchedEvents(TestGeneratedEvent::class); |
108 | 108 | $this->assertNotEmpty($events); |
109 | 109 | |
110 | - $this->assertEquals($events[0]->getClassName(), "AServiceTest"); |
|
111 | - $this->assertEquals($events[0]->getType(), "service"); |
|
110 | + $this->assertEquals($events[ 0 ]->getClassName(), "AServiceTest"); |
|
111 | + $this->assertEquals($events[ 0 ]->getType(), "service"); |
|
112 | 112 | |
113 | - $this->assertEquals($events[1]->getClassName(), "AHttpTest"); |
|
114 | - $this->assertEquals($events[1]->getType(), "http"); |
|
113 | + $this->assertEquals($events[ 1 ]->getClassName(), "AHttpTest"); |
|
114 | + $this->assertEquals($events[ 1 ]->getType(), "http"); |
|
115 | 115 | |
116 | - $this->assertEquals($events[2]->getClassName(), "AUnitTest"); |
|
117 | - $this->assertEquals($events[2]->getType(), "unit"); |
|
116 | + $this->assertEquals($events[ 2 ]->getClassName(), "AUnitTest"); |
|
117 | + $this->assertEquals($events[ 2 ]->getType(), "unit"); |
|
118 | 118 | |
119 | 119 | Event::assertDispatched(CommandGeneratedEvent::class, 1); |
120 | 120 |