@@ -65,7 +65,7 @@ |
||
| 65 | 65 | |
| 66 | 66 | $jobPath = $this->laravel['modules']->config('paths.generator.jobs'); |
| 67 | 67 | |
| 68 | - return $path . $jobPath . '/' . $this->getFileName() . '.php'; |
|
| 68 | + return $path.$jobPath.'/'.$this->getFileName().'.php'; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $module = $this->laravel['modules']->findOrFail($this->getModuleName()); |
| 32 | 32 | |
| 33 | 33 | return (new Stub('/event.stub', [ |
| 34 | - 'NAMESPACE' => $this->getClassNamespace($module) . "\\" . config('modules.paths.generator.event'), |
|
| 34 | + 'NAMESPACE' => $this->getClassNamespace($module)."\\".config('modules.paths.generator.event'), |
|
| 35 | 35 | "CLASS" => $this->getClass(), |
| 36 | 36 | ]))->render(); |
| 37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
| 42 | 42 | $seederPath = $this->laravel['modules']->config('paths.generator.event'); |
| 43 | 43 | |
| 44 | - return $path . $seederPath . '/' . $this->getFileName() . '.php'; |
|
| 44 | + return $path.$seederPath.'/'.$this->getFileName().'.php'; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 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); |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | } |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | -if (! function_exists('public_path')) { |
|
| 12 | +if (!function_exists('public_path')) { |
|
| 13 | 13 | /** |
| 14 | 14 | * Get the path to the public folder. |
| 15 | 15 | * |
@@ -18,6 +18,6 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function public_path($path = '') |
| 20 | 20 | { |
| 21 | - return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path); |
|
| 21 | + return app()->make('path.public').($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path); |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $generatorPath = $this->laravel['modules']->config('paths.generator.migration'); |
| 115 | 115 | |
| 116 | - return $path . $generatorPath . '/' . $this->getFileName() . '.php'; |
|
| 116 | + return $path.$generatorPath.'/'.$this->getFileName().'.php'; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | private function getFileName() |
| 123 | 123 | { |
| 124 | - return date('Y_m_d_His_') . $this->getSchemaName(); |
|
| 124 | + return date('Y_m_d_His_').$this->getSchemaName(); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $string = ''; |
| 54 | 54 | foreach ($pieces as $i => $piece) { |
| 55 | - if ($i+1 < count($pieces)) { |
|
| 56 | - $string .= strtolower($piece) . '_'; |
|
| 55 | + if ($i + 1 < count($pieces)) { |
|
| 56 | + $string .= strtolower($piece).'_'; |
|
| 57 | 57 | } else { |
| 58 | 58 | $string .= Str::plural(strtolower($piece)); |
| 59 | 59 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | private function handleOptionalMigrationOption() |
| 95 | 95 | { |
| 96 | 96 | if ($this->option('migration') === true) { |
| 97 | - $migrationName = 'create_' . $this->createMigrationName() . '_table'; |
|
| 97 | + $migrationName = 'create_'.$this->createMigrationName().'_table'; |
|
| 98 | 98 | $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]); |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $seederPath = $this->laravel['modules']->config('paths.generator.model'); |
| 129 | 129 | |
| 130 | - return $path . $seederPath . '/' . $this->getModelName() . '.php'; |
|
| 130 | + return $path.$seederPath.'/'.$this->getModelName().'.php'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -71,6 +71,6 @@ |
||
| 71 | 71 | |
| 72 | 72 | $generatorPath = $this->laravel['modules']->config('paths.generator.provider'); |
| 73 | 73 | |
| 74 | - return $path . $generatorPath . '/' . $this->getFileName() . '.php'; |
|
| 74 | + return $path.$generatorPath.'/'.$this->getFileName().'.php'; |
|
| 75 | 75 | } |
| 76 | 76 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $paths = $this->paths; |
| 102 | 102 | |
| 103 | - $paths[] = $this->getPath() . '/*'; |
|
| 103 | + $paths[] = $this->getPath().'/*'; |
|
| 104 | 104 | |
| 105 | 105 | if ($this->config('scan.enabled')) { |
| 106 | 106 | $paths = array_merge($paths, $this->config('scan.paths')); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function getCached() |
| 148 | 148 | { |
| 149 | - return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 149 | + return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 150 | 150 | return $this->toCollection()->toArray(); |
| 151 | 151 | }); |
| 152 | 152 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | { |
| 235 | 235 | $modules = $this->enabled(); |
| 236 | 236 | |
| 237 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 237 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 238 | 238 | if ($a->order == $b->order) { |
| 239 | 239 | return 0; |
| 240 | 240 | } |
@@ -384,9 +384,9 @@ discard block |
||
| 384 | 384 | public function getModulePath($module) |
| 385 | 385 | { |
| 386 | 386 | try { |
| 387 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 387 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 388 | 388 | } catch (ModuleNotFoundException $e) { |
| 389 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 389 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | */ |
| 400 | 400 | public function assetPath($module) : string |
| 401 | 401 | { |
| 402 | - return $this->config('paths.assets') . '/' . $module; |
|
| 402 | + return $this->config('paths.assets').'/'.$module; |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | /** |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | */ |
| 413 | 413 | public function config($key, $default = null) |
| 414 | 414 | { |
| 415 | - return $this->app['config']->get('modules.' . $key, $default); |
|
| 415 | + return $this->app['config']->get('modules.'.$key, $default); |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
@@ -513,9 +513,9 @@ discard block |
||
| 513 | 513 | } |
| 514 | 514 | list($name, $url) = explode(':', $asset); |
| 515 | 515 | |
| 516 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 516 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 517 | 517 | |
| 518 | - $url = $this->app['url']->asset($baseUrl . "/{$name}/" . $url); |
|
| 518 | + $url = $this->app['url']->asset($baseUrl."/{$name}/".$url); |
|
| 519 | 519 | |
| 520 | 520 | return str_replace(['http://', 'https://'], '//', $url); |
| 521 | 521 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | { |
| 187 | 187 | $lowerName = $this->getLowerName(); |
| 188 | 188 | |
| 189 | - $langPath = $this->getPath() . '/Resources/lang'; |
|
| 189 | + $langPath = $this->getPath().'/Resources/lang'; |
|
| 190 | 190 | |
| 191 | 191 | if (is_dir($langPath)) { |
| 192 | 192 | $this->loadTranslationsFrom($langPath, $lowerName); |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | $file = 'module.json'; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - return array_get($this->moduleJson, $file, function () use ($file) { |
|
| 210 | - return $this->moduleJson[$file] = new Json($this->getPath() . '/' . $file, $this->app['files']); |
|
| 209 | + return array_get($this->moduleJson, $file, function() use ($file) { |
|
| 210 | + return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->app['files']); |
|
| 211 | 211 | }); |
| 212 | 212 | } |
| 213 | 213 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | protected function fireEvent($event) |
| 260 | 260 | { |
| 261 | - $this->app['events']->fire(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]); |
|
| 261 | + $this->app['events']->fire(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]); |
|
| 262 | 262 | } |
| 263 | 263 | /** |
| 264 | 264 | * Register the aliases from this module. |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | protected function registerFiles() |
| 284 | 284 | { |
| 285 | 285 | foreach ($this->get('files', []) as $file) { |
| 286 | - include $this->path . '/' . $file; |
|
| 286 | + include $this->path.'/'.$file; |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | public function getExtraPath(string $path) : string |
| 408 | 408 | { |
| 409 | - return $this->getPath() . '/' . $path; |
|
| 409 | + return $this->getPath().'/'.$path; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $module = $this->laravel['modules']->findOrFail($this->getModuleName()); |
| 69 | 69 | |
| 70 | - return (new Stub('/' . $stub . '.stub', [ |
|
| 70 | + return (new Stub('/'.$stub.'.stub', [ |
|
| 71 | 71 | 'NAMESPACE' => $this->getClassNamespace($module), |
| 72 | 72 | 'CLASS' => $this->getClass(), |
| 73 | 73 | 'LOWER_NAME' => $module->getLowerName(), |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $generatorPath = $this->laravel['modules']->config('paths.generator.provider'); |
| 92 | 92 | |
| 93 | - return $path . $generatorPath . '/' . $this->getFileName() . '.php'; |
|
| 93 | + return $path.$generatorPath.'/'.$this->getFileName().'.php'; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |