Completed
Pull Request — master (#1430)
by
unknown
05:16
created
src/Module.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     {
204 204
         $lowerName = $this->getLowerName();
205 205
 
206
-        $langPath = $this->getPath() . '/Resources/lang';
206
+        $langPath = $this->getPath().'/Resources/lang';
207 207
 
208 208
         if (is_dir($langPath)) {
209 209
             $this->loadTranslationsFrom($langPath, $lowerName);
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
             $file = 'module.json';
224 224
         }
225 225
 
226
-        return Arr::get($this->moduleJson, $file, function () use ($file) {
227
-            return $this->moduleJson[$file] = new Json($this->getPath() . '/' . $file, $this->files);
226
+        return Arr::get($this->moduleJson, $file, function() use ($file) {
227
+            return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->files);
228 228
         });
229 229
     }
230 230
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      */
278 278
     protected function fireEvent($event): void
279 279
     {
280
-        $this->app['events']->dispatch(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]);
280
+        $this->app['events']->dispatch(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]);
281 281
     }
282 282
     /**
283 283
      * Register the aliases from this module.
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     protected function registerFiles(): void
303 303
     {
304 304
         foreach ($this->get('files', []) as $file) {
305
-            include $this->path . '/' . $file;
305
+            include $this->path.'/'.$file;
306 306
         }
307 307
     }
308 308
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
      */
408 408
     public function getExtraPath(string $path): string
409 409
     {
410
-        return $this->getPath() . '/' . $path;
410
+        return $this->getPath().'/'.$path;
411 411
     }
412 412
 
413 413
     /**
Please login to merge, or discard this patch.
src/Commands/ComponentClassMakeCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     protected function writeComponentViewTemplate()
51 51
     {
52
-        $this->call('module:make-component-view', ['name' => $this->argument('name') , 'module' => $this->argument('module')]);
52
+        $this->call('module:make-component-view', ['name' => $this->argument('name'), 'module' => $this->argument('module')]);
53 53
     }
54 54
 
55 55
     public function getDefaultNamespace(): string
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             'NAMESPACE'         => $this->getClassNamespace($module),
83 83
             'CLASS'             => $this->getClass(),
84 84
             'LOWER_NAME'        => $module->getLowerName(),
85
-            'COMPONENT_NAME'    => 'components.' . Str::lower($this->argument('name')),
85
+            'COMPONENT_NAME'    => 'components.'.Str::lower($this->argument('name')),
86 86
         ]))->render();
87 87
     }
88 88
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
95 95
         $factoryPath = GenerateConfigReader::read('component-class');
96 96
 
97
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
97
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
98 98
     }
99 99
 
100 100
     /**
@@ -102,6 +102,6 @@  discard block
 block discarded – undo
102 102
      */
103 103
     private function getFileName()
104 104
     {
105
-        return Str::studly($this->argument('name')) . '.php';
105
+        return Str::studly($this->argument('name')).'.php';
106 106
     }
107 107
 }
Please login to merge, or discard this patch.
src/Commands/RouteProviderMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
         $generatorPath = GenerateConfigReader::read('provider');
89 89
 
90
-        return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php';
90
+        return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php';
91 91
     }
92 92
 
93 93
     /**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     protected function getWebRoutesPath()
97 97
     {
98
-        return '/' . $this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php');
98
+        return '/'.$this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php');
99 99
     }
100 100
 
101 101
     /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     protected function getApiRoutesPath()
105 105
     {
106
-        return '/' . $this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php');
106
+        return '/'.$this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php');
107 107
     }
108 108
 
109 109
     public function getDefaultNamespace(): string
Please login to merge, or discard this patch.
src/Migrations/Migrator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function getMigrations($reverse = false)
90 90
     {
91
-        $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php');
91
+        $files = $this->laravel['files']->glob($this->getPath().'/*_*.php');
92 92
 
93 93
         // Once we have the array of files in the directory we will just remove the
94 94
         // extension and take the basename of the file which is all we need when
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             return [];
98 98
         }
99 99
 
100
-        $files = array_map(function ($file) {
100
+        $files = array_map(function($file) {
101 101
             return str_replace('.php', '', basename($file));
102 102
         }, $files);
103 103
 
@@ -202,8 +202,8 @@  discard block
 block discarded – undo
202 202
 
203 203
         $class = Str::studly($name);
204 204
 
205
-        if (!class_exists($class) && file_exists($this->getPath() . '/' . $file . '.php')) {
206
-            return include $this->getPath() . '/' . $file . '.php';
205
+        if (!class_exists($class) && file_exists($this->getPath().'/'.$file.'.php')) {
206
+            return include $this->getPath().'/'.$file.'.php';
207 207
         }
208 208
 
209 209
         return new $class();
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     {
219 219
         $path = $this->getPath();
220 220
         foreach ($files as $file) {
221
-            $this->laravel['files']->requireOnce($path . '/' . $file . '.php');
221
+            $this->laravel['files']->requireOnce($path.'/'.$file.'.php');
222 222
         }
223 223
     }
224 224
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
         $result = $query->orderBy('migration', 'desc')->get();
303 303
 
304
-        return collect($result)->map(function ($item) {
304
+        return collect($result)->map(function($item) {
305 305
             return (array) $item;
306 306
         })->pluck('migration');
307 307
     }
Please login to merge, or discard this patch.
src/Commands/ModelShowCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,9 +59,9 @@
 block discarded – undo
59 59
 
60 60
         $rootNamespace = config('modules.namespace');
61 61
 
62
-        $modelPath = glob($rootNamespace . DIRECTORY_SEPARATOR .
63
-            '*' . DIRECTORY_SEPARATOR .
64
-            config('modules.paths.generator.model.path') . DIRECTORY_SEPARATOR .
62
+        $modelPath = glob($rootNamespace.DIRECTORY_SEPARATOR.
63
+            '*'.DIRECTORY_SEPARATOR.
64
+            config('modules.paths.generator.model.path').DIRECTORY_SEPARATOR.
65 65
             "$model.php");
66 66
 
67 67
         if (!count($modelPath)) {
Please login to merge, or discard this patch.
src/Commands/GeneratorCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function handle(): int
36 36
     {
37 37
         $path = str_replace('\\', '/', $this->getDestinationFilePath());
38
-        $this->components->task("Generating file {$path}",function () use ($path) {
38
+        $this->components->task("Generating file {$path}", function() use ($path) {
39 39
 
40 40
             if (!$this->laravel['files']->isDirectory($dir = dirname($path))) {
41 41
                 $this->laravel['files']->makeDirectory($dir, 0777, true);
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
 
94 94
         $namespace = $this->laravel['modules']->config('namespace');
95 95
 
96
-        $namespace .= '\\' . $module->getStudlyName();
96
+        $namespace .= '\\'.$module->getStudlyName();
97 97
 
98
-        $namespace .= '\\' . $this->getDefaultNamespace();
98
+        $namespace .= '\\'.$this->getDefaultNamespace();
99 99
 
100
-        $namespace .= '\\' . $extra;
100
+        $namespace .= '\\'.$extra;
101 101
 
102 102
         $namespace = str_replace('/', '\\', $namespace);
103 103
 
Please login to merge, or discard this patch.
src/Commands/ListCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     public function handle(): int
29 29
     {
30 30
         $this->components->twoColumnDetail('<fg=gray>Status / Name</>', '<fg=gray>Path / priority</>');
31
-        collect($this->getRows())->each(function ($row) {
31
+        collect($this->getRows())->each(function($row) {
32 32
 
33 33
             $this->components->twoColumnDetail("[{$row[1]}] {$row[0]}", "{$row[3]} [{$row[2]}]");
34 34
         });
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                 continue;
361 361
             }
362 362
 
363
-            $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath();
363
+            $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath();
364 364
 
365 365
             $this->filesystem->makeDirectory($path, 0755, true);
366 366
             if (config('modules.stubs.gitkeep')) {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
      */
377 377
     public function generateGitKeep($path)
378 378
     {
379
-        $this->filesystem->put($path . '/.gitkeep', '');
379
+        $this->filesystem->put($path.'/.gitkeep', '');
380 380
     }
381 381
 
382 382
     /**
@@ -385,9 +385,9 @@  discard block
 block discarded – undo
385 385
     public function generateFiles()
386 386
     {
387 387
         foreach ($this->getFiles() as $stub => $file) {
388
-            $path = $this->module->getModulePath($this->getName()) . $file;
388
+            $path = $this->module->getModulePath($this->getName()).$file;
389 389
 
390
-            $this->component->task("Generating file {$path}",function () use ($stub, $path) {
390
+            $this->component->task("Generating file {$path}", function() use ($stub, $path) {
391 391
                 if (!$this->filesystem->isDirectory($dir = dirname($path))) {
392 392
                     $this->filesystem->makeDirectory($dir, 0775, true);
393 393
                 }
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 
413 413
         if (GenerateConfigReader::read('provider')->generate() === true) {
414 414
             $this->console->call('module:make-provider', [
415
-                'name' => $this->getName() . 'ServiceProvider',
415
+                'name' => $this->getName().'ServiceProvider',
416 416
                 'module' => $this->getName(),
417 417
                 '--master' => true,
418 418
             ]);
@@ -422,11 +422,11 @@  discard block
 block discarded – undo
422 422
         }
423 423
 
424 424
         if (GenerateConfigReader::read('controller')->generate() === true) {
425
-            $options = $this->type=='api' ? ['--api'=>true] : [];
425
+            $options = $this->type == 'api' ? ['--api'=>true] : [];
426 426
             $this->console->call('module:make-controller', [
427
-                'controller' => $this->getName() . 'Controller',
427
+                'controller' => $this->getName().'Controller',
428 428
                 'module' => $this->getName(),
429
-            ]+$options);
429
+            ] + $options);
430 430
         }
431 431
     }
432 432
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
     protected function getStubContents($stub)
441 441
     {
442 442
         return (new Stub(
443
-            '/' . $stub . '.stub',
443
+            '/'.$stub.'.stub',
444 444
             $this->getReplacement($stub)
445 445
         )
446 446
         )->render();
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
             }
480 480
         }
481 481
         foreach ($keys as $key) {
482
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
482
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
483 483
                 $replaces[$key] = $this->$method();
484 484
             } else {
485 485
                 $replaces[$key] = null;
@@ -494,9 +494,9 @@  discard block
 block discarded – undo
494 494
      */
495 495
     private function generateModuleJsonFile()
496 496
     {
497
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
497
+        $path = $this->module->getModulePath($this->getName()).'module.json';
498 498
 
499
-        $this->component->task("Generating file $path",function () use ($path) {
499
+        $this->component->task("Generating file $path", function() use ($path) {
500 500
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
501 501
                 $this->filesystem->makeDirectory($dir, 0775, true);
502 502
             }
@@ -511,13 +511,13 @@  discard block
 block discarded – undo
511 511
      */
512 512
     private function cleanModuleJsonFile()
513 513
     {
514
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
514
+        $path = $this->module->getModulePath($this->getName()).'module.json';
515 515
 
516 516
         $content = $this->filesystem->get($path);
517 517
         $namespace = $this->getModuleNamespaceReplacement();
518 518
         $studlyName = $this->getStudlyNameReplacement();
519 519
 
520
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
520
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
521 521
 
522 522
         $content = str_replace($provider, '', $content);
523 523
 
Please login to merge, or discard this patch.