Completed
Pull Request — master (#1533)
by Joni
08:32
created
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.
src/Commands/GeneratorCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             $contents = $this->getTemplateContents();
44 44
 
45 45
             try {
46
-                $this->components->task("Generating file {$path}",function () use ($path,$contents) {
46
+                $this->components->task("Generating file {$path}", function() use ($path, $contents) {
47 47
                     $overwriteFile = $this->hasOption('force') ? $this->option('force') : false;
48 48
                     (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate();
49 49
                 });
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 
93 93
         $namespace = $this->laravel['modules']->config('namespace');
94 94
 
95
-        $namespace .= '\\' . $module->getStudlyName();
95
+        $namespace .= '\\'.$module->getStudlyName();
96 96
 
97
-        $namespace .= '\\' . $this->getDefaultNamespace();
97
+        $namespace .= '\\'.$this->getDefaultNamespace();
98 98
 
99
-        $namespace .= '\\' . $extra;
99
+        $namespace .= '\\'.$extra;
100 100
 
101 101
         $namespace = str_replace('/', '\\', $namespace);
102 102
 
Please login to merge, or discard this patch.
src/Activators/FileActivator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             return $this->readJson();
184 184
         }
185 185
 
186
-        return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->cacheKey, $this->cacheLifetime, function () {
186
+        return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->cacheKey, $this->cacheLifetime, function() {
187 187
             return $this->readJson();
188 188
         });
189 189
     }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     private function config(string $key, $default = null)
199 199
     {
200
-        return $this->config->get('modules.activators.file.' . $key, $default);
200
+        return $this->config->get('modules.activators.file.'.$key, $default);
201 201
     }
202 202
 
203 203
     /**
Please login to merge, or discard this patch.
src/FileRepository.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             $paths = array_merge($paths, $this->config('scan.paths'));
117 117
         }
118 118
 
119
-        $paths = array_map(function ($path) {
119
+        $paths = array_map(function($path) {
120 120
             return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*');
121 121
         }, $paths);
122 122
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function getCached()
202 202
     {
203
-        return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () {
203
+        return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() {
204 204
             return $this->toCollection()->toArray();
205 205
         });
206 206
     }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     {
290 290
         $modules = $this->allEnabled();
291 291
 
292
-        uasort($modules, function (Module $a, Module $b) use ($direction) {
292
+        uasort($modules, function(Module $a, Module $b) use ($direction) {
293 293
             if ($a->get('priority') === $b->get('priority')) {
294 294
                 return 0;
295 295
             }
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
     public function getModulePath($module)
419 419
     {
420 420
         try {
421
-            return $this->findOrFail($module)->getPath() . '/';
421
+            return $this->findOrFail($module)->getPath().'/';
422 422
         } catch (ModuleNotFoundException $e) {
423
-            return $this->getPath() . '/' . Str::studly($module) . '/';
423
+            return $this->getPath().'/'.Str::studly($module).'/';
424 424
         }
425 425
     }
426 426
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
      */
430 430
     public function assetPath(string $module): string
431 431
     {
432
-        return $this->config('paths.assets') . '/' . $module;
432
+        return $this->config('paths.assets').'/'.$module;
433 433
     }
434 434
 
435 435
     /**
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
      */
438 438
     public function config(string $key, $default = null)
439 439
     {
440
-        return $this->config->get('modules.' . $key, $default);
440
+        return $this->config->get('modules.'.$key, $default);
441 441
     }
442 442
 
443 443
     /**
@@ -527,9 +527,9 @@  discard block
 block discarded – undo
527 527
         }
528 528
         list($name, $url) = explode(':', $asset);
529 529
 
530
-        $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath());
530
+        $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath());
531 531
 
532
-        $url = $this->url->asset($baseUrl . "/{$name}/" . $url);
532
+        $url = $this->url->asset($baseUrl."/{$name}/".$url);
533 533
 
534 534
         return str_replace(['http://', 'https://'], '//', $url);
535 535
     }
Please login to merge, or discard this patch.
src/Commands/UpdateCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@
 block discarded – undo
60 60
 
61 61
         if ($name instanceof Module) {
62 62
             $module = $name;
63
-        }else {
63
+        } else {
64 64
             $module = $this->laravel['modules']->findOrFail($name);
65 65
         }
66 66
 
67
-        $this->components->task("Updating {$module->getName()} module", function () use ($module) {
67
+        $this->components->task("Updating {$module->getName()} module", function() use ($module) {
68 68
             $this->laravel['modules']->update($module);
69 69
         });
70 70
         $this->laravel['modules']->update($name);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
         if ($name instanceof Module) {
62 62
             $module = $name;
63
-        }else {
63
+        } else {
64 64
             $module = $this->laravel['modules']->findOrFail($name);
65 65
         }
66 66
 
Please login to merge, or discard this patch.
src/Commands/DisableCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $this->components->info('Disabling module ...');
31 31
 
32
-        if ($name = $this->argument('module') ) {
32
+        if ($name = $this->argument('module')) {
33 33
             $this->disable($name);
34 34
 
35 35
             return 0;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         if ($name instanceof Module) {
67 67
             $module = $name;
68
-        }else {
68
+        } else {
69 69
             $module = $this->laravel['modules']->findOrFail($name);
70 70
         }
71 71
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     {
66 66
         if ($name instanceof Module) {
67 67
             $module = $name;
68
-        }else {
68
+        } else {
69 69
             $module = $this->laravel['modules']->findOrFail($name);
70 70
         }
71 71
 
Please login to merge, or discard this patch.
src/Commands/EnableCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
         $this->components->info('Enabling module ...');
32 32
 
33
-        if ($name = $this->argument('module') ) {
33
+        if ($name = $this->argument('module')) {
34 34
             $this->enable($name);
35 35
 
36 36
             return 0;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         if ($name instanceof Module) {
68 68
             $module = $name;
69
-        }else {
69
+        } else {
70 70
             $module = $this->laravel['modules']->findOrFail($name);
71 71
         }
72 72
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             $module->enable();
75 75
 
76 76
             $this->components->info("Module [{$module}] enabled successful.");
77
-        }else {
77
+        } else {
78 78
             $this->components->warn("Module [{$module}] has already enabled.");
79 79
         }
80 80
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         if ($name instanceof Module) {
68 68
             $module = $name;
69
-        }else {
69
+        } else {
70 70
             $module = $this->laravel['modules']->findOrFail($name);
71 71
         }
72 72
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             $module->enable();
75 75
 
76 76
             $this->components->info("Module [{$module}] enabled successful.");
77
-        }else {
77
+        } else {
78 78
             $this->components->warn("Module [{$module}] has already enabled.");
79 79
         }
80 80
 
Please login to merge, or discard this patch.
src/Commands/DumpCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $this->components->info('Generating optimized autoload modules.');
31 31
 
32
-        if ($name = $this->argument('module') ) {
32
+        if ($name = $this->argument('module')) {
33 33
             $this->dump($name);
34 34
 
35 35
             return 0;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $module = $this->laravel['modules']->findOrFail($name);
64 64
         }
65 65
 
66
-        $this->components->task("$module", function () use ($module) {
66
+        $this->components->task("$module", function() use ($module) {
67 67
             chdir($module->getPath());
68 68
 
69 69
             passthru('composer dump -o -n -q');
Please login to merge, or discard this patch.
src/Commands/FactoryMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         $factoryPath = GenerateConfigReader::read('factory');
71 71
 
72
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
72
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
73 73
     }
74 74
 
75 75
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     private function getFileName()
79 79
     {
80
-        return Str::studly($this->argument('name')) . 'Factory.php';
80
+        return Str::studly($this->argument('name')).'Factory.php';
81 81
     }
82 82
 
83 83
     /**
@@ -111,6 +111,6 @@  discard block
 block discarded – undo
111 111
 
112 112
         $path = str_replace('/', '\\', $path);
113 113
 
114
-        return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path;
114
+        return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path;
115 115
     }
116 116
 }
Please login to merge, or discard this patch.