Completed
Pull Request — master (#1811)
by
unknown
06:50
created
src/helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,16 +4,16 @@  discard block
 block discarded – undo
4 4
 use Illuminate\Foundation\Vite;
5 5
 use Illuminate\Support\Facades\Vite as ViteFacade;
6 6
 
7
-if (! function_exists('module_path')) {
7
+if (!function_exists('module_path')) {
8 8
     function module_path($name, $path = ''): string
9 9
     {
10 10
         $module = app('modules')->find($name);
11 11
 
12
-        return $module->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);
12
+        return $module->getPath().($path ? DIRECTORY_SEPARATOR . $path : $path);
13 13
     }
14 14
 }
15 15
 
16
-if (! function_exists('config_path')) {
16
+if (!function_exists('config_path')) {
17 17
     /**
18 18
      * Get the configuration path.
19 19
      *
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
      */
23 23
     function config_path(string $path = ''): string
24 24
     {
25
-        return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
25
+        return app()->basePath().'/config'.($path ? DIRECTORY_SEPARATOR . $path : $path);
26 26
     }
27 27
 }
28 28
 
29
-if (! function_exists('public_path')) {
29
+if (!function_exists('public_path')) {
30 30
     /**
31 31
      * Get the path to the public folder.
32 32
      *
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
      */
37 37
     function public_path(string $path = ''): string
38 38
     {
39
-        return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
39
+        return app()->make('path.public').($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
40 40
     }
41 41
 }
42 42
 
43
-if (! function_exists('module_vite')) {
43
+if (!function_exists('module_vite')) {
44 44
     /**
45 45
      * support for vite
46 46
      */
Please login to merge, or discard this patch.
src/Collection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public function toArray(): array
28 28
     {
29
-        return array_map(function ($value) {
29
+        return array_map(function($value) {
30 30
             if ($value instanceof Module) {
31 31
                 $attributes = $value->json()->getAttributes();
32 32
                 $attributes["path"] = $value->getPath();
Please login to merge, or discard this patch.
src/Json.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
      */
126 126
     public function decodeContents(): array
127 127
     {
128
-        $attributes =  json_decode($this->getContents(), 1);
128
+        $attributes = json_decode($this->getContents(), 1);
129 129
 
130 130
         // any JSON parsing errors should throw an exception
131 131
         if (json_last_error() > 0) {
132
-            throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg());
132
+            throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg());
133 133
         }
134 134
 
135 135
         return $attributes;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             return $this->decodeContents();
148 148
         }
149 149
 
150
-        return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function () {
150
+        return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function() {
151 151
             return $this->decodeContents();
152 152
         });
153 153
     }
Please login to merge, or discard this patch.
src/LumenModulesServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function setupStubPath(): void
35 35
     {
36
-        Stub::setBasePath(__DIR__ . '/Commands/stubs');
36
+        Stub::setBasePath(__DIR__.'/Commands/stubs');
37 37
 
38 38
         if (app('modules')->config('stubs.enabled') === true) {
39 39
             Stub::setBasePath(app('modules')->config('stubs.path'));
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
      */
46 46
     protected function registerServices(): void
47 47
     {
48
-        $this->app->singleton(RepositoryInterface::class, function ($app) {
48
+        $this->app->singleton(RepositoryInterface::class, function($app) {
49 49
             $path = $app['config']->get('modules.paths.modules');
50 50
 
51 51
             return new LumenFileRepository($app, $path);
52 52
         });
53 53
 
54
-        $this->app->singleton(ActivatorInterface::class, function ($app) {
54
+        $this->app->singleton(ActivatorInterface::class, function($app) {
55 55
             $activator = $app['config']->get('modules.activator');
56
-            $class = $app['config']->get('modules.activators.' . $activator)['class'];
56
+            $class = $app['config']->get('modules.activators.'.$activator)['class'];
57 57
 
58 58
             return new $class($app);
59 59
         });
Please login to merge, or discard this patch.
src/Commands/Make/ModelMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $string = '';
63 63
         foreach ($pieces as $i => $piece) {
64 64
             if ($i + 1 < count($pieces)) {
65
-                $string .= strtolower($piece) . '_';
65
+                $string .= strtolower($piece).'_';
66 66
             } else {
67 67
                 $string .= Str::plural(strtolower($piece));
68 68
             }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     private function handleOptionalMigrationOption(): void
108 108
     {
109 109
         if ($this->option('migration') === true) {
110
-            $migrationName = 'create_' . $this->createMigrationName() . '_table';
110
+            $migrationName = 'create_'.$this->createMigrationName().'_table';
111 111
             $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]);
112 112
         }
113 113
     }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
         $modelPath = GenerateConfigReader::read('model');
200 200
 
201
-        return $path . $modelPath->getPath() . '/' . $this->getModelName() . '.php';
201
+        return $path.$modelPath->getPath().'/'.$this->getModelName().'.php';
202 202
     }
203 203
 
204 204
     private function getModelName(): string
Please login to merge, or discard this patch.
src/Commands/Make/RequestMakeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 
69 69
         $requestPath = GenerateConfigReader::read('request');
70 70
 
71
-        return $path . $requestPath->getPath() . '/' . $this->getFileName() . '.php';
71
+        return $path.$requestPath->getPath().'/'.$this->getFileName().'.php';
72 72
     }
73 73
 
74 74
     private function getFileName(): string
Please login to merge, or discard this patch.
src/Commands/Make/MigrationMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,15 +114,15 @@
 block discarded – undo
114 114
 
115 115
         $generatorPath = GenerateConfigReader::read('migration');
116 116
 
117
-        return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php';
117
+        return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php';
118 118
     }
119 119
 
120 120
     private function getFileName(): string
121 121
     {
122
-        return date('Y_m_d_His_') . $this->getSchemaName();
122
+        return date('Y_m_d_His_').$this->getSchemaName();
123 123
     }
124 124
 
125
-    private function getSchemaName(): bool|array|string|null
125
+    private function getSchemaName(): bool | array | string | null
126 126
     {
127 127
         return $this->argument('name');
128 128
     }
Please login to merge, or discard this patch.
src/Commands/Make/ObserverMakeCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         $path = str_replace('/', '\\', $path);
71 71
 
72
-        return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path;
72
+        return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path;
73 73
     }
74 74
 
75 75
     private function getModelName(): string
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
     private function getModelVariable(): string
81 81
     {
82
-        return '$' . Str::lower($this->argument('name'));
82
+        return '$'.Str::lower($this->argument('name'));
83 83
     }
84 84
 
85 85
     protected function getDestinationFilePath(): string
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
 
89 89
         $observerPath = GenerateConfigReader::read('observer');
90 90
 
91
-        return $path . $observerPath->getPath() . '/' . $this->getFileName();
91
+        return $path.$observerPath->getPath().'/'.$this->getFileName();
92 92
     }
93 93
 
94 94
     private function getFileName(): string
95 95
     {
96
-        return Str::studly($this->argument('name')) . 'Observer.php';
96
+        return Str::studly($this->argument('name')).'Observer.php';
97 97
     }
98 98
 
99 99
     public function handle(): int
Please login to merge, or discard this patch.
src/Commands/Make/ControllerMakeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
         $controllerPath = GenerateConfigReader::read('controller');
47 47
 
48
-        return $path . $controllerPath->getPath() . '/' . $this->getControllerName() . '.php';
48
+        return $path.$controllerPath->getPath().'/'.$this->getControllerName().'.php';
49 49
     }
50 50
 
51 51
     protected function getTemplateContents(): string
Please login to merge, or discard this patch.