Completed
Pull Request — master (#1109)
by
unknown
02:00
created
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);
@@ -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
             ]);
@@ -393,11 +393,11 @@  discard block
 block discarded – undo
393 393
         }
394 394
 
395 395
         if (GenerateConfigReader::read('controller')->generate() === true) {
396
-            $options = $this->type=='api'?['--api'=>true]:[];
396
+            $options = $this->type == 'api' ? ['--api'=>true] : [];
397 397
             $this->console->call('module:make-controller', [
398
-                'controller' => $this->getName() . 'Controller',
398
+                'controller' => $this->getName().'Controller',
399 399
                 'module' => $this->getName(),
400
-            ]+$options);
400
+            ] + $options);
401 401
         }
402 402
     }
403 403
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     protected function getStubContents($stub)
412 412
     {
413 413
         return (new Stub(
414
-            '/' . $stub . '.stub',
414
+            '/'.$stub.'.stub',
415 415
             $this->getReplacement($stub)
416 416
         )
417 417
         )->render();
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
             }
451 451
         }
452 452
         foreach ($keys as $key) {
453
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
453
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
454 454
                 $replaces[$key] = $this->$method();
455 455
             } else {
456 456
                 $replaces[$key] = null;
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
      */
466 466
     private function generateModuleJsonFile()
467 467
     {
468
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
468
+        $path = $this->module->getModulePath($this->getName()).'module.json';
469 469
 
470 470
         if (!$this->filesystem->isDirectory($dir = dirname($path))) {
471 471
             $this->filesystem->makeDirectory($dir, 0775, true);
@@ -482,13 +482,13 @@  discard block
 block discarded – undo
482 482
      */
483 483
     private function cleanModuleJsonFile()
484 484
     {
485
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
485
+        $path = $this->module->getModulePath($this->getName()).'module.json';
486 486
 
487 487
         $content = $this->filesystem->get($path);
488 488
         $namespace = $this->getModuleNamespaceReplacement();
489 489
         $studlyName = $this->getStudlyNameReplacement();
490 490
 
491
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
491
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
492 492
 
493 493
         $content = str_replace($provider, '', $content);
494 494
 
Please login to merge, or discard this patch.
src/Commands/ModuleMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $success = true;
34 34
 
35 35
         foreach ($names as $name) {
36
-            $type = $this->getModuleType($this->option('plain'),$this->option('api'));
36
+            $type = $this->getModuleType($this->option('plain'), $this->option('api'));
37 37
             $code = with(new ModuleGenerator($name))
38 38
                 ->setFilesystem($this->laravel['files'])
39 39
                 ->setModule($this->laravel['modules'])
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         ];
77 77
     }
78 78
 
79
-    private function getModuleType($isPlain,$isApi){
80
-        return ($isPlain && $isApi)?'web':($isPlain?'plain':($isApi?'api':'web'));
79
+    private function getModuleType($isPlain, $isApi) {
80
+        return ($isPlain && $isApi) ? 'web' : ($isPlain ? 'plain' : ($isApi ? 'api' : 'web'));
81 81
     }
82 82
 }
Please login to merge, or discard this patch.