Completed
Pull Request — master (#1163)
by
unknown
01:59
created
src/Providers/BootstrapServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
             $this->registerMigrations();
19 19
 
20 20
             $this->publishes([
21
-                __DIR__ . '/../../database/migrations' => database_path('migrations'),
21
+                __DIR__.'/../../database/migrations' => database_path('migrations'),
22 22
             ], 'module-migrations');
23 23
         }
24 24
     }
@@ -33,6 +33,6 @@  discard block
 block discarded – undo
33 33
 
34 34
     private function registerMigrations()
35 35
     {
36
-        $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
36
+        $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
database/migrations/2020_12_29_025357_create_modules_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('modules', function (Blueprint $table) {
16
+        Schema::create('modules', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('name');
19 19
             $table->string('path');
Please login to merge, or discard this patch.
src/Laravel/DatabaseModule.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * Get a specific data from json file by given the key.
91 91
      *
92 92
      * @param string $key
93
-     * @param null   $default
93
+     * @param string   $default
94 94
      *
95 95
      * @return mixed
96 96
      */
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     }
189 189
 
190 190
     /**
191
-     * @return mixed|null
191
+     * @return string
192 192
      */
193 193
     public function getVersion()
194 194
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
     {
203 203
 
204 204
         if (config('modules.database_management.update_file_to_database_when_updating')) {
205
-            $json = Json::make($this->getPath() . '/' . 'module.json');
205
+            $json = Json::make($this->getPath().'/'.'module.json');
206 206
             $data = $json->getAttributes();
207 207
 
208 208
             if (!isset($data['version'])) {
Please login to merge, or discard this patch.
src/Generators/DatabaseModuleGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function generate(): int
30 30
     {
31
-        return DB::transaction(function () {
31
+        return DB::transaction(function() {
32 32
             $name = $this->getName();
33 33
 
34 34
             if ($this->module->has($name)) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function generateFiles()
83 83
     {
84 84
         foreach ($this->getFiles() as $stub => $file) {
85
-            $path = $this->module->getModulePath($this->getName()) . $file;
85
+            $path = $this->module->getModulePath($this->getName()).$file;
86 86
 
87 87
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
88 88
                 $this->filesystem->makeDirectory($dir, 0775, true);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         if (GenerateConfigReader::read('provider')->generate() === true) {
115 115
             Artisan::call('module:make-provider', [
116
-                'name'     => $moduleName . 'ServiceProvider',
116
+                'name'     => $moduleName.'ServiceProvider',
117 117
                 'module'   => $moduleName,
118 118
                 '--master' => true,
119 119
             ]);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         if (GenerateConfigReader::read('controller')->generate() === true) {
126 126
             $options = $this->type == 'api' ? ['--api' => true] : [];
127 127
             Artisan::call('module:make-controller', [
128
-                    'controller' => $moduleName . 'Controller',
128
+                    'controller' => $moduleName.'Controller',
129 129
                     'module'     => $moduleName,
130 130
                 ] + $options);
131 131
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function generateModuleJsonFile()
138 138
     {
139
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
139
+        $path = $this->module->getModulePath($this->getName()).'module.json';
140 140
 
141 141
         if (!$this->filesystem->isDirectory($dir = dirname($path))) {
142 142
             $this->filesystem->makeDirectory($dir, 0775, true);
Please login to merge, or discard this patch.
src/Laravel/LaravelDatabaseRepository.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
     /**
72 72
      * Get module path for a specific module.
73 73
      *
74
-     * @param $name
74
+     * @param string $name
75 75
      *
76 76
      * @return string
77 77
      */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
     {
86 86
         $module = $this->find($name);
87 87
         if ($module) {
88
-            return $module->getPath() . '/';
88
+            return $module->getPath().'/';
89 89
         }
90 90
 
91
-        return $this->getPath() . '/' . Str::studly($name) . '/';
91
+        return $this->getPath().'/'.Str::studly($name).'/';
92 92
     }
93 93
 
94 94
     /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      */
139 139
     public function getCached()
140 140
     {
141
-        return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () {
141
+        return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() {
142 142
             return $this->getModel()->all();
143 143
         });
144 144
     }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             $allows = $this->getModel()->getFillable();
266 266
         }
267 267
 
268
-        return array_filter($attributes, function ($k) use ($allows) {
268
+        return array_filter($attributes, function($k) use ($allows) {
269 269
             return in_array($k, $allows);
270 270
         }, ARRAY_FILTER_USE_KEY);
271 271
     }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
     {
275 275
         $modules = $this->allEnabled();
276 276
 
277
-        uasort($modules, function (DatabaseModule $a, DatabaseModule $b) use ($direction) {
277
+        uasort($modules, function(DatabaseModule $a, DatabaseModule $b) use ($direction) {
278 278
             if ($a->get('priority') === $b->get('priority')) {
279 279
                 return 0;
280 280
             }
Please login to merge, or discard this patch.