@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $name = $module->getName(); |
| 104 | 104 | $config = $module->get('migration'); |
| 105 | 105 | if (is_array($config) && array_key_exists('seeds', $config)) { |
| 106 | - foreach ((array)$config['seeds'] as $class) { |
|
| 106 | + foreach ((array) $config['seeds'] as $class) { |
|
| 107 | 107 | if (class_exists($class)) { |
| 108 | 108 | $seeders[] = $class; |
| 109 | 109 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | protected function dbSeed($className) |
| 138 | 138 | { |
| 139 | 139 | if ($option = $this->option('class')) { |
| 140 | - $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\') . $option; |
|
| 140 | + $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\').$option; |
|
| 141 | 141 | } else { |
| 142 | 142 | $params = ['--class' => $className]; |
| 143 | 143 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $config = GenerateConfigReader::read('seeder'); |
| 169 | 169 | $seederPath = str_replace('/', '\\', $config->getPath()); |
| 170 | 170 | |
| 171 | - return $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder'; |
|
| 171 | + return $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder'; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $foundModules = []; |
| 189 | 189 | foreach ($this->laravel['modules']->config('scan.paths') as $path) { |
| 190 | 190 | $namespace = array_slice(explode('/', $path), -1)[0]; |
| 191 | - $foundModules[] = $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder'; |
|
| 191 | + $foundModules[] = $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder'; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | return $foundModules; |
@@ -1,15 +1,15 @@ 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, $path = '') |
| 5 | 5 | { |
| 6 | 6 | $module = app('modules')->find($name); |
| 7 | 7 | |
| 8 | - return $module->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 8 | + return $module->getPath().($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 9 | 9 | } |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | -if (! function_exists('config_path')) { |
|
| 12 | +if (!function_exists('config_path')) { |
|
| 13 | 13 | /** |
| 14 | 14 | * Get the configuration path. |
| 15 | 15 | * |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function config_path($path = '') |
| 20 | 20 | { |
| 21 | - return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 21 | + return app()->basePath().'/config'.($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -if (! function_exists('public_path')) { |
|
| 25 | +if (!function_exists('public_path')) { |
|
| 26 | 26 | /** |
| 27 | 27 | * Get the path to the public folder. |
| 28 | 28 | * |
@@ -31,6 +31,6 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function public_path($path = '') |
| 33 | 33 | { |
| 34 | - return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path); |
|
| 34 | + return app()->make('path.public').($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path); |
|
| 35 | 35 | } |
| 36 | 36 | } |
@@ -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 | /** |
@@ -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(); |
@@ -36,8 +36,8 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | protected function registerNamespaces() |
| 38 | 38 | { |
| 39 | - $configPath = __DIR__ . '/../config/config.php'; |
|
| 40 | - $stubsPath = dirname(__DIR__) . '/src/Commands/stubs'; |
|
| 39 | + $configPath = __DIR__.'/../config/config.php'; |
|
| 40 | + $stubsPath = dirname(__DIR__).'/src/Commands/stubs'; |
|
| 41 | 41 | |
| 42 | 42 | $this->publishes([ |
| 43 | 43 | $configPath => config_path('modules.php'), |
@@ -18,9 +18,9 @@ |
||
| 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->getSnakeNamespace() . '_module.php', $this->app->getCachedConfigPath()); |
|
| 21 | + return Str::replaceLast('config.php', $this->getSnakeNamespace().'_module.php', $this->app->getCachedConfigPath()); |
|
| 22 | 22 | } |
| 23 | - return Str::replaceLast('services.php', $this->getSnakeNamespace() . '_module.php', $this->app->getCachedServicesPath()); |
|
| 23 | + return Str::replaceLast('services.php', $this->getSnakeNamespace().'_module.php', $this->app->getCachedServicesPath()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $factoryPath = GenerateConfigReader::read('factory'); |
| 70 | 70 | |
| 71 | - return $path . $factoryPath->getPath() . '/' . $this->getFileName(); |
|
| 71 | + return $path.$factoryPath->getPath().'/'.$this->getFileName(); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | private function getFileName() |
| 78 | 78 | { |
| 79 | - return Str::studly($this->argument('name')) . 'Factory.php'; |
|
| 79 | + return Str::studly($this->argument('name')).'Factory.php'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -111,6 +111,6 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function getModelNamespace(): string |
| 113 | 113 | { |
| 114 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->getModule()->getSubModuleOneSlashNamespace() . '\\' . $this->laravel['modules']->config('paths.generator.model.path', 'Entities'); |
|
| 114 | + return $this->laravel['modules']->config('namespace').'\\'.$this->getModule()->getSubModuleOneSlashNamespace().'\\'.$this->laravel['modules']->config('paths.generator.model.path', 'Entities'); |
|
| 115 | 115 | } |
| 116 | 116 | } |