@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * @return mixed |
|
| 60 | + * @return string |
|
| 61 | 61 | */ |
| 62 | 62 | protected function getTemplateContents() |
| 63 | 63 | { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * @return mixed |
|
| 73 | + * @return string |
|
| 74 | 74 | */ |
| 75 | 75 | protected function getDestinationFilePath() |
| 76 | 76 | { |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | |
| 73 | 73 | $seederPath = $this->laravel['modules']->config('paths.generator.filter'); |
| 74 | 74 | |
| 75 | - return $path . $seederPath . '/' . $this->getFileName() . '.php'; |
|
| 75 | + return $path.$seederPath.'/'.$this->getFileName().'.php'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | /** |
| 90 | 90 | * Get scanned modules paths. |
| 91 | 91 | * |
| 92 | - * @return array |
|
| 92 | + * @return string[] |
|
| 93 | 93 | */ |
| 94 | 94 | public function getScanPaths() |
| 95 | 95 | { |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | /** |
| 368 | 368 | * Get module path for a specific module. |
| 369 | 369 | * |
| 370 | - * @param $module |
|
| 370 | + * @param string $module |
|
| 371 | 371 | * |
| 372 | 372 | * @return string |
| 373 | 373 | */ |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | /** |
| 396 | 396 | * Get a specific config data from a configuration file. |
| 397 | 397 | * |
| 398 | - * @param $key |
|
| 398 | + * @param string $key |
|
| 399 | 399 | * |
| 400 | 400 | * @return mixed |
| 401 | 401 | */ |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | /** |
| 436 | 436 | * Get module used for cli session. |
| 437 | 437 | * |
| 438 | - * @return string |
|
| 438 | + * @return Module |
|
| 439 | 439 | */ |
| 440 | 440 | public function getUsedNow() |
| 441 | 441 | { |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | /** |
| 446 | 446 | * Get used now. |
| 447 | 447 | * |
| 448 | - * @return string |
|
| 448 | + * @return Module |
|
| 449 | 449 | */ |
| 450 | 450 | public function getUsed() |
| 451 | 451 | { |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | * |
| 520 | 520 | * @param string $name |
| 521 | 521 | * |
| 522 | - * @return bool |
|
| 522 | + * @return boolean|null |
|
| 523 | 523 | */ |
| 524 | 524 | public function enable($name) |
| 525 | 525 | { |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | * |
| 532 | 532 | * @param string $name |
| 533 | 533 | * |
| 534 | - * @return bool |
|
| 534 | + * @return boolean|null |
|
| 535 | 535 | */ |
| 536 | 536 | public function disable($name) |
| 537 | 537 | { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $paths = $this->paths; |
| 97 | 97 | |
| 98 | - $paths[] = $this->getPath() . '/*'; |
|
| 98 | + $paths[] = $this->getPath().'/*'; |
|
| 99 | 99 | |
| 100 | 100 | if ($this->config('scan.enabled')) { |
| 101 | 101 | $paths = array_merge($paths, $this->config('scan.paths')); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $modules = []; |
| 157 | 157 | |
| 158 | 158 | foreach ($cached as $name => $module) { |
| 159 | - $path = $this->config('paths.modules') . '/' . $name; |
|
| 159 | + $path = $this->config('paths.modules').'/'.$name; |
|
| 160 | 160 | |
| 161 | 161 | $modules[$name] = new Module($this->app, $name, $path); |
| 162 | 162 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function getCached() |
| 173 | 173 | { |
| 174 | - return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 174 | + return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 175 | 175 | return $this->toCollection()->toArray(); |
| 176 | 176 | }); |
| 177 | 177 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | { |
| 260 | 260 | $modules = $this->enabled(); |
| 261 | 261 | |
| 262 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 262 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 263 | 263 | if ($a->order == $b->order) { |
| 264 | 264 | return 0; |
| 265 | 265 | } |
@@ -370,9 +370,9 @@ discard block |
||
| 370 | 370 | public function getModulePath($module) |
| 371 | 371 | { |
| 372 | 372 | try { |
| 373 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 373 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 374 | 374 | } catch (ModuleNotFoundException $e) { |
| 375 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 375 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 376 | 376 | } |
| 377 | 377 | } |
| 378 | 378 | |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | */ |
| 386 | 386 | public function assetPath($module) |
| 387 | 387 | { |
| 388 | - return $this->config('paths.assets') . '/' . $module; |
|
| 388 | + return $this->config('paths.assets').'/'.$module; |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /** |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | public function config($key, $default = null) |
| 400 | 400 | { |
| 401 | - return $this->app['config']->get('modules.' . $key, $default); |
|
| 401 | + return $this->app['config']->get('modules.'.$key, $default); |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | /** |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | $this->app['files']->makeDirectory($path, 0777, true); |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | - return $path . '/modules.used'; |
|
| 415 | + return $path.'/modules.used'; |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | |
| 483 | 483 | $baseUrl = str_replace(public_path(), '', $this->getAssetsPath()); |
| 484 | 484 | |
| 485 | - $url = $this->app['url']->asset($baseUrl . "/{$name}/" . $url); |
|
| 485 | + $url = $this->app['url']->asset($baseUrl."/{$name}/".$url); |
|
| 486 | 486 | |
| 487 | 487 | return str_replace(['http://', 'https://'], '//', $url); |
| 488 | 488 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | "EVENTNAME" => $this->getEventName($module), |
| 63 | 63 | "EVENTSHORTENEDNAME" => $this->option('event'), |
| 64 | 64 | "CLASS" => $this->getClass(), |
| 65 | - 'DUMMYNAMESPACE' => $this->laravel->getNamespace() . "Events", |
|
| 65 | + 'DUMMYNAMESPACE' => $this->laravel->getNamespace()."Events", |
|
| 66 | 66 | ]))->render(); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $seederPath = $this->laravel['modules']->config('paths.generator.listener'); |
| 74 | 74 | |
| 75 | - return $path . $seederPath . '/' . $this->getFileName() . '.php'; |
|
| 75 | + return $path.$seederPath.'/'.$this->getFileName().'.php'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | protected function getEventName(Module $module) |
| 96 | 96 | { |
| 97 | - return $this->getClassNamespace($module) . "\\" . config('modules.paths.generator.event') . "\\" . $this->option('event'); |
|
| 97 | + return $this->getClassNamespace($module)."\\".config('modules.paths.generator.event')."\\".$this->option('event'); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | private function getNamespace($module) |
| 101 | 101 | { |
| 102 | 102 | $namespace = str_replace('/', '\\', config('modules.paths.generator.listener')); |
| 103 | 103 | |
| 104 | - return $this->getClassNamespace($module) . "\\" . $namespace; |
|
| 104 | + return $this->getClassNamespace($module)."\\".$namespace; |
|
| 105 | 105 | } |
| 106 | 106 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | $generatorPath = $this->laravel['modules']->config('paths.generator.provider'); |
| 70 | 70 | |
| 71 | - return $path . $generatorPath . '/' . $this->getFileName() . '.php'; |
|
| 71 | + return $path.$generatorPath.'/'.$this->getFileName().'.php'; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | $module = $this->laravel['modules']->findOrFail($this->getModuleName()); |
| 58 | 58 | |
| 59 | 59 | return (new Stub('/event.stub', [ |
| 60 | - 'NAMESPACE' => $this->getClassNamespace($module) . "\\" . config('modules.paths.generator.event'), |
|
| 60 | + 'NAMESPACE' => $this->getClassNamespace($module)."\\".config('modules.paths.generator.event'), |
|
| 61 | 61 | "CLASS" => $this->getClass(), |
| 62 | - 'DUMMYNAMESPACE' => $this->laravel->getNamespace() . 'Events', |
|
| 62 | + 'DUMMYNAMESPACE' => $this->laravel->getNamespace().'Events', |
|
| 63 | 63 | ]))->render(); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
| 69 | 69 | $seederPath = $this->laravel['modules']->config('paths.generator.event'); |
| 70 | 70 | |
| 71 | - return $path . $seederPath . '/' . $this->getFileName() . '.php'; |
|
| 71 | + return $path.$seederPath.'/'.$this->getFileName().'.php'; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -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 rtrim($namespace, '\\'); |
| 96 | 96 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | foreach (array_reverse($this->laravel['modules']->all()) as $module) { |
| 45 | - $this->line('Running for module: <info>' . $module->getName() . '</info>'); |
|
| 45 | + $this->line('Running for module: <info>'.$module->getName().'</info>'); |
|
| 46 | 46 | |
| 47 | 47 | $this->reset($module); |
| 48 | 48 | } |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | protected function loadMigrationFiles($module) |
| 13 | 13 | { |
| 14 | - $path = $this->laravel['modules']->getModulePath($module) . $this->getMigrationGeneratorPath(); |
|
| 14 | + $path = $this->laravel['modules']->getModulePath($module).$this->getMigrationGeneratorPath(); |
|
| 15 | 15 | |
| 16 | - $files = $this->laravel['files']->glob($path . '/*_*.php'); |
|
| 16 | + $files = $this->laravel['files']->glob($path.'/*_*.php'); |
|
| 17 | 17 | |
| 18 | 18 | foreach ($files as $file) { |
| 19 | 19 | $this->laravel['files']->requireOnce($file); |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function setupStubPath() |
| 57 | 57 | { |
| 58 | - $this->app->booted(function ($app) { |
|
| 59 | - Stub::setBasePath(__DIR__ . '/Commands/stubs'); |
|
| 58 | + $this->app->booted(function($app) { |
|
| 59 | + Stub::setBasePath(__DIR__.'/Commands/stubs'); |
|
| 60 | 60 | |
| 61 | 61 | if ($app['modules']->config('stubs.enabled') === true) { |
| 62 | 62 | Stub::setBasePath($app['modules']->config('stubs.path')); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | protected function registerNamespaces() |
| 71 | 71 | { |
| 72 | - $configPath = __DIR__ . '/../config/config.php'; |
|
| 72 | + $configPath = __DIR__.'/../config/config.php'; |
|
| 73 | 73 | $this->mergeConfigFrom($configPath, 'modules'); |
| 74 | 74 | $this->publishes([ |
| 75 | 75 | $configPath => config_path('modules.php'), |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | protected function registerServices() |
| 99 | 99 | { |
| 100 | - $this->app->singleton('modules', function ($app) { |
|
| 100 | + $this->app->singleton('modules', function($app) { |
|
| 101 | 101 | $path = $app['config']->get('modules.paths.modules'); |
| 102 | 102 | |
| 103 | 103 | return new Repository($app, $path); |