@@ -49,7 +49,7 @@ |
||
| 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 | |
@@ -77,10 +77,10 @@ discard block |
||
| 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 |
||
| 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 | /** |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | // This checks if we are running on a Laravel Vapor managed instance |
| 19 | 19 | // and sets the path to a writable one (services path is not on a writable storage in Vapor). |
| 20 | 20 | if (!is_null(env('VAPOR_MAINTENANCE_MODE', null))) { |
| 21 | - return Str::replaceLast('config.php', $this->getSnakeName() . '_module.php', $this->app->getCachedConfigPath()); |
|
| 21 | + return Str::replaceLast('config.php', $this->getSnakeName().'_module.php', $this->app->getCachedConfigPath()); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath()); |
|
| 24 | + return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->getCachedServicesPath()); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $paths = array_merge($paths, $this->config('scan.paths')); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $paths = array_map(function ($path) { |
|
| 119 | + $paths = array_map(function($path) { |
|
| 120 | 120 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
| 121 | 121 | }, $paths); |
| 122 | 122 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function getCached() |
| 202 | 202 | { |
| 203 | - return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 203 | + return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 204 | 204 | return $this->toCollection()->toArray(); |
| 205 | 205 | }); |
| 206 | 206 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | { |
| 290 | 290 | $modules = $this->allEnabled(); |
| 291 | 291 | |
| 292 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 292 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 293 | 293 | if ($a->get('priority') === $b->get('priority')) { |
| 294 | 294 | return 0; |
| 295 | 295 | } |
@@ -418,9 +418,9 @@ discard block |
||
| 418 | 418 | public function getModulePath($module) |
| 419 | 419 | { |
| 420 | 420 | try { |
| 421 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 421 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 422 | 422 | } catch (ModuleNotFoundException $e) { |
| 423 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 423 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | public function assetPath(string $module) : string |
| 431 | 431 | { |
| 432 | - return $this->config('paths.assets') . '/' . $module; |
|
| 432 | + return $this->config('paths.assets').'/'.$module; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /** |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | public function config(string $key, $default = null) |
| 439 | 439 | { |
| 440 | - return $this->config->get('modules.' . $key, $default); |
|
| 440 | + return $this->config->get('modules.'.$key, $default); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | /** |
@@ -527,9 +527,9 @@ discard block |
||
| 527 | 527 | } |
| 528 | 528 | list($name, $url) = explode(':', $asset); |
| 529 | 529 | |
| 530 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 530 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 531 | 531 | |
| 532 | - $url = $this->url->asset($baseUrl . "/{$name}/" . $url); |
|
| 532 | + $url = $this->url->asset($baseUrl."/{$name}/".$url); |
|
| 533 | 533 | |
| 534 | 534 | return str_replace(['http://', 'https://'], '//', $url); |
| 535 | 535 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -76,10 +76,10 @@ |
||
| 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'); |
@@ -63,7 +63,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $this->setupStubPath(); |
| 27 | 27 | $this->registerProviders(); |
| 28 | 28 | |
| 29 | - $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'modules'); |
|
| 29 | + $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'modules'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function setupStubPath() |
| 36 | 36 | { |
| 37 | - $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__ . '/Commands/stubs'; |
|
| 37 | + $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__.'/Commands/stubs'; |
|
| 38 | 38 | Stub::setBasePath($path); |
| 39 | 39 | |
| 40 | - $this->app->booted(function ($app) { |
|
| 40 | + $this->app->booted(function($app) { |
|
| 41 | 41 | /** @var RepositoryInterface $moduleRepository */ |
| 42 | 42 | $moduleRepository = $app[RepositoryInterface::class]; |
| 43 | 43 | if ($moduleRepository->config('stubs.enabled') === true) { |
@@ -51,14 +51,14 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | protected function registerServices() |
| 53 | 53 | { |
| 54 | - $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
| 54 | + $this->app->singleton(Contracts\RepositoryInterface::class, function($app) { |
|
| 55 | 55 | $path = $app['config']->get('modules.paths.modules'); |
| 56 | 56 | |
| 57 | 57 | return new Laravel\LaravelFileRepository($app, $path); |
| 58 | 58 | }); |
| 59 | - $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) { |
|
| 59 | + $this->app->singleton(Contracts\ActivatorInterface::class, function($app) { |
|
| 60 | 60 | $activator = $app['config']->get('modules.activator'); |
| 61 | - $class = $app['config']->get('modules.activators.' . $activator)['class']; |
|
| 61 | + $class = $app['config']->get('modules.activators.'.$activator)['class']; |
|
| 62 | 62 | |
| 63 | 63 | if ($class === null) { |
| 64 | 64 | throw InvalidActivatorClass::missingConfig(); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getMigrations($reverse = false) |
| 90 | 90 | { |
| 91 | - $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php'); |
|
| 91 | + $files = $this->laravel['files']->glob($this->getPath().'/*_*.php'); |
|
| 92 | 92 | |
| 93 | 93 | // Once we have the array of files in the directory we will just remove the |
| 94 | 94 | // extension and take the basename of the file which is all we need when |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | return []; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - $files = array_map(function ($file) { |
|
| 100 | + $files = array_map(function($file) { |
|
| 101 | 101 | return str_replace('.php', '', basename($file)); |
| 102 | 102 | }, $files); |
| 103 | 103 | |
@@ -202,8 +202,8 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | $class = Str::studly($name); |
| 204 | 204 | |
| 205 | - if (!class_exists($class) && file_exists($this->getPath() . '/' . $file . '.php') ) { |
|
| 206 | - return include $this->getPath() . '/' . $file . '.php'; |
|
| 205 | + if (!class_exists($class) && file_exists($this->getPath().'/'.$file.'.php')) { |
|
| 206 | + return include $this->getPath().'/'.$file.'.php'; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | return new $class(); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | { |
| 219 | 219 | $path = $this->getPath(); |
| 220 | 220 | foreach ($files as $file) { |
| 221 | - $this->laravel['files']->requireOnce($path . '/' . $file . '.php'); |
|
| 221 | + $this->laravel['files']->requireOnce($path.'/'.$file.'.php'); |
|
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $result = $query->orderBy('migration', 'desc')->get(); |
| 303 | 303 | |
| 304 | - return collect($result)->map(function ($item) { |
|
| 304 | + return collect($result)->map(function($item) { |
|
| 305 | 305 | return (array) $item; |
| 306 | 306 | })->pluck('migration'); |
| 307 | 307 | } |