Completed
Pull Request — master (#1692)
by
unknown
09:21
created
src/Commands/UpdateCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@
 block discarded – undo
60 60
 
61 61
         if ($name instanceof Module) {
62 62
             $module = $name;
63
-        }else {
63
+        } else {
64 64
             $module = $this->laravel['modules']->findOrFail($name);
65 65
         }
66 66
 
67
-        $this->components->task("Updating {$module->getName()} module", function () use ($module) {
67
+        $this->components->task("Updating {$module->getName()} module", function() use ($module) {
68 68
             $this->laravel['modules']->update($module);
69 69
         });
70 70
         $this->laravel['modules']->update($name);
Please login to merge, or discard this patch.
src/Commands/EnableCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
         $this->components->info('Enabling module ...');
32 32
 
33
-        if ($name = $this->argument('module') ) {
33
+        if ($name = $this->argument('module')) {
34 34
             $this->enable($name);
35 35
 
36 36
             return 0;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         if ($name instanceof Module) {
68 68
             $module = $name;
69
-        }else {
69
+        } else {
70 70
             $module = $this->laravel['modules']->findOrFail($name);
71 71
         }
72 72
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             $module->enable();
75 75
 
76 76
             $this->components->info("Module [{$module}] enabled successful.");
77
-        }else {
77
+        } else {
78 78
             $this->components->warn("Module [{$module}] has already enabled.");
79 79
         }
80 80
 
Please login to merge, or discard this patch.
src/Commands/DumpCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $this->components->info('Generating optimized autoload modules.');
31 31
 
32
-        if ($name = $this->argument('module') ) {
32
+        if ($name = $this->argument('module')) {
33 33
             $this->dump($name);
34 34
 
35 35
             return 0;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $module = $this->laravel['modules']->findOrFail($name);
64 64
         }
65 65
 
66
-        $this->components->task("$module", function () use ($module) {
66
+        $this->components->task("$module", function() use ($module) {
67 67
             chdir($module->getPath());
68 68
 
69 69
             passthru('composer dump -o -n -q');
Please login to merge, or discard this patch.
src/Commands/FactoryMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         $factoryPath = GenerateConfigReader::read('factory');
71 71
 
72
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
72
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
73 73
     }
74 74
 
75 75
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     private function getFileName()
79 79
     {
80
-        return Str::studly($this->argument('name')) . 'Factory.php';
80
+        return Str::studly($this->argument('name')).'Factory.php';
81 81
     }
82 82
 
83 83
     /**
@@ -111,6 +111,6 @@  discard block
 block discarded – undo
111 111
 
112 112
         $path = str_replace('/', '\\', $path);
113 113
 
114
-        return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path;
114
+        return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path;
115 115
     }
116 116
 }
Please login to merge, or discard this patch.
src/Commands/CheckLangCommand.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function handle(): int
33 33
     {
34 34
 
35
-        $this->langPath = DIRECTORY_SEPARATOR . config('modules.paths.generator.lang.path', 'Resources/lang');
35
+        $this->langPath = DIRECTORY_SEPARATOR.config('modules.paths.generator.lang.path', 'Resources/lang');
36 36
 
37 37
         $this->components->alert('Checking languages ...');
38 38
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         $directories = $this->getDirectories($module);
82 82
 
83
-        if (! $directories) {
83
+        if (!$directories) {
84 84
             return;
85 85
         }
86 86
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     private function getLangFiles($module)
106 106
     {
107 107
         $files = [];
108
-        $path  = $module->getPath() . $this->langPath;
108
+        $path  = $module->getPath().$this->langPath;
109 109
         if (is_dir($path)) {
110 110
             $files = array_merge($files, $this->laravel['files']->all($path));
111 111
         }
@@ -116,17 +116,17 @@  discard block
 block discarded – undo
116 116
     private function getDirectories($module)
117 117
     {
118 118
         $moduleName = $module->getStudlyName();
119
-        $path       = $module->getPath() . '/Resources/lang';
119
+        $path       = $module->getPath().'/Resources/lang';
120 120
         if (is_dir($path)) {
121 121
             $directories = $this->laravel['files']->directories($path);
122
-            $directories = array_map(function ($directory) use ($moduleName) {
122
+            $directories = array_map(function($directory) use ($moduleName) {
123 123
                 return [
124 124
                     'name'   => basename($directory),
125 125
                     'module' => $moduleName,
126 126
                     'path'   => $directory,
127
-                    'files'  => array_map(function ($file) {
127
+                    'files'  => array_map(function($file) {
128 128
                         return basename($file);
129
-                    }, \File::glob($directory . DIRECTORY_SEPARATOR . "*")),
129
+                    }, \File::glob($directory.DIRECTORY_SEPARATOR."*")),
130 130
                 ];
131 131
             }, $directories);
132 132
         }
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 
152 152
         $uniqeLangFiles = $directories->pluck('files')->flatten()->unique()->values();
153 153
 
154
-        $directories->each(function ($directory) use ($uniqeLangFiles, &$missingFilesMessage) {
154
+        $directories->each(function($directory) use ($uniqeLangFiles, &$missingFilesMessage) {
155 155
 
156 156
             $missingFiles = $uniqeLangFiles->diff($directory['files']);
157 157
 
158 158
             if ($missingFiles->count() > 0) {
159
-                $missingFiles->each(function ($missingFile) use ($directory, &$missingFilesMessage) {
159
+                $missingFiles->each(function($missingFile) use ($directory, &$missingFilesMessage) {
160 160
                     $missingFilesMessage[$directory['name']][] = " {$directory['module']} - Missing language file: {$directory['name']}/{$missingFile}";
161 161
                 });
162 162
             }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
         if (count($missingFilesMessage) > 0) {
167 167
 
168
-            collect($missingFilesMessage)->each(function ($messages, $langDirectory) {
168
+            collect($missingFilesMessage)->each(function($messages, $langDirectory) {
169 169
 
170 170
                 $this->components->error("Missing language files in $langDirectory directory");
171 171
 
@@ -189,22 +189,22 @@  discard block
 block discarded – undo
189 189
 
190 190
 
191 191
         $missingKeysMessage = [];
192
-        $directories->each(function ($directory) use ($uniqeLangFiles, $langDirectories, &$missingKeysMessage) {
192
+        $directories->each(function($directory) use ($uniqeLangFiles, $langDirectories, &$missingKeysMessage) {
193 193
 
194
-            $uniqeLangFiles->each(function ($file) use ($directory, $langDirectories, &$missingKeysMessage) {
195
-                $langKeys = $this->getLangKeys($directory['path'] . DIRECTORY_SEPARATOR . $file);
194
+            $uniqeLangFiles->each(function($file) use ($directory, $langDirectories, &$missingKeysMessage) {
195
+                $langKeys = $this->getLangKeys($directory['path'].DIRECTORY_SEPARATOR.$file);
196 196
 
197 197
                 if ($langKeys == false) {
198 198
                     return;
199 199
                 }
200 200
 
201
-                $langDirectories->each(function ($langDirectory) use ($directory, $file, $langKeys, &$missingKeysMessage) {
201
+                $langDirectories->each(function($langDirectory) use ($directory, $file, $langKeys, &$missingKeysMessage) {
202 202
 
203 203
                     if ($directory['name'] != $langDirectory) {
204 204
 
205 205
                         $basePath = str_replace($directory['name'], $langDirectory, $directory['path']);
206 206
 
207
-                        $otherLangKeys = $this->getLangKeys($basePath . DIRECTORY_SEPARATOR . $file);
207
+                        $otherLangKeys = $this->getLangKeys($basePath.DIRECTORY_SEPARATOR.$file);
208 208
 
209 209
                         if ($otherLangKeys == false) {
210 210
                             return;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                         $missingKeys = $langKeys->diff($otherLangKeys);
214 214
                         if ($missingKeys->count() > 0) {
215 215
 
216
-                            $missingKeys->each(function ($missingKey) use ($directory, $langDirectory, $file, &$missingKeysMessage) {
216
+                            $missingKeys->each(function($missingKey) use ($directory, $langDirectory, $file, &$missingKeysMessage) {
217 217
                                 $missingKeysMessage[$langDirectory][] = " {$directory['module']} - Missing language key: {$langDirectory}/{$file} | key: $missingKey";
218 218
                             });
219 219
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
         if (count($missingKeysMessage) > 0) {
228 228
 
229
-            collect($missingKeysMessage)->each(function ($messages, $langDirectory) {
229
+            collect($missingKeysMessage)->each(function($messages, $langDirectory) {
230 230
 
231 231
                 $this->components->error("Missing language keys for directory $langDirectory:");
232 232
 
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,16 +3,16 @@  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($name, $path = '')
8 8
     {
9 9
         $module = app('modules')->find($name);
10 10
 
11
-        return $module->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);
11
+        return $module->getPath().($path ? DIRECTORY_SEPARATOR . $path : $path);
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
      *
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
      */
22 22
     function config_path($path = '')
23 23
     {
24
-        return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
24
+        return app()->basePath().'/config'.($path ? DIRECTORY_SEPARATOR . $path : $path);
25 25
     }
26 26
 }
27 27
 
28
-if (! function_exists('public_path')) {
28
+if (!function_exists('public_path')) {
29 29
     /**
30 30
      * Get the path to the public folder.
31 31
      *
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
      */
35 35
     function public_path($path = '')
36 36
     {
37
-        return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
37
+        return app()->make('path.public').($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
38 38
     }
39 39
 }
40 40
 
41
-if (! function_exists('module_vite')) {
41
+if (!function_exists('module_vite')) {
42 42
     /**
43 43
      * support for vite
44 44
      */
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
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function decodeContents()
122 122
     {
123
-        $attributes =  json_decode($this->getContents(), 1);
123
+        $attributes = json_decode($this->getContents(), 1);
124 124
 
125 125
         // any JSON parsing errors should throw an exception
126 126
         if (json_last_error() > 0) {
127
-            throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg());
127
+            throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg());
128 128
         }
129 129
 
130 130
         return $attributes;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             return $this->decodeContents();
143 143
         }
144 144
 
145
-        return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function () {
145
+        return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function() {
146 146
             return $this->decodeContents();
147 147
         });
148 148
     }
Please login to merge, or discard this patch.
src/Migrations/Migrator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
     public function getMigrations($reverse = false)
100 100
     {
101 101
         if (!empty($this->subpath)) {
102
-            $files = $this->laravel['files']->glob($this->getPath() . '/' . $this->subpath);
102
+            $files = $this->laravel['files']->glob($this->getPath().'/'.$this->subpath);
103 103
         } else {
104
-            $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php');
104
+            $files = $this->laravel['files']->glob($this->getPath().'/*_*.php');
105 105
         }
106 106
 
107 107
         // Once we have the array of files in the directory we will just remove the
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             return [];
112 112
         }
113 113
 
114
-        $files = array_map(function ($file) {
114
+        $files = array_map(function($file) {
115 115
             return str_replace('.php', '', basename($file));
116 116
         }, $files);
117 117
 
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
 
217 217
         $class = Str::studly($name);
218 218
 
219
-        if (!class_exists($class) && file_exists($this->getPath() . '/' . $file . '.php')) {
220
-            return include $this->getPath() . '/' . $file . '.php';
219
+        if (!class_exists($class) && file_exists($this->getPath().'/'.$file.'.php')) {
220
+            return include $this->getPath().'/'.$file.'.php';
221 221
         }
222 222
 
223 223
         return new $class();
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     {
233 233
         $path = $this->getPath();
234 234
         foreach ($files as $file) {
235
-            $this->laravel['files']->requireOnce($path . '/' . $file . '.php');
235
+            $this->laravel['files']->requireOnce($path.'/'.$file.'.php');
236 236
         }
237 237
     }
238 238
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
         $result = $query->orderBy('migration', 'desc')->get();
317 317
 
318
-        return collect($result)->map(function ($item) {
318
+        return collect($result)->map(function($item) {
319 319
             return (array) $item;
320 320
         })->pluck('migration');
321 321
     }
Please login to merge, or discard this patch.
src/Commands/DisableCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $this->components->info('Disabling module ...');
38 38
         
39 39
         if (count($this->argument('module'))) {
40
-            foreach($this->argument('module') as $name) {
40
+            foreach ($this->argument('module') as $name) {
41 41
                 $this->disable($name);
42 42
             }
43 43
             return 0;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         if ($name instanceof Module) {
75 75
             $module = $name;
76
-        }else {
76
+        } else {
77 77
             $module = $this->laravel['modules']->findOrFail($name);
78 78
         }
79 79
 
Please login to merge, or discard this patch.