Completed
Pull Request — master (#973)
by
unknown
03:35
created
src/helpers.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('module_path')) {
3
+if (!function_exists('module_path')) {
4 4
     function module_path($name, $path = '')
5 5
     {
6 6
         $module = app('modules')->find($name);
7 7
 
8
-        return $module->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);
8
+        return $module->getPath().($path ? DIRECTORY_SEPARATOR . $path : $path);
9 9
     }
10 10
 }
11 11
 
12
-if (! function_exists('config_path')) {
12
+if (!function_exists('config_path')) {
13 13
     /**
14 14
      * Get the configuration path.
15 15
      *
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
      */
19 19
     function config_path($path = '')
20 20
     {
21
-        return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
21
+        return app()->basePath().'/config'.($path ? DIRECTORY_SEPARATOR . $path : $path);
22 22
     }
23 23
 }
24 24
 
25
-if (! function_exists('public_path')) {
25
+if (!function_exists('public_path')) {
26 26
     /**
27 27
      * Get the path to the public folder.
28 28
      *
@@ -31,6 +31,6 @@  discard block
 block discarded – undo
31 31
      */
32 32
     function public_path($path = '')
33 33
     {
34
-        return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
34
+        return app()->make('path.public').($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
src/LaravelModulesServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function setupStubPath()
34 34
     {
35
-        Stub::setBasePath(__DIR__ . '/Commands/stubs');
35
+        Stub::setBasePath(__DIR__.'/Commands/stubs');
36 36
 
37
-        $this->app->booted(function ($app) {
37
+        $this->app->booted(function($app) {
38 38
             /** @var RepositoryInterface $moduleRepository */
39 39
             $moduleRepository = $app[RepositoryInterface::class];
40 40
             if ($moduleRepository->config('stubs.enabled') === true) {
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
      */
49 49
     protected function registerServices()
50 50
     {
51
-        $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) {
51
+        $this->app->singleton(Contracts\RepositoryInterface::class, function($app) {
52 52
             $path = $app['config']->get('modules.paths.modules');
53 53
 
54 54
             return new Laravel\LaravelFileRepository($app, $path);
55 55
         });
56
-        $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) {
56
+        $this->app->singleton(Contracts\ActivatorInterface::class, function($app) {
57 57
             $activator = $app['config']->get('modules.activator');
58
-            $class = $app['config']->get('modules.activators.' . $activator)['class'];
58
+            $class = $app['config']->get('modules.activators.'.$activator)['class'];
59 59
 
60 60
             if ($class === null) {
61 61
                 throw InvalidActivatorClass::missingConfig();
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
                 continue;
330 330
             }
331 331
 
332
-            $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath();
332
+            $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath();
333 333
 
334 334
             $this->filesystem->makeDirectory($path, 0755, true);
335 335
             if (config('modules.stubs.gitkeep')) {
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public function generateGitKeep($path)
347 347
     {
348
-        $this->filesystem->put($path . '/.gitkeep', '');
348
+        $this->filesystem->put($path.'/.gitkeep', '');
349 349
     }
350 350
 
351 351
     /**
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     public function generateFiles()
355 355
     {
356 356
         foreach ($this->getFiles() as $stub => $file) {
357
-            $path = $this->module->getModulePath($this->getName()) . $file;
357
+            $path = $this->module->getModulePath($this->getName()).$file;
358 358
 
359 359
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
360 360
                 $this->filesystem->makeDirectory($dir, 0775, true);
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
         if (GenerateConfigReader::read('provider')->generate() === true) {
383 383
             $this->console->call('module:make-provider', [
384
-                'name' => $this->getName() . 'ServiceProvider',
384
+                'name' => $this->getName().'ServiceProvider',
385 385
                 'module' => $this->getName(),
386 386
                 '--master' => true,
387 387
             ]);
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 
393 393
         if (GenerateConfigReader::read('controller')->generate() === true) {
394 394
             $this->console->call('module:make-controller', [
395
-                'controller' => $this->getName() . 'Controller',
395
+                'controller' => $this->getName().'Controller',
396 396
                 'module' => $this->getName(),
397 397
             ]);
398 398
         }
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     protected function getStubContents($stub)
409 409
     {
410 410
         return (new Stub(
411
-            '/' . $stub . '.stub',
411
+            '/'.$stub.'.stub',
412 412
             $this->getReplacement($stub)
413 413
         )
414 414
         )->render();
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
             }
448 448
         }
449 449
         foreach ($keys as $key) {
450
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
450
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
451 451
                 $replaces[$key] = $this->$method();
452 452
             } else {
453 453
                 $replaces[$key] = null;
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
      */
463 463
     private function generateModuleJsonFile()
464 464
     {
465
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
465
+        $path = $this->module->getModulePath($this->getName()).'module.json';
466 466
 
467 467
         if (!$this->filesystem->isDirectory($dir = dirname($path))) {
468 468
             $this->filesystem->makeDirectory($dir, 0775, true);
@@ -479,13 +479,13 @@  discard block
 block discarded – undo
479 479
      */
480 480
     private function cleanModuleJsonFile()
481 481
     {
482
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
482
+        $path = $this->module->getModulePath($this->getName()).'module.json';
483 483
 
484 484
         $content = $this->filesystem->get($path);
485 485
         $namespace = $this->getModuleNamespaceReplacement();
486 486
         $studlyName = $this->getStudlyNameReplacement();
487 487
 
488
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
488
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
489 489
 
490 490
         $content = str_replace($provider, '', $content);
491 491
 
Please login to merge, or discard this patch.
src/Support/Stub.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function getPath()
73 73
     {
74
-        $path = static::getBasePath() . $this->path;
74
+        $path = static::getBasePath().$this->path;
75 75
 
76
-        return file_exists($path) ? $path : __DIR__ . '/../Commands/stubs' . $this->path;
76
+        return file_exists($path) ? $path : __DIR__.'/../Commands/stubs'.$this->path;
77 77
     }
78 78
 
79 79
     /**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $contents = file_get_contents($this->getPath());
107 107
 
108 108
         foreach ($this->replaces as $search => $replace) {
109
-            $contents = str_replace('$' . strtoupper($search) . '$', $replace, $contents);
109
+            $contents = str_replace('$'.strtoupper($search).'$', $replace, $contents);
110 110
         }
111 111
 
112 112
         return $contents;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function saveTo($path, $filename)
134 134
     {
135
-        return (bool) file_put_contents($path . '/' . $filename, $this->getContents());
135
+        return (bool) file_put_contents($path.'/'.$filename, $this->getContents());
136 136
     }
137 137
 
138 138
     /**
Please login to merge, or discard this patch.
src/Commands/ListenerMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $eventPath = GenerateConfigReader::read('event');
94 94
 
95
-        return $this->getClassNamespace($module) . "\\" . $eventPath->getPath() . "\\" . $this->option('event');
95
+        return $this->getClassNamespace($module)."\\".$eventPath->getPath()."\\".$this->option('event');
96 96
     }
97 97
 
98 98
     /**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         $listenerPath = GenerateConfigReader::read('listener');
106 106
 
107
-        return $path . $listenerPath->getPath() . '/' . $this->getFileName() . '.php';
107
+        return $path.$listenerPath->getPath().'/'.$this->getFileName().'.php';
108 108
     }
109 109
 
110 110
     /**
Please login to merge, or discard this patch.
src/Commands/EventMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@
 block discarded – undo
46 46
      */
47 47
     public function getDestinationFilePath()
48 48
     {
49
-        $path       = $this->laravel['modules']->getModulePath($this->getModuleName());
49
+        $path = $this->laravel['modules']->getModulePath($this->getModuleName());
50 50
 
51 51
         $eventPath = GenerateConfigReader::read('event');
52 52
 
53
-        return $path . $eventPath->getPath() . '/' . $this->getFileName() . '.php';
53
+        return $path.$eventPath->getPath().'/'.$this->getFileName().'.php';
54 54
     }
55 55
 
56 56
     /**
Please login to merge, or discard this patch.