Completed
Pull Request — master (#483)
by Nauris
03:12
created
src/Migrations/Migrator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@
 block discarded – undo
242 242
      *
243 243
      * @param string $migration
244 244
      *
245
-     * @return mixed
245
+     * @return boolean
246 246
      */
247 247
     public function log($migration)
248 248
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function getMigrations($reverse = false)
90 90
     {
91
-        $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php');
91
+        $files = $this->laravel['files']->glob($this->getPath().'/*_*.php');
92 92
 
93 93
         // Once we have the array of files in the directory we will just remove the
94 94
         // extension and take the basename of the file which is all we need when
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             return [];
98 98
         }
99 99
 
100
-        $files = array_map(function ($file) {
100
+        $files = array_map(function($file) {
101 101
             return str_replace('.php', '', basename($file));
102 102
         }, $files);
103 103
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     {
215 215
         $path = $this->getPath();
216 216
         foreach ($files as $file) {
217
-            $this->laravel['files']->requireOnce($path . '/' . $file . '.php');
217
+            $this->laravel['files']->requireOnce($path.'/'.$file.'.php');
218 218
         }
219 219
     }
220 220
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
         $result = $query->orderBy('migration', 'desc')->get();
299 299
 
300
-        return collect($result)->map(function ($item) {
300
+        return collect($result)->map(function($item) {
301 301
             return (array) $item;
302 302
         })->pluck('migration');
303 303
     }
Please login to merge, or discard this patch.
src/Support/Migrations/SchemaParser.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public function createField($column, $attributes, $type = 'add')
146 146
     {
147
-        $results = "\t\t\t" . '$table';
147
+        $results = "\t\t\t".'$table';
148 148
 
149 149
         foreach ($attributes as $key => $field) {
150 150
             if (in_array($column, $this->relationshipKeys)) {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             }
155 155
         }
156 156
 
157
-        return $results . ';' . PHP_EOL;
157
+        return $results.';'.PHP_EOL;
158 158
     }
159 159
 
160 160
     /**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     protected function addRelationColumn($key, $field, $column)
170 170
     {
171
-        $relatedColumn = snake_case(class_basename($field)) . '_id';
171
+        $relatedColumn = snake_case(class_basename($field)).'_id';
172 172
 
173 173
         $method = 'integer';
174 174
 
@@ -187,18 +187,18 @@  discard block
 block discarded – undo
187 187
     protected function addColumn($key, $field, $column)
188 188
     {
189 189
         if ($this->hasCustomAttribute($column)) {
190
-            return '->' . $field;
190
+            return '->'.$field;
191 191
         }
192 192
 
193 193
         if ($key == 0) {
194
-            return '->' . $field . "('" . $column . "')";
194
+            return '->'.$field."('".$column."')";
195 195
         }
196 196
 
197 197
         if (str_contains($field, '(')) {
198
-            return '->' . $field;
198
+            return '->'.$field;
199 199
         }
200 200
 
201
-        return '->' . $field . '()';
201
+        return '->'.$field.'()';
202 202
     }
203 203
 
204 204
     /**
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
     protected function removeColumn($key, $field, $column)
214 214
     {
215 215
         if ($this->hasCustomAttribute($column)) {
216
-            return '->' . $field;
216
+            return '->'.$field;
217 217
         }
218 218
 
219
-        return '->dropColumn(' . "'" . $column . "')";
219
+        return '->dropColumn('."'".$column."')";
220 220
     }
221 221
 
222 222
     /**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function getAttributes($column, $schema)
243 243
     {
244
-        $fields = str_replace($column . ':', '', $schema);
244
+        $fields = str_replace($column.':', '', $schema);
245 245
 
246 246
         return $this->hasCustomAttribute($column) ? $this->getCustomAttribute($column) : explode(':', $fields);
247 247
     }
Please login to merge, or discard this patch.
src/Commands/MigrateCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         }
48 48
 
49 49
         foreach ($this->module->getOrdered($this->option('direction')) as $module) {
50
-            $this->line('Running for module: <info>' . $module->getName() . '</info>');
50
+            $this->line('Running for module: <info>'.$module->getName().'</info>');
51 51
 
52 52
             $this->migrate($module);
53 53
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $path = str_replace(base_path(), '', (new Migrator($module))->getPath());
64 64
 
65 65
         if ($this->option('subpath')) {
66
-            $path = $path . "/" . $this->option("subpath");
66
+            $path = $path."/".$this->option("subpath");
67 67
         }
68 68
 
69 69
         $this->call('migrate', [
Please login to merge, or discard this patch.
src/Laravel/Module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     public function getCachedServicesPath()
16 16
     {
17
-        return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath());
17
+        return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->getCachedServicesPath());
18 18
     }
19 19
 
20 20
     /**
Please login to merge, or discard this patch.
src/Lumen/Module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function getCachedServicesPath()
14 14
     {
15
-        return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->basePath('storage/app/') . 'services.php');
15
+        return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->basePath('storage/app/').'services.php');
16 16
     }
17 17
 
18 18
     /**
Please login to merge, or discard this patch.
src/LaravelModulesServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function setupStubPath()
32 32
     {
33
-        Stub::setBasePath(__DIR__ . '/Commands/stubs');
33
+        Stub::setBasePath(__DIR__.'/Commands/stubs');
34 34
 
35
-        $this->app->booted(function ($app) {
35
+        $this->app->booted(function($app) {
36 36
             if ($app['modules']->config('stubs.enabled') === true) {
37 37
                 Stub::setBasePath($app['modules']->config('stubs.path'));
38 38
             }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function registerServices()
46 46
     {
47
-        $this->app->singleton('modules', function ($app) {
47
+        $this->app->singleton('modules', function($app) {
48 48
             $path = $app['config']->get('modules.paths.modules');
49 49
 
50 50
             return new \Nwidart\Modules\Laravel\Repository($app, $path);
Please login to merge, or discard this patch.
src/LumenModulesServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function setupStubPath()
32 32
     {
33
-        Stub::setBasePath(__DIR__ . '/Commands/stubs');
33
+        Stub::setBasePath(__DIR__.'/Commands/stubs');
34 34
 
35 35
         if (app('modules')->config('stubs.enabled') === true) {
36 36
             Stub::setBasePath(app('modules')->config('stubs.path'));
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     protected function registerServices()
44 44
     {
45
-        $this->app->singleton('modules', function ($app) {
45
+        $this->app->singleton('modules', function($app) {
46 46
             $path = $app['config']->get('modules.paths.modules');
47 47
 
48 48
             return new \Nwidart\Modules\Lumen\Repository($app, $path);
Please login to merge, or discard this patch.
src/ModulesServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      */
44 44
     protected function registerNamespaces()
45 45
     {
46
-        $configPath = __DIR__ . '/../config/config.php';
46
+        $configPath = __DIR__.'/../config/config.php';
47 47
 
48 48
         $this->mergeConfigFrom($configPath, 'modules');
49 49
         $this->publishes([
Please login to merge, or discard this patch.
src/Commands/CommandMakeCommand.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-     * @return mixed
62
+     * @return string
63 63
      */
64 64
     protected function getTemplateContents()
65 65
     {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     }
74 74
 
75 75
     /**
76
-     * @return mixed
76
+     * @return string
77 77
      */
78 78
     protected function getDestinationFilePath()
79 79
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 
101 101
         $commandPath = GenerateConfigReader::read('command');
102 102
 
103
-        return $path . $commandPath->getPath() . '/' . $this->getFileName() . '.php';
103
+        return $path.$commandPath->getPath().'/'.$this->getFileName().'.php';
104 104
     }
105 105
 
106 106
     /**
Please login to merge, or discard this patch.