Completed
Pull Request — master (#1380)
by Felipe
07:16
created
src/Commands/ModuleMakeCommand.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@
 block discarded – undo
76 76
     }
77 77
 
78 78
     /**
79
-    * Get module type .
80
-    *
81
-    * @return string
82
-    */
79
+     * Get module type .
80
+     *
81
+     * @return string
82
+     */
83 83
     private function getModuleType()
84 84
     {
85 85
         $isPlain = $this->option('plain');
Please login to merge, or discard this patch.
src/Commands/ComponentViewMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
64 64
         $factoryPath = GenerateConfigReader::read('component-view');
65 65
 
66
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
66
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
67 67
     }
68 68
 
69 69
     /**
@@ -71,6 +71,6 @@  discard block
 block discarded – undo
71 71
      */
72 72
     private function getFileName()
73 73
     {
74
-        return Str::lower($this->argument('name')) . '.blade.php';
74
+        return Str::lower($this->argument('name')).'.blade.php';
75 75
     }
76 76
 }
Please login to merge, or discard this patch.
src/LaravelModulesServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $this->setupStubPath();
27 27
         $this->registerProviders();
28 28
 
29
-        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'modules');
29
+        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'modules');
30 30
     }
31 31
 
32 32
     /**
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function setupStubPath()
36 36
     {
37
-        $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__ . '/Commands/stubs';
37
+        $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__.'/Commands/stubs';
38 38
         Stub::setBasePath($path);
39 39
 
40
-        $this->app->booted(function ($app) {
40
+        $this->app->booted(function($app) {
41 41
             /** @var RepositoryInterface $moduleRepository */
42 42
             $moduleRepository = $app[RepositoryInterface::class];
43 43
             if ($moduleRepository->config('stubs.enabled') === true) {
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
      */
52 52
     protected function registerServices()
53 53
     {
54
-        $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) {
54
+        $this->app->singleton(Contracts\RepositoryInterface::class, function($app) {
55 55
             $path = $app['config']->get('modules.paths.modules');
56 56
 
57 57
             return new Laravel\LaravelFileRepository($app, $path);
58 58
         });
59
-        $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) {
59
+        $this->app->singleton(Contracts\ActivatorInterface::class, function($app) {
60 60
             $activator = $app['config']->get('modules.activator');
61
-            $class = $app['config']->get('modules.activators.' . $activator)['class'];
61
+            $class = $app['config']->get('modules.activators.'.$activator)['class'];
62 62
 
63 63
             if ($class === null) {
64 64
                 throw InvalidActivatorClass::missingConfig();
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/ModulesServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@
 block discarded – undo
36 36
      */
37 37
     protected function registerNamespaces()
38 38
     {
39
-        $configPath = __DIR__ . '/../config/config.php';
40
-        $stubsPath = dirname(__DIR__) . '/src/Commands/stubs';
39
+        $configPath = __DIR__.'/../config/config.php';
40
+        $stubsPath = dirname(__DIR__).'/src/Commands/stubs';
41 41
 
42 42
         $this->publishes([
43 43
             $configPath => config_path('modules.php'),
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
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     {
140 140
         if (
141 141
             $this->config->get('modules.suffix.enabled') === false
142
-            || ($folderSuffix && $this->config->get('modules.suffix.apply-to-folder')  === false)
142
+            || ($folderSuffix && $this->config->get('modules.suffix.apply-to-folder') === false)
143 143
         ) {
144 144
             return '';
145 145
         }
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
                 continue;
363 363
             }
364 364
 
365
-            $path = $this->module->getModulePath($this->getFolderName()) . '/' . $folder->getPath();
365
+            $path = $this->module->getModulePath($this->getFolderName()).'/'.$folder->getPath();
366 366
 
367 367
             $this->filesystem->makeDirectory($path, 0755, true);
368 368
             if (config('modules.stubs.gitkeep')) {
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function generateGitKeep($path)
380 380
     {
381
-        $this->filesystem->put($path . '/.gitkeep', '');
381
+        $this->filesystem->put($path.'/.gitkeep', '');
382 382
     }
383 383
 
384 384
     /**
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
     public function generateFiles()
388 388
     {
389 389
         foreach ($this->getFiles() as $stub => $file) {
390
-            $path = $this->module->getModulePath($this->getFolderName()) . $file;
390
+            $path = $this->module->getModulePath($this->getFolderName()).$file;
391 391
 
392 392
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
393 393
                 $this->filesystem->makeDirectory($dir, 0775, true);
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
         if (GenerateConfigReader::read('provider')->generate() === true) {
416 416
             $this->console->call('module:make-provider', [
417
-                'name' => $this->getName() . 'ServiceProvider',
417
+                'name' => $this->getName().'ServiceProvider',
418 418
                 'module' => $this->getName(),
419 419
                 '--master' => true,
420 420
             ]);
@@ -424,11 +424,11 @@  discard block
 block discarded – undo
424 424
         }
425 425
 
426 426
         if (GenerateConfigReader::read('controller')->generate() === true) {
427
-            $options = $this->type=='api'?['--api'=>true]:[];
427
+            $options = $this->type == 'api' ? ['--api'=>true] : [];
428 428
             $this->console->call('module:make-controller', [
429
-                    'controller' => $this->getName() . 'Controller',
429
+                    'controller' => $this->getName().'Controller',
430 430
                     'module' => $this->getName(),
431
-                ]+$options);
431
+                ] + $options);
432 432
         }
433 433
     }
434 434
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     protected function getStubContents($stub)
443 443
     {
444 444
         return (new Stub(
445
-            '/' . $stub . '.stub',
445
+            '/'.$stub.'.stub',
446 446
             $this->getReplacement($stub)
447 447
         )
448 448
         )->render();
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             }
482 482
         }
483 483
         foreach ($keys as $key) {
484
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
484
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
485 485
                 $replaces[$key] = $this->$method();
486 486
             } else {
487 487
                 $replaces[$key] = null;
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
      */
497 497
     private function generateModuleJsonFile()
498 498
     {
499
-        $path = $this->module->getModulePath($this->getFolderName()) . 'module.json';
499
+        $path = $this->module->getModulePath($this->getFolderName()).'module.json';
500 500
 
501 501
         if (!$this->filesystem->isDirectory($dir = dirname($path))) {
502 502
             $this->filesystem->makeDirectory($dir, 0775, true);
@@ -513,13 +513,13 @@  discard block
 block discarded – undo
513 513
      */
514 514
     private function cleanModuleJsonFile()
515 515
     {
516
-        $path = $this->module->getModulePath($this->getFolderName()) . 'module.json';
516
+        $path = $this->module->getModulePath($this->getFolderName()).'module.json';
517 517
 
518 518
         $content = $this->filesystem->get($path);
519 519
         $namespace = $this->getModuleNamespaceReplacement();
520 520
         $studlyName = $this->getStudlyNameReplacement();
521 521
 
522
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
522
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
523 523
 
524 524
         $content = str_replace($provider, '', $content);
525 525
 
Please login to merge, or discard this patch.