@@ -138,7 +138,7 @@ |
||
| 138 | 138 | $process->setTimeout($this->timeout); |
| 139 | 139 | |
| 140 | 140 | if ($this->console instanceof Command) { |
| 141 | - $process->run(function ($type, $line) { |
|
| 141 | + $process->run(function($type, $line) { |
|
| 142 | 142 | $this->console->line($line); |
| 143 | 143 | }); |
| 144 | 144 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | public function all(): array |
| 73 | 73 | { |
| 74 | - if (! $this->config('cache.enabled')) { |
|
| 74 | + if (!$this->config('cache.enabled')) { |
|
| 75 | 75 | return $this->scan(); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function asset(string $asset): string |
| 92 | 92 | { |
| 93 | - if (! Str::contains($asset, ':')) { |
|
| 93 | + if (!Str::contains($asset, ':')) { |
|
| 94 | 94 | throw InvalidAssetPath::missingModuleName($asset); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | public function getCached(): array |
| 232 | 232 | { |
| 233 | - return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 233 | + return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 234 | 234 | return $this->toCollection()->toArray(); |
| 235 | 235 | }); |
| 236 | 236 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | { |
| 254 | 254 | $modules = $this->allEnabled(); |
| 255 | 255 | |
| 256 | - uasort($modules, static function (Module $a, Module $b) use ($direction) { |
|
| 256 | + uasort($modules, static function(Module $a, Module $b) use ($direction) { |
|
| 257 | 257 | $aOrder = $a->get('order'); |
| 258 | 258 | $bOrder = $b->get('order'); |
| 259 | 259 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | { |
| 286 | 286 | $paths = $this->paths; |
| 287 | 287 | |
| 288 | - if (! $this->onlyCustomPaths) { |
|
| 288 | + if (!$this->onlyCustomPaths) { |
|
| 289 | 289 | $paths[] = $this->getPath(); |
| 290 | 290 | } |
| 291 | 291 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $paths = array_merge($paths, $this->config('scan.paths')); |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - return array_map(static function ($path) { |
|
| 296 | + return array_map(static function($path) { |
|
| 297 | 297 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
| 298 | 298 | }, $paths); |
| 299 | 299 | } |
@@ -324,12 +324,12 @@ discard block |
||
| 324 | 324 | public function getUsedStoragePath(): string |
| 325 | 325 | { |
| 326 | 326 | $directory = storage_path('app/modules'); |
| 327 | - if (! $this->getFiles()->exists($directory)) { |
|
| 327 | + if (!$this->getFiles()->exists($directory)) { |
|
| 328 | 328 | $this->getFiles()->makeDirectory($directory, 0777, true); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | $path = storage_path('app/modules/modules.used'); |
| 332 | - if (! $this->getFiles()->exists($path)) { |
|
| 332 | + if (!$this->getFiles()->exists($path)) { |
|
| 333 | 333 | $this->getFiles()->put($path, ''); |
| 334 | 334 | } |
| 335 | 335 | |
@@ -353,19 +353,19 @@ discard block |
||
| 353 | 353 | foreach ($modules as $module) { |
| 354 | 354 | $path = $module->getExtraPath('config/module-views.php'); |
| 355 | 355 | |
| 356 | - if (! $this->files->exists($path)) { |
|
| 356 | + if (!$this->files->exists($path)) { |
|
| 357 | 357 | continue; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | $moduleViews = $this->files->getRequire($path); |
| 361 | 361 | $moduleViews = Arr::get($moduleViews, $moduleName, []); |
| 362 | 362 | |
| 363 | - if (! empty($moduleViews)) { |
|
| 363 | + if (!empty($moduleViews)) { |
|
| 364 | 364 | $partials = array_merge($partials, $moduleViews); |
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - uasort($partials, static function ($a, $b) { |
|
| 368 | + uasort($partials, static function($a, $b) { |
|
| 369 | 369 | $aOrder = $a['order'] ?? 0; |
| 370 | 370 | $bOrder = $b['order'] ?? 0; |
| 371 | 371 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | public function getCached(): array |
| 149 | 149 | { |
| 150 | - return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 150 | + return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 151 | 151 | return $this->toCollection()->toArray(); |
| 152 | 152 | }); |
| 153 | 153 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | { |
| 212 | 212 | $collection = new Collection; |
| 213 | 213 | |
| 214 | - $eloquentCollection->map(function ($module) use ($collection) { |
|
| 214 | + $eloquentCollection->map(function($module) use ($collection) { |
|
| 215 | 215 | /** @var \Rawilk\LaravelModules\Models\Module $module */ |
| 216 | 216 | $collection->push($this->createModule($this->app, $module->name, $module->path)); |
| 217 | 217 | }); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $installer->run(); |
| 58 | 58 | |
| 59 | - if (! $this->option('no-update')) { |
|
| 59 | + if (!$this->option('no-update')) { |
|
| 60 | 60 | $this->call('module:update', [ |
| 61 | 61 | 'module' => $installer->getModuleName() |
| 62 | 62 | ]); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | private function installFromFile(): void |
| 67 | 67 | { |
| 68 | - if (! file_exists($path = base_path('modules.json'))) { |
|
| 68 | + if (!file_exists($path = base_path('modules.json'))) { |
|
| 69 | 69 | $this->error("File 'modules.json' does not exist in your project root."); |
| 70 | 70 | |
| 71 | 71 | return; |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | private function generateDirectory(string $dir, string $success, string $error): void |
| 32 | 32 | { |
| 33 | - if (! $this->laravel['files']->isDirectory($dir)) { |
|
| 33 | + if (!$this->laravel['files']->isDirectory($dir)) { |
|
| 34 | 34 | $this->laravel['files']->makeDirectory($dir, 0755, true, true); |
| 35 | 35 | |
| 36 | 36 | $this->info($success); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $modules = $this->getModuleRepository(); |
| 75 | 75 | |
| 76 | - if (! $modules->has($name)) { |
|
| 76 | + if (!$modules->has($name)) { |
|
| 77 | 77 | throw new RuntimeException("Module [{$name}] does not exist!"); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $modules = $this->laravel['modules']; |
| 86 | 86 | |
| 87 | - if (! $modules instanceof Repository) { |
|
| 87 | + if (!$modules instanceof Repository) { |
|
| 88 | 88 | throw new RuntimeException('Module repository not found!'); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $module = Str::studly($this->argument('module')); |
| 20 | 20 | |
| 21 | - if (! $this->laravel['modules']->has($module)) { |
|
| 21 | + if (!$this->laravel['modules']->has($module)) { |
|
| 22 | 22 | $this->error("Module [{$module}] does not exist!"); |
| 23 | 23 | |
| 24 | 24 | return; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | $model = Str::studly($this->option('model')); |
| 63 | 63 | |
| 64 | - if (! $model) { |
|
| 64 | + if (!$model) { |
|
| 65 | 65 | $model = Model::class; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $repository = Str::studly($this->argument('repository')); |
| 78 | 78 | |
| 79 | - if (! Str::contains(strtolower($repository), 'repository')) { |
|
| 79 | + if (!Str::contains(strtolower($repository), 'repository')) { |
|
| 80 | 80 | $repository .= 'Repository'; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $path = str_replace('\\', '/', $this->getDestinationFilePath()); |
| 27 | 27 | |
| 28 | - if (! $this->laravel['files']->isDirectory($dir = dirname($path))) { |
|
| 28 | + if (!$this->laravel['files']->isDirectory($dir = dirname($path))) { |
|
| 29 | 29 | $this->laravel['files']->makeDirectory($dir, 0777, true); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -92,6 +92,6 @@ discard block |
||
| 92 | 92 | $path = str_replace('/', '\\', $path); |
| 93 | 93 | $pieces = explode("\\", $path); |
| 94 | 94 | |
| 95 | - return implode("\\", array_slice($pieces, 0, count($pieces) - 1) ); |
|
| 95 | + return implode("\\", array_slice($pieces, 0, count($pieces) - 1)); |
|
| 96 | 96 | } |
| 97 | 97 | } |