Completed
Pull Request — master (#2042)
by Solomon
07:40 queued 10s
created
src/ModuleManifest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getProviders(): array
56 56
     {
57
-        if (! empty($this->manifest)) {
57
+        if (!empty($this->manifest)) {
58 58
             return $this->manifest;
59 59
         }
60 60
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     {
78 78
         // todo check this section store on module.php or not?
79 79
         $this->getModulesData()
80
-            ->each(function (array $manifest) {
80
+            ->each(function(array $manifest) {
81 81
                 if (empty($manifest['files'])) {
82 82
                     return;
83 83
                 }
@@ -90,17 +90,17 @@  discard block
 block discarded – undo
90 90
 
91 91
     public function getModulesData(): Collection
92 92
     {
93
-        if (! empty(self::$manifestData) && ! app()->runningUnitTests()) {
93
+        if (!empty(self::$manifestData) && !app()->runningUnitTests()) {
94 94
             return self::$manifestData;
95 95
         }
96 96
 
97 97
         self::$manifestData = $this->paths
98
-            ->flatMap(function ($path) {
98
+            ->flatMap(function($path) {
99 99
                 $manifests = $this->files->glob("{$path}/module.json");
100 100
                 is_array($manifests) || $manifests = [];
101 101
 
102 102
                 return collect($manifests)
103
-                    ->map(function ($manifest) {
103
+                    ->map(function($manifest) {
104 104
                         return [
105 105
                             'module_directory' => dirname($manifest),
106 106
                             ...$this->files->json($manifest),
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use Illuminate\Foundation\Vite;
4 4
 use Illuminate\Support\Facades\Vite as ViteFacade;
5 5
 
6
-if (! function_exists('module_path')) {
6
+if (!function_exists('module_path')) {
7 7
     function module_path(string $name, string $path = ''): string
8 8
     {
9 9
         $module = app('modules')->find($name);
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     }
13 13
 }
14 14
 
15
-if (! function_exists('config_path')) {
15
+if (!function_exists('config_path')) {
16 16
     /**
17 17
      * Get the configuration path.
18 18
      */
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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
      */
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     }
33 33
 }
34 34
 
35
-if (! function_exists('module_vite')) {
35
+if (!function_exists('module_vite')) {
36 36
     /**
37 37
      * support for vite
38 38
      */
Please login to merge, or discard this patch.
src/Traits/PathNamespace.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
             $replace = $ds === '/' ? '\\' : '/';
16 16
         }
17 17
 
18
-        return Str::of($path)->trim($ds)->replace($replace, $ds)->explode($ds)->filter(fn ($segment) => ! empty($segment))->implode($ds);
18
+        return Str::of($path)->trim($ds)->replace($replace, $ds)->explode($ds)->filter(fn ($segment) => !empty($segment))->implode($ds);
19 19
     }
20 20
 
21 21
     /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function module_namespace(string $module, ?string $path = null): string
57 57
     {
58 58
         $module_namespace = rtrim(config('modules.namespace', config('modules.paths.modules')), '\\').'\\'.($module);
59
-        if (! empty($path)) {
59
+        if (!empty($path)) {
60 60
             $module_namespace .= '\\'.ltrim($path, '\\');
61 61
         }
62 62
 
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
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     /**
265 265
      * Set force status.
266 266
      */
267
-    public function setForce(bool|int $force): self
267
+    public function setForce(bool | int $force): self
268 268
     {
269 269
         $this->force = $force;
270 270
 
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
         foreach ($this->getFiles() as $stub => $file) {
356 356
             $path = $this->module->getModulePath($this->getName()).$file;
357 357
 
358
-            $this->component->task("Generating file {$path}", function () use ($stub, $path) {
359
-                if (! $this->filesystem->isDirectory($dir = dirname($path))) {
358
+            $this->component->task("Generating file {$path}", function() use ($stub, $path) {
359
+                if (!$this->filesystem->isDirectory($dir = dirname($path))) {
360 360
                     $this->filesystem->makeDirectory($dir, 0775, true);
361 361
                 }
362 362
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
         $eventGeneratorConfig = GenerateConfigReader::read('event-provider');
399 399
         if (
400 400
             (is_null($eventGeneratorConfig->getPath()) && $providerGenerator->generate())
401
-            || (! is_null($eventGeneratorConfig->getPath()) && $eventGeneratorConfig->generate())
401
+            || (!is_null($eventGeneratorConfig->getPath()) && $eventGeneratorConfig->generate())
402 402
         ) {
403 403
             $this->console->call('module:make-event-provider', [
404 404
                 'module' => $this->getName(),
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
         $routeGeneratorConfig = GenerateConfigReader::read('route-provider');
418 418
         if (
419 419
             (is_null($routeGeneratorConfig->getPath()) && $providerGenerator->generate())
420
-            || (! is_null($routeGeneratorConfig->getPath()) && $routeGeneratorConfig->generate())
420
+            || (!is_null($routeGeneratorConfig->getPath()) && $routeGeneratorConfig->generate())
421 421
         ) {
422 422
             $this->console->call('module:route-provider', [
423 423
                 'module' => $this->getName(),
@@ -469,15 +469,15 @@  discard block
 block discarded – undo
469 469
     {
470 470
         $replacements = $this->module->config('stubs.replacements');
471 471
 
472
-        if (! isset($replacements['composer']['APP_PATH'])) {
472
+        if (!isset($replacements['composer']['APP_PATH'])) {
473 473
             $replacements['composer'][] = 'APP_PATH';
474 474
         }
475 475
 
476
-        if (! isset($replacements['composer']['APP_PATH_NAMESPACE'])) {
476
+        if (!isset($replacements['composer']['APP_PATH_NAMESPACE'])) {
477 477
             $replacements['composer'][] = 'APP_PATH_NAMESPACE';
478 478
         }
479 479
 
480
-        if (! isset($replacements[$stub])) {
480
+        if (!isset($replacements[$stub])) {
481 481
             return [];
482 482
         }
483 483
 
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
     {
518 518
         $path = $this->module->getModulePath($this->getName()).'module.json';
519 519
 
520
-        $this->component->task("Generating file $path", function () use ($path) {
521
-            if (! $this->filesystem->isDirectory($dir = dirname($path))) {
520
+        $this->component->task("Generating file $path", function() use ($path) {
521
+            if (!$this->filesystem->isDirectory($dir = dirname($path))) {
522 522
                 $this->filesystem->makeDirectory($dir, 0775, true);
523 523
             }
524 524
 
Please login to merge, or discard this patch.