Completed
Pull Request — master (#1409)
by Mohammad
09:04
created
src/Support/Migrations/SchemaParser.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function createField($column, $attributes, $type = 'add')
148 148
     {
149
-        $results = "\t\t\t" . '$table';
149
+        $results = "\t\t\t".'$table';
150 150
 
151 151
         foreach ($attributes as $key => $field) {
152 152
             if (in_array($column, $this->relationshipKeys)) {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             }
157 157
         }
158 158
 
159
-        return $results . ';' . PHP_EOL;
159
+        return $results.';'.PHP_EOL;
160 160
     }
161 161
 
162 162
     /**
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
     protected function addRelationColumn($key, $field, $column)
172 172
     {
173 173
         if ($key === 0) {
174
-            $relatedColumn = Str::snake(class_basename($field)) . '_id';
174
+            $relatedColumn = Str::snake(class_basename($field)).'_id';
175 175
 
176
-            return "->integer('{$relatedColumn}')->unsigned();" . PHP_EOL . "\t\t\t" . "\$table->foreign('{$relatedColumn}')";
176
+            return "->integer('{$relatedColumn}')->unsigned();".PHP_EOL."\t\t\t"."\$table->foreign('{$relatedColumn}')";
177 177
         }
178 178
         if ($key === 1) {
179 179
             return "->references('{$field}')";
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
             return "->on('{$field}')";
183 183
         }
184 184
         if (Str::contains($field, '(')) {
185
-            return '->' . $field;
185
+            return '->'.$field;
186 186
         }
187
-        return '->' . $field . '()';
187
+        return '->'.$field.'()';
188 188
     }
189 189
 
190 190
     /**
@@ -199,18 +199,18 @@  discard block
 block discarded – undo
199 199
     protected function addColumn($key, $field, $column)
200 200
     {
201 201
         if ($this->hasCustomAttribute($column)) {
202
-            return '->' . $field;
202
+            return '->'.$field;
203 203
         }
204 204
 
205 205
         if ($key == 0) {
206
-            return '->' . $field . "('" . $column . "')";
206
+            return '->'.$field."('".$column."')";
207 207
         }
208 208
 
209 209
         if (Str::contains($field, '(')) {
210
-            return '->' . $field;
210
+            return '->'.$field;
211 211
         }
212 212
 
213
-        return '->' . $field . '()';
213
+        return '->'.$field.'()';
214 214
     }
215 215
 
216 216
     /**
@@ -225,10 +225,10 @@  discard block
 block discarded – undo
225 225
     protected function removeColumn($key, $field, $column)
226 226
     {
227 227
         if ($this->hasCustomAttribute($column)) {
228
-            return '->' . $field;
228
+            return '->'.$field;
229 229
         }
230 230
 
231
-        return '->dropColumn(' . "'" . $column . "')";
231
+        return '->dropColumn('."'".$column."')";
232 232
     }
233 233
 
234 234
     /**
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      */
254 254
     public function getAttributes($column, $schema)
255 255
     {
256
-        $fields = str_replace($column . ':', '', $schema);
256
+        $fields = str_replace($column.':', '', $schema);
257 257
 
258 258
         return $this->hasCustomAttribute($column) ? $this->getCustomAttribute($column) : explode(':', $fields);
259 259
     }
Please login to merge, or discard this patch.
src/Commands/SeedCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $name = $module->getName();
104 104
         $config = $module->get('migration');
105 105
         if (is_array($config) && array_key_exists('seeds', $config)) {
106
-            foreach ((array)$config['seeds'] as $class) {
106
+            foreach ((array) $config['seeds'] as $class) {
107 107
                 if (class_exists($class)) {
108 108
                     $seeders[] = $class;
109 109
                 }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     protected function dbSeed($className)
138 138
     {
139 139
         if ($option = $this->option('class')) {
140
-            $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\') . $option;
140
+            $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\').$option;
141 141
         } else {
142 142
             $params = ['--class' => $className];
143 143
         }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $config = GenerateConfigReader::read('seeder');
169 169
         $seederPath = str_replace('/', '\\', $config->getPath());
170 170
 
171
-        return $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder';
171
+        return $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder';
172 172
     }
173 173
 
174 174
     /**
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         $foundModules = [];
189 189
         foreach ($this->laravel['modules']->config('scan.paths') as $path) {
190 190
             $namespace = array_slice(explode('/', $path), -1)[0];
191
-            $foundModules[] = $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder';
191
+            $foundModules[] = $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder';
192 192
         }
193 193
 
194 194
         return $foundModules;
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('module_path')) {
3
+if (!function_exists('module_path')) {
4 4
     function module_path($name, $path = '')
5 5
     {
6 6
         $module = app('modules')->find($name);
7 7
 
8
-        return $module->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);
8
+        return $module->getPath().($path ? DIRECTORY_SEPARATOR . $path : $path);
9 9
     }
10 10
 }
11 11
 
12
-if (! function_exists('config_path')) {
12
+if (!function_exists('config_path')) {
13 13
     /**
14 14
      * Get the configuration path.
15 15
      *
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
      */
19 19
     function config_path($path = '')
20 20
     {
21
-        return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
21
+        return app()->basePath().'/config'.($path ? DIRECTORY_SEPARATOR . $path : $path);
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
      *
@@ -31,6 +31,6 @@  discard block
 block discarded – undo
31 31
      */
32 32
     function public_path($path = '')
33 33
     {
34
-        return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
34
+        return app()->make('path.public').($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
src/Commands/MigrateStatusCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         }
50 50
 
51 51
         foreach ($this->module->getOrdered($this->option('direction')) as $module) {
52
-            $this->line('Running for module: <info>' . $module->getName() . '</info>');
52
+            $this->line('Running for module: <info>'.$module->getName().'</info>');
53 53
             $this->migrateStatus($module);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/Commands/ListenerMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 
78 78
     protected function getEventName(Module $module)
79 79
     {
80
-        $namespace = $this->laravel['modules']->config('namespace') . "\\" . $module->getStudlyName();
80
+        $namespace = $this->laravel['modules']->config('namespace')."\\".$module->getStudlyName();
81 81
         $eventPath = GenerateConfigReader::read('event');
82 82
 
83
-        $eventName = $namespace . "\\" . $eventPath->getPath() . "\\" . $this->option('event');
83
+        $eventName = $namespace."\\".$eventPath->getPath()."\\".$this->option('event');
84 84
 
85 85
         return str_replace('/', '\\', $eventName);
86 86
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         $listenerPath = GenerateConfigReader::read('listener');
93 93
 
94
-        return $path . $listenerPath->getPath() . '/' . $this->getFileName() . '.php';
94
+        return $path.$listenerPath->getPath().'/'.$this->getFileName().'.php';
95 95
     }
96 96
 
97 97
     /**
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
     /**
@@ -107,6 +107,6 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function getModelNamespace(): string
109 109
     {
110
-        return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $this->laravel['modules']->config('paths.generator.model.path', 'Entities');
110
+        return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$this->laravel['modules']->config('paths.generator.model.path', 'Entities');
111 111
     }
112 112
 }
Please login to merge, or discard this patch.
src/Commands/ComponentClassMakeCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     protected function writeComponentViewTemplate()
51 51
     {
52
-        $this->call('module:make-component-view', ['name' => $this->argument('name') , 'module' => $this->argument('module')]);
52
+        $this->call('module:make-component-view', ['name' => $this->argument('name'), 'module' => $this->argument('module')]);
53 53
     }
54 54
 
55 55
     public function getDefaultNamespace() : string
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             'NAMESPACE'         => $this->getClassNamespace($module),
83 83
             'CLASS'             => $this->getClass(),
84 84
             'LOWER_NAME'        => $module->getLowerName(),
85
-            'COMPONENT_NAME'    => 'components.' . Str::lower($this->argument('name')),
85
+            'COMPONENT_NAME'    => 'components.'.Str::lower($this->argument('name')),
86 86
         ]))->render();
87 87
     }
88 88
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
95 95
         $factoryPath = GenerateConfigReader::read('component-class');
96 96
 
97
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
97
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
98 98
     }
99 99
 
100 100
     /**
@@ -102,6 +102,6 @@  discard block
 block discarded – undo
102 102
      */
103 103
     private function getFileName()
104 104
     {
105
-        return Str::studly($this->argument('name')) . '.php';
105
+        return Str::studly($this->argument('name')).'.php';
106 106
     }
107 107
 }
Please login to merge, or discard this patch.
src/Commands/ModuleMakeCommand.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@
 block discarded – undo
76 76
     }
77 77
 
78 78
     /**
79
-    * Get module type .
80
-    *
81
-    * @return string
82
-    */
79
+     * Get module type .
80
+     *
81
+     * @return string
82
+     */
83 83
     private function getModuleType()
84 84
     {
85 85
         $isPlain = $this->option('plain');
Please login to merge, or discard this patch.
src/Commands/ComponentViewMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
64 64
         $factoryPath = GenerateConfigReader::read('component-view');
65 65
 
66
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
66
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
67 67
     }
68 68
 
69 69
     /**
@@ -71,6 +71,6 @@  discard block
 block discarded – undo
71 71
      */
72 72
     private function getFileName()
73 73
     {
74
-        return Str::lower($this->argument('name')) . '.blade.php';
74
+        return Str::lower($this->argument('name')).'.blade.php';
75 75
     }
76 76
 }
Please login to merge, or discard this patch.