Completed
Pull Request — master (#1088)
by
unknown
07:26
created
src/LaravelModulesServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function setupStubPath()
34 34
     {
35
-        $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__ . '/Commands/stubs';
35
+        $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__.'/Commands/stubs';
36 36
         Stub::setBasePath($path);
37 37
 
38
-        $this->app->booted(function ($app) {
38
+        $this->app->booted(function($app) {
39 39
             /** @var RepositoryInterface $moduleRepository */
40 40
             $moduleRepository = $app[RepositoryInterface::class];
41 41
             if ($moduleRepository->config('stubs.enabled') === true) {
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
      */
50 50
     protected function registerServices()
51 51
     {
52
-        $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) {
52
+        $this->app->singleton(Contracts\RepositoryInterface::class, function($app) {
53 53
             $path = $app['config']->get('modules.paths.modules');
54 54
 
55 55
             return new Laravel\LaravelFileRepository($app, $path);
56 56
         });
57
-        $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) {
57
+        $this->app->singleton(Contracts\ActivatorInterface::class, function($app) {
58 58
             $activator = $app['config']->get('modules.activator');
59
-            $class = $app['config']->get('modules.activators.' . $activator)['class'];
59
+            $class = $app['config']->get('modules.activators.'.$activator)['class'];
60 60
 
61 61
             if ($class === null) {
62 62
                 throw InvalidActivatorClass::missingConfig();
Please login to merge, or discard this patch.
src/Commands/MigrateStatusCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         }
50 50
 
51 51
         foreach ($this->module->getOrdered($this->option('direction')) as $module) {
52
-            $this->line('Running for module: <info>' . $module->getName() . '</info>');
52
+            $this->line('Running for module: <info>'.$module->getName().'</info>');
53 53
             $this->migrateStatus($module);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/Commands/ListenerMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 
78 78
     protected function getEventName(Module $module)
79 79
     {
80
-        $namespace = $this->laravel['modules']->config('namespace') . "\\" . $module->getStudlyName();
80
+        $namespace = $this->laravel['modules']->config('namespace')."\\".$module->getStudlyName();
81 81
         $eventPath = GenerateConfigReader::read('event');
82 82
 
83
-        $eventName = $namespace . "\\" . $eventPath->getPath() . "\\" . $this->option('event');
83
+        $eventName = $namespace."\\".$eventPath->getPath()."\\".$this->option('event');
84 84
 
85 85
         return str_replace('/', '\\', $eventName);
86 86
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         $listenerPath = GenerateConfigReader::read('listener');
93 93
 
94
-        return $path . $listenerPath->getPath() . '/' . $this->getFileName() . '.php';
94
+        return $path.$listenerPath->getPath().'/'.$this->getFileName().'.php';
95 95
     }
96 96
 
97 97
     /**
Please login to merge, or discard this patch.
src/Laravel/Module.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
         // This checks if we are running on a Laravel Vapor managed instance
19 19
         // and sets the path to a writable one (services path is not on a writable storage in Vapor).
20 20
         if (!is_null(env('VAPOR_MAINTENANCE_MODE', null))) {
21
-            return Str::replaceLast('config.php', $this->getSnakeName() . '_module.php', $this->app->getCachedConfigPath());
21
+            return Str::replaceLast('config.php', $this->getSnakeName().'_module.php', $this->app->getCachedConfigPath());
22 22
         }
23 23
 
24
-        return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath());
24
+        return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->getCachedServicesPath());
25 25
     }
26 26
 
27 27
     /**
Please login to merge, or discard this patch.
src/Providers/ConsoleServiceProvider.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,8 +124,7 @@
 block discarded – undo
124 124
 
125 125
         foreach (config('modules.commands', $this->commands) as $command) {
126 126
             $commands[] = Str::contains($command, $this->consoleNamespace) ?
127
-                $command :
128
-                $this->consoleNamespace  . "\\";
127
+                $command : $this->consoleNamespace."\\";
129 128
         }
130 129
 
131 130
         return $commands;
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
                 continue;
332 332
             }
333 333
 
334
-            $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath();
334
+            $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath();
335 335
 
336 336
             $this->filesystem->makeDirectory($path, 0755, true);
337 337
             if (config('modules.stubs.gitkeep')) {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
      */
348 348
     public function generateGitKeep($path)
349 349
     {
350
-        $this->filesystem->put($path . '/.gitkeep', '');
350
+        $this->filesystem->put($path.'/.gitkeep', '');
351 351
     }
352 352
 
353 353
     /**
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     public function generateFiles()
357 357
     {
358 358
         foreach ($this->getFiles() as $stub => $file) {
359
-            $path = $this->module->getModulePath($this->getName()) . $file;
359
+            $path = $this->module->getModulePath($this->getName()).$file;
360 360
 
361 361
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
362 362
                 $this->filesystem->makeDirectory($dir, 0775, true);
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
             $this->filesystem->put($path, $this->getStubContents($stub));
366 366
 
367
-            $this->console->info("Created " . basename($path));
367
+            $this->console->info("Created ".basename($path));
368 368
         }
369 369
     }
370 370
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
         if (GenerateConfigReader::read('provider')->generate() === true) {
385 385
             $this->console->call('module:make-provider', [
386
-                'name' => $this->getName() . 'ServiceProvider',
386
+                'name' => $this->getName().'ServiceProvider',
387 387
                 'module' => $this->getName(),
388 388
                 '--master' => true,
389 389
             ]);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 
395 395
         if (GenerateConfigReader::read('controller')->generate() === true) {
396 396
             $this->console->call('module:make-controller', [
397
-                'controller' => $this->getName() . 'Controller',
397
+                'controller' => $this->getName().'Controller',
398 398
                 'module' => $this->getName(),
399 399
             ]);
400 400
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     protected function getStubContents($stub)
411 411
     {
412 412
         return (new Stub(
413
-            '/' . $stub . '.stub',
413
+            '/'.$stub.'.stub',
414 414
             $this->getReplacement($stub)
415 415
         ))->render();
416 416
     }
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
             }
449 449
         }
450 450
         foreach ($keys as $key) {
451
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
451
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
452 452
                 $replaces[$key] = $this->$method();
453 453
             } else {
454 454
                 $replaces[$key] = null;
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
      */
464 464
     private function generateModuleJsonFile()
465 465
     {
466
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
466
+        $path = $this->module->getModulePath($this->getName()).'module.json';
467 467
 
468 468
         if (!$this->filesystem->isDirectory($dir = dirname($path))) {
469 469
             $this->filesystem->makeDirectory($dir, 0775, true);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 
472 472
         $this->filesystem->put($path, $this->getStubContents('json'));
473 473
 
474
-        $this->console->info("Created " . basename($path));
474
+        $this->console->info("Created ".basename($path));
475 475
     }
476 476
 
477 477
     /**
@@ -480,13 +480,13 @@  discard block
 block discarded – undo
480 480
      */
481 481
     private function cleanModuleJsonFile()
482 482
     {
483
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
483
+        $path = $this->module->getModulePath($this->getName()).'module.json';
484 484
 
485 485
         $content = $this->filesystem->get($path);
486 486
         $namespace = $this->getModuleNamespaceReplacement();
487 487
         $studlyName = $this->getStudlyNameReplacement();
488 488
 
489
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
489
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
490 490
 
491 491
         $content = str_replace($provider, '', $content);
492 492
 
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
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
             $overwriteFile = $this->hasOption('force') ? $this->option('force') : false;
61 61
             (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate();
62
-            $this->info("Created " . basename($path) . " file");
62
+            $this->info("Created ".basename($path)." file");
63 63
         } catch (FileAlreadyExistException $e) {
64 64
 
65 65
             $this->critical("File [ {$path} ] already exists.");
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 
105 105
         $namespace = $this->laravel['modules']->config('namespace');
106 106
 
107
-        $namespace .= '\\' . $module->getStudlyName();
107
+        $namespace .= '\\'.$module->getStudlyName();
108 108
 
109
-        $namespace .= '\\' . $this->getDefaultNamespace();
109
+        $namespace .= '\\'.$this->getDefaultNamespace();
110 110
 
111
-        $namespace .= '\\' . $extra;
111
+        $namespace .= '\\'.$extra;
112 112
 
113 113
         $namespace = str_replace('/', '\\', $namespace);
114 114
 
Please login to merge, or discard this patch.