@@ -86,11 +86,11 @@ |
||
| 86 | 86 | |
| 87 | 87 | $namespace = $this->laravel['modules']->config('namespace'); |
| 88 | 88 | |
| 89 | - $namespace .= '\\' . $module->getStudlyName(); |
|
| 89 | + $namespace .= '\\'.$module->getStudlyName(); |
|
| 90 | 90 | |
| 91 | - $namespace .= '\\' . $this->getDefaultNamespace(); |
|
| 91 | + $namespace .= '\\'.$this->getDefaultNamespace(); |
|
| 92 | 92 | |
| 93 | - $namespace .= '\\' . $extra; |
|
| 93 | + $namespace .= '\\'.$extra; |
|
| 94 | 94 | |
| 95 | 95 | return trim($namespace, '\\'); |
| 96 | 96 | } |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | |
| 66 | 66 | $mailPath = $this->laravel['modules']->config('paths.generator.emails', 'Emails'); |
| 67 | 67 | |
| 68 | - return $path . $mailPath . '/' . $this->getFileName() . '.php'; |
|
| 68 | + return $path.$mailPath.'/'.$this->getFileName().'.php'; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -123,14 +123,14 @@ |
||
| 123 | 123 | |
| 124 | 124 | // any JSON parsing errors should throw an exception |
| 125 | 125 | if (json_last_error() > 0) { |
| 126 | - throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg()); |
|
| 126 | + throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg()); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (config('modules.cache.enabled') === false) { |
| 130 | 130 | return $attributes; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - return app('cache')->remember($this->getPath(), config('modules.cache.lifetime'), function () use ($attributes) { |
|
| 133 | + return app('cache')->remember($this->getPath(), config('modules.cache.lifetime'), function() use ($attributes) { |
|
| 134 | 134 | return $attributes; |
| 135 | 135 | }); |
| 136 | 136 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 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 |
||
| 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', [ |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $name = $module->getName(); |
| 92 | 92 | $config = $module->get('migration'); |
| 93 | 93 | if (is_array($config) && array_key_exists('seeds', $config)) { |
| 94 | - foreach ((array)$config['seeds'] as $class) { |
|
| 94 | + foreach ((array) $config['seeds'] as $class) { |
|
| 95 | 95 | if (class_exists($class)) { |
| 96 | 96 | $seeders[] = $class; |
| 97 | 97 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $namespace = $this->laravel['modules']->config('namespace'); |
| 146 | 146 | |
| 147 | - return $namespace . '\\' . $name . '\Database\Seeders\\' . $name . 'DatabaseSeeder'; |
|
| 147 | + return $namespace.'\\'.$name.'\Database\Seeders\\'.$name.'DatabaseSeeder'; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! function_exists('module_path')) { |
|
| 3 | +if (!function_exists('module_path')) { |
|
| 4 | 4 | function module_path($name) |
| 5 | 5 | { |
| 6 | 6 | $module = app('modules')->find($name); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | $lowerName = $this->getLowerName(); |
| 179 | 179 | |
| 180 | - $langPath = $this->getPath() . "/Resources/lang"; |
|
| 180 | + $langPath = $this->getPath()."/Resources/lang"; |
|
| 181 | 181 | |
| 182 | 182 | if (is_dir($langPath)) { |
| 183 | 183 | $this->loadTranslationsFrom($langPath, $lowerName); |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | $file = 'module.json'; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - return array_get($this->moduleJson, $file, function () use ($file) { |
|
| 201 | - return $this->moduleJson[$file] = new Json($this->getPath() . '/' . $file, $this->app['files']); |
|
| 200 | + return array_get($this->moduleJson, $file, function() use ($file) { |
|
| 201 | + return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->app['files']); |
|
| 202 | 202 | }); |
| 203 | 203 | } |
| 204 | 204 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | protected function fireEvent($event) |
| 251 | 251 | { |
| 252 | - $this->app['events']->fire(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]); |
|
| 252 | + $this->app['events']->fire(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]); |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | /** |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | protected function registerFiles() |
| 280 | 280 | { |
| 281 | 281 | foreach ($this->get('files', []) as $file) { |
| 282 | - include $this->path . '/' . $file; |
|
| 282 | + include $this->path.'/'.$file; |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | */ |
| 401 | 401 | public function getExtraPath($path) |
| 402 | 402 | { |
| 403 | - return $this->getPath() . '/' . $path; |
|
| 403 | + return $this->getPath().'/'.$path; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $paths = $this->paths; |
| 101 | 101 | |
| 102 | - $paths[] = $this->getPath() . '/*'; |
|
| 102 | + $paths[] = $this->getPath().'/*'; |
|
| 103 | 103 | |
| 104 | 104 | if ($this->config('scan.enabled')) { |
| 105 | 105 | $paths = array_merge($paths, $this->config('scan.paths')); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $modules = []; |
| 161 | 161 | |
| 162 | 162 | foreach ($cached as $name => $module) { |
| 163 | - $path = $this->config('paths.modules') . '/' . $name; |
|
| 163 | + $path = $this->config('paths.modules').'/'.$name; |
|
| 164 | 164 | |
| 165 | 165 | $modules[$name] = new Module($this->app, $name, $path); |
| 166 | 166 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function getCached() |
| 177 | 177 | { |
| 178 | - return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 178 | + return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 179 | 179 | return $this->toCollection()->toArray(); |
| 180 | 180 | }); |
| 181 | 181 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | $modules = $this->enabled(); |
| 265 | 265 | |
| 266 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 266 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 267 | 267 | if ($a->order == $b->order) { |
| 268 | 268 | return 0; |
| 269 | 269 | } |
@@ -412,9 +412,9 @@ discard block |
||
| 412 | 412 | public function getModulePath($module) |
| 413 | 413 | { |
| 414 | 414 | try { |
| 415 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 415 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 416 | 416 | } catch (ModuleNotFoundException $e) { |
| 417 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 417 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | */ |
| 428 | 428 | public function assetPath($module) |
| 429 | 429 | { |
| 430 | - return $this->config('paths.assets') . '/' . $module; |
|
| 430 | + return $this->config('paths.assets').'/'.$module; |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | /** |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | */ |
| 441 | 441 | public function config($key, $default = null) |
| 442 | 442 | { |
| 443 | - return $this->app['config']->get('modules.' . $key, $default); |
|
| 443 | + return $this->app['config']->get('modules.'.$key, $default); |
|
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | /** |
@@ -525,9 +525,9 @@ discard block |
||
| 525 | 525 | } |
| 526 | 526 | list($name, $url) = explode(':', $asset); |
| 527 | 527 | |
| 528 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 528 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 529 | 529 | |
| 530 | - $url = $this->app['url']->asset($baseUrl . "/{$name}/" . $url); |
|
| 530 | + $url = $this->app['url']->asset($baseUrl."/{$name}/".$url); |
|
| 531 | 531 | |
| 532 | 532 | return str_replace(['http://', 'https://'], '//', $url); |
| 533 | 533 | } |