@@ -88,7 +88,7 @@ |
||
| 88 | 88 | /** |
| 89 | 89 | * Get module instance. |
| 90 | 90 | * |
| 91 | - * @return \Nwidart\Modules\Module |
|
| 91 | + * @return string |
|
| 92 | 92 | */ |
| 93 | 93 | public function getModule() |
| 94 | 94 | { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function toArray() |
| 26 | 26 | { |
| 27 | - return array_map(function ($value) { |
|
| 27 | + return array_map(function($value) { |
|
| 28 | 28 | if ($value instanceof Module) { |
| 29 | 29 | return $value->json()->getAttributes(); |
| 30 | 30 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $seederPath = $this->laravel['modules']->config('paths.generator.seeder'); |
| 83 | 83 | |
| 84 | - return $path . $seederPath . '/' . $this->getSeederName() . '.php'; |
|
| 84 | + return $path.$seederPath.'/'.$this->getSeederName().'.php'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -93,6 +93,6 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $end = $this->option('master') ? 'DatabaseSeeder' : 'TableSeeder'; |
| 95 | 95 | |
| 96 | - return Str::studly($this->argument('name')) . $end; |
|
| 96 | + return Str::studly($this->argument('name')).$end; |
|
| 97 | 97 | } |
| 98 | 98 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 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 |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * @return mixed |
|
| 76 | + * @return string |
|
| 77 | 77 | */ |
| 78 | 78 | protected function getDestinationFilePath() |
| 79 | 79 | { |
@@ -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); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $process->setTimeout($this->timeout); |
| 136 | 136 | |
| 137 | 137 | if ($this->console instanceof Command) { |
| 138 | - $process->run(function ($type, $line) { |
|
| 138 | + $process->run(function($type, $line) { |
|
| 139 | 139 | $this->console->line($line); |
| 140 | 140 | }); |
| 141 | 141 | } |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | public function getPackageName() |
| 240 | 240 | { |
| 241 | 241 | if (is_null($this->version)) { |
| 242 | - return $this->name . ':dev-master'; |
|
| 242 | + return $this->name.':dev-master'; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - return $this->name . ':' . $this->version; |
|
| 245 | + return $this->name.':'.$this->version; |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | 'stubs' => [ |
| 26 | 26 | 'enabled' => false, |
| 27 | - 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs', |
|
| 27 | + 'path' => base_path().'/vendor/nwidart/laravel-modules/src/Commands/stubs', |
|
| 28 | 28 | 'files' => [ |
| 29 | 29 | 'start' => 'start.php', |
| 30 | 30 | 'routes' => 'Http/routes.php', |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getPath() |
| 90 | 90 | { |
| 91 | - return static::getBasePath() . $this->path; |
|
| 91 | + return static::getBasePath().$this->path; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $contents = file_get_contents($this->getPath()); |
| 122 | 122 | |
| 123 | 123 | foreach ($this->replaces as $search => $replace) { |
| 124 | - $contents = str_replace('$' . strtoupper($search) . '$', $replace, $contents); |
|
| 124 | + $contents = str_replace('$'.strtoupper($search).'$', $replace, $contents); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $contents; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function saveTo($path, $filename) |
| 149 | 149 | { |
| 150 | - return file_put_contents($path . '/' . $filename, $this->getContents()); |
|
| 150 | + return file_put_contents($path.'/'.$filename, $this->getContents()); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * @param $name |
|
| 68 | + * @param string $name |
|
| 69 | 69 | * |
| 70 | 70 | * @throws RuntimeException |
| 71 | 71 | * |
@@ -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 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | /** |
| 93 | 93 | * Get scanned modules paths. |
| 94 | 94 | * |
| 95 | - * @return array |
|
| 95 | + * @return string[] |
|
| 96 | 96 | */ |
| 97 | 97 | public function getScanPaths() |
| 98 | 98 | { |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | /** |
| 403 | 403 | * Get module path for a specific module. |
| 404 | 404 | * |
| 405 | - * @param $module |
|
| 405 | + * @param string $module |
|
| 406 | 406 | * |
| 407 | 407 | * @return string |
| 408 | 408 | */ |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | /** |
| 431 | 431 | * Get a specific config data from a configuration file. |
| 432 | 432 | * |
| 433 | - * @param $key |
|
| 433 | + * @param string $key |
|
| 434 | 434 | * |
| 435 | 435 | * @param null $default |
| 436 | 436 | * @return mixed |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | /** |
| 472 | 472 | * Get module used for cli session. |
| 473 | 473 | * |
| 474 | - * @return string |
|
| 474 | + * @return Module |
|
| 475 | 475 | */ |
| 476 | 476 | public function getUsedNow() |
| 477 | 477 | { |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | /** |
| 482 | 482 | * Get used now. |
| 483 | 483 | * |
| 484 | - * @return string |
|
| 484 | + * @return Module |
|
| 485 | 485 | */ |
| 486 | 486 | public function getUsed() |
| 487 | 487 | { |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | * |
| 556 | 556 | * @param string $name |
| 557 | 557 | * |
| 558 | - * @return bool |
|
| 558 | + * @return boolean|null |
|
| 559 | 559 | */ |
| 560 | 560 | public function enable($name) |
| 561 | 561 | { |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | * |
| 568 | 568 | * @param string $name |
| 569 | 569 | * |
| 570 | - * @return bool |
|
| 570 | + * @return boolean|null |
|
| 571 | 571 | */ |
| 572 | 572 | public function disable($name) |
| 573 | 573 | { |
@@ -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')); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function getCached() |
| 147 | 147 | { |
| 148 | - return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 148 | + return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 149 | 149 | return $this->toCollection()->toArray(); |
| 150 | 150 | }); |
| 151 | 151 | } |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | { |
| 234 | 234 | $modules = $this->enabled(); |
| 235 | 235 | |
| 236 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 236 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 237 | 237 | if ($a->order == $b->order) { |
| 238 | 238 | return 0; |
| 239 | 239 | } |
@@ -382,9 +382,9 @@ discard block |
||
| 382 | 382 | public function getModulePath($module) |
| 383 | 383 | { |
| 384 | 384 | try { |
| 385 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 385 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 386 | 386 | } catch (ModuleNotFoundException $e) { |
| 387 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 387 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 388 | 388 | } |
| 389 | 389 | } |
| 390 | 390 | |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | public function assetPath($module) |
| 399 | 399 | { |
| 400 | - return $this->config('paths.assets') . '/' . $module; |
|
| 400 | + return $this->config('paths.assets').'/'.$module; |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | /** |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | */ |
| 411 | 411 | public function config($key, $default = null) |
| 412 | 412 | { |
| 413 | - return $this->app['config']->get('modules.' . $key, $default); |
|
| 413 | + return $this->app['config']->get('modules.'.$key, $default); |
|
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | /** |
@@ -501,9 +501,9 @@ discard block |
||
| 501 | 501 | } |
| 502 | 502 | list($name, $url) = explode(':', $asset); |
| 503 | 503 | |
| 504 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 504 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 505 | 505 | |
| 506 | - $url = $this->app['url']->asset($baseUrl . "/{$name}/" . $url); |
|
| 506 | + $url = $this->app['url']->asset($baseUrl."/{$name}/".$url); |
|
| 507 | 507 | |
| 508 | 508 | return str_replace(['http://', 'https://'], '//', $url); |
| 509 | 509 | } |