Completed
Pull Request — master (#1380)
by Felipe
06:23
created
src/Module.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function getStudlyNameWithSuffix(): string
116 116
     {
117
-        return Str::studly($this->name . self::MODULE_SUFFIX);
117
+        return Str::studly($this->name.self::MODULE_SUFFIX);
118 118
     }
119 119
 
120 120
     /**
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     {
217 217
         $lowerName = $this->getLowerName();
218 218
 
219
-        $langPath = $this->getPath() . '/Resources/lang';
219
+        $langPath = $this->getPath().'/Resources/lang';
220 220
 
221 221
         if (is_dir($langPath)) {
222 222
             $this->loadTranslationsFrom($langPath, $lowerName);
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
             $file = 'module.json';
237 237
         }
238 238
 
239
-        return Arr::get($this->moduleJson, $file, function () use ($file) {
240
-            return $this->moduleJson[$file] = new Json($this->getPath() . '/' . $file, $this->files);
239
+        return Arr::get($this->moduleJson, $file, function() use ($file) {
240
+            return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->files);
241 241
         });
242 242
     }
243 243
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
      */
296 296
     protected function fireEvent($event): void
297 297
     {
298
-        $this->app['events']->dispatch(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]);
298
+        $this->app['events']->dispatch(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]);
299 299
     }
300 300
     /**
301 301
      * Register the aliases from this module.
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     protected function registerFiles(): void
321 321
     {
322 322
         foreach ($this->get('files', []) as $file) {
323
-            include $this->path . '/' . $file;
323
+            include $this->path.'/'.$file;
324 324
         }
325 325
     }
326 326
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
      */
426 426
     public function getExtraPath(string $path) : string
427 427
     {
428
-        return $this->getPath() . '/' . $path;
428
+        return $this->getPath().'/'.$path;
429 429
     }
430 430
 
431 431
     /**
Please login to merge, or discard this patch.
src/Commands/GeneratorCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,11 +91,11 @@
 block discarded – undo
91 91
 
92 92
         $namespace = $this->laravel['modules']->config('namespace');
93 93
 
94
-        $namespace .= '\\' . $module->getStudlyNameWithSuffix();
94
+        $namespace .= '\\'.$module->getStudlyNameWithSuffix();
95 95
 
96
-        $namespace .= '\\' . $this->getDefaultNamespace();
96
+        $namespace .= '\\'.$this->getDefaultNamespace();
97 97
 
98
-        $namespace .= '\\' . $extra;
98
+        $namespace .= '\\'.$extra;
99 99
 
100 100
         $namespace = str_replace('/', '\\', $namespace);
101 101
 
Please login to merge, or discard this patch.
src/Commands/RouteProviderMakeCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             'CLASS'                => $this->getFileName(),
63 63
             'MODULE_NAMESPACE'     => $this->laravel['modules']->config('namespace'),
64 64
             'MODULE'               => $this->getModuleName(),
65
-            'MODULE_SUFFIX'        => $this->getModuleName() . Module::MODULE_SUFFIX,
65
+            'MODULE_SUFFIX'        => $this->getModuleName().Module::MODULE_SUFFIX,
66 66
             'CONTROLLER_NAMESPACE' => $this->getControllerNameSpace(),
67 67
             'WEB_ROUTES_PATH'      => $this->getWebRoutesPath(),
68 68
             'API_ROUTES_PATH'      => $this->getApiRoutesPath(),
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
         $generatorPath = GenerateConfigReader::read('provider');
91 91
 
92
-        return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php';
92
+        return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php';
93 93
     }
94 94
 
95 95
     /**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      */
98 98
     protected function getWebRoutesPath()
99 99
     {
100
-        return '/' . $this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php');
100
+        return '/'.$this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php');
101 101
     }
102 102
 
103 103
     /**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     protected function getApiRoutesPath()
107 107
     {
108
-        return '/' . $this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php');
108
+        return '/'.$this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php');
109 109
     }
110 110
 
111 111
     public function getDefaultNamespace() : string
Please login to merge, or discard this patch.
src/Commands/ModelMakeCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 
60 60
         $string = '';
61 61
         foreach ($pieces as $i => $piece) {
62
-            if ($i+1 < count($pieces)) {
63
-                $string .= strtolower($piece) . '_';
62
+            if ($i + 1 < count($pieces)) {
63
+                $string .= strtolower($piece).'_';
64 64
             } else {
65 65
                 $string .= Str::plural(strtolower($piece));
66 66
             }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     private function handleOptionalMigrationOption()
103 103
     {
104 104
         if ($this->option('migration') === true) {
105
-            $migrationName = 'create_' . $this->createMigrationName() . '_table';
105
+            $migrationName = 'create_'.$this->createMigrationName().'_table';
106 106
             $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]);
107 107
         }
108 108
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
         $modelPath = GenerateConfigReader::read('model');
153 153
 
154
-        return $path . $modelPath->getPath() . '/' . $this->getModelName() . '.php';
154
+        return $path.$modelPath->getPath().'/'.$this->getModelName().'.php';
155 155
     }
156 156
 
157 157
     /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
             '/',
202 202
             '\\',
203 203
             $this->laravel['modules']->config('namespace')
204
-            . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . Module::MODULE_SUFFIX
205
-            . '\\' . $this->laravel['modules']->config('paths.generator.factory.path', 'Database/factories')
204
+            . '\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).Module::MODULE_SUFFIX
205
+            . '\\'.$this->laravel['modules']->config('paths.generator.factory.path', 'Database/factories')
206 206
         );
207 207
     }
208 208
 }
Please login to merge, or discard this patch.
src/Commands/FactoryMakeCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         $factoryPath = GenerateConfigReader::read('factory');
72 72
 
73
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
73
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
74 74
     }
75 75
 
76 76
     /**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     private function getFileName()
80 80
     {
81
-        return Str::studly($this->argument('name')) . 'Factory.php';
81
+        return Str::studly($this->argument('name')).'Factory.php';
82 82
     }
83 83
 
84 84
     /**
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
             '/',
113 113
             '\\',
114 114
             $this->laravel['modules']->config('namespace')
115
-            . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . Module::MODULE_SUFFIX
116
-            . '\\' . $this->laravel['modules']->config('paths.generator.model.path', 'Entities')
115
+            . '\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).Module::MODULE_SUFFIX
116
+            . '\\'.$this->laravel['modules']->config('paths.generator.model.path', 'Entities')
117 117
         );
118 118
     }
119 119
 }
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function getNameWithSuffix()
148 148
     {
149
-        return Str::studly($this->name . Module::MODULE_SUFFIX);
149
+        return Str::studly($this->name.Module::MODULE_SUFFIX);
150 150
     }
151 151
 
152 152
     /**
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                 continue;
343 343
             }
344 344
 
345
-            $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath();
345
+            $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath();
346 346
 
347 347
             $this->filesystem->makeDirectory($path, 0755, true);
348 348
             if (config('modules.stubs.gitkeep')) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
      */
359 359
     public function generateGitKeep($path)
360 360
     {
361
-        $this->filesystem->put($path . '/.gitkeep', '');
361
+        $this->filesystem->put($path.'/.gitkeep', '');
362 362
     }
363 363
 
364 364
     /**
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     public function generateFiles()
368 368
     {
369 369
         foreach ($this->getFiles() as $stub => $file) {
370
-            $path = $this->module->getModulePath($this->getName()) . $file;
370
+            $path = $this->module->getModulePath($this->getName()).$file;
371 371
 
372 372
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
373 373
                 $this->filesystem->makeDirectory($dir, 0775, true);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 
395 395
         if (GenerateConfigReader::read('provider')->generate() === true) {
396 396
             $this->console->call('module:make-provider', [
397
-                'name' => $this->getName() . 'ServiceProvider',
397
+                'name' => $this->getName().'ServiceProvider',
398 398
                 'module' => $this->getName(),
399 399
                 '--master' => true,
400 400
             ]);
@@ -404,11 +404,11 @@  discard block
 block discarded – undo
404 404
         }
405 405
 
406 406
         if (GenerateConfigReader::read('controller')->generate() === true) {
407
-            $options = $this->type=='api'?['--api'=>true]:[];
407
+            $options = $this->type == 'api' ? ['--api'=>true] : [];
408 408
             $this->console->call('module:make-controller', [
409
-                'controller' => $this->getName() . 'Controller',
409
+                'controller' => $this->getName().'Controller',
410 410
                 'module' => $this->getName(),
411
-            ]+$options);
411
+            ] + $options);
412 412
         }
413 413
     }
414 414
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     protected function getStubContents($stub)
423 423
     {
424 424
         return (new Stub(
425
-            '/' . $stub . '.stub',
425
+            '/'.$stub.'.stub',
426 426
             $this->getReplacement($stub)
427 427
         )
428 428
         )->render();
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
             }
462 462
         }
463 463
         foreach ($keys as $key) {
464
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
464
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
465 465
                 $replaces[$key] = $this->$method();
466 466
             } else {
467 467
                 $replaces[$key] = null;
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      */
477 477
     private function generateModuleJsonFile()
478 478
     {
479
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
479
+        $path = $this->module->getModulePath($this->getName()).'module.json';
480 480
 
481 481
         if (!$this->filesystem->isDirectory($dir = dirname($path))) {
482 482
             $this->filesystem->makeDirectory($dir, 0775, true);
@@ -493,14 +493,14 @@  discard block
 block discarded – undo
493 493
      */
494 494
     private function cleanModuleJsonFile()
495 495
     {
496
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
496
+        $path = $this->module->getModulePath($this->getName()).'module.json';
497 497
 
498 498
         $content = $this->filesystem->get($path);
499 499
         $namespace = $this->getModuleNamespaceReplacement();
500 500
         $studlyName = $this->getStudlyNameReplacement();
501 501
         $studlyNameSuffix = $this->getStudlyNameSuffixReplacement();
502 502
 
503
-        $provider = '"' . $namespace . '\\\\' . $studlyNameSuffix . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
503
+        $provider = '"'.$namespace.'\\\\'.$studlyNameSuffix.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
504 504
 
505 505
         $content = str_replace($provider, '', $content);
506 506
 
Please login to merge, or discard this patch.