@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $file = 'module.json'; |
237 | 237 | } |
238 | 238 | |
239 | - return Arr::get($this->moduleJson, $file, function () use ($file) { |
|
239 | + return Arr::get($this->moduleJson, $file, function() use ($file) { |
|
240 | 240 | return $this->moduleJson[$file] = new Json($this->path($file), $this->files); |
241 | 241 | }); |
242 | 242 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function isDisabled(): bool |
337 | 337 | { |
338 | - return ! $this->isEnabled(); |
|
338 | + return !$this->isEnabled(); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | { |
404 | 404 | return config('modules.register.files', 'register') === 'boot' && |
405 | 405 | // force register method if option == boot && app is AsgardCms |
406 | - ! class_exists('\Modules\Core\Foundation\AsgardCms'); |
|
406 | + !class_exists('\Modules\Core\Foundation\AsgardCms'); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | /** |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | /** |
265 | 265 | * Set force status. |
266 | 266 | */ |
267 | - public function setForce(bool|int $force): self |
|
267 | + public function setForce(bool | int $force): self |
|
268 | 268 | { |
269 | 269 | $this->force = $force; |
270 | 270 | |
@@ -355,8 +355,8 @@ discard block |
||
355 | 355 | foreach ($this->getFiles() as $stub => $file) { |
356 | 356 | $path = $this->module->getModulePath($this->getName()).$file; |
357 | 357 | |
358 | - $this->component->task("Generating file {$path}", function () use ($stub, $path) { |
|
359 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
358 | + $this->component->task("Generating file {$path}", function() use ($stub, $path) { |
|
359 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
360 | 360 | $this->filesystem->makeDirectory($dir, 0775, true); |
361 | 361 | } |
362 | 362 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $eventGeneratorConfig = GenerateConfigReader::read('event-provider'); |
399 | 399 | if ( |
400 | 400 | (is_null($eventGeneratorConfig->path()) && $providerGenerator->generate()) |
401 | - || (! is_null($eventGeneratorConfig->path()) && $eventGeneratorConfig->generate()) |
|
401 | + || (!is_null($eventGeneratorConfig->path()) && $eventGeneratorConfig->generate()) |
|
402 | 402 | ) { |
403 | 403 | $this->console->call('module:make-event-provider', [ |
404 | 404 | 'module' => $this->getName(), |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $routeGeneratorConfig = GenerateConfigReader::read('route-provider'); |
418 | 418 | if ( |
419 | 419 | (is_null($routeGeneratorConfig->path()) && $providerGenerator->generate()) |
420 | - || (! is_null($routeGeneratorConfig->path()) && $routeGeneratorConfig->generate()) |
|
420 | + || (!is_null($routeGeneratorConfig->path()) && $routeGeneratorConfig->generate()) |
|
421 | 421 | ) { |
422 | 422 | $this->console->call('module:route-provider', [ |
423 | 423 | 'module' => $this->getName(), |
@@ -470,23 +470,23 @@ discard block |
||
470 | 470 | $replacements = $this->module->config('stubs.replacements'); |
471 | 471 | |
472 | 472 | // Temporarily check if the replacements are defined; remove in the next major version. |
473 | - if (! isset($replacements['composer']['APP_PATH'])) { |
|
473 | + if (!isset($replacements['composer']['APP_PATH'])) { |
|
474 | 474 | $replacements['composer'][] = 'APP_PATH'; |
475 | 475 | } |
476 | 476 | |
477 | - if (! isset($replacements['composer']['APP_PATH_NAMESPACE'])) { |
|
477 | + if (!isset($replacements['composer']['APP_PATH_NAMESPACE'])) { |
|
478 | 478 | $replacements['composer'][] = 'APP_PATH_NAMESPACE'; |
479 | 479 | } |
480 | 480 | |
481 | - if (! isset($replacements['routes/web']['PLURAL_LOWER_NAME'])) { |
|
481 | + if (!isset($replacements['routes/web']['PLURAL_LOWER_NAME'])) { |
|
482 | 482 | $replacements['routes/web'][] = 'PLURAL_LOWER_NAME'; |
483 | 483 | } |
484 | 484 | |
485 | - if (! isset($replacements['routes/api']['PLURAL_LOWER_NAME'])) { |
|
485 | + if (!isset($replacements['routes/api']['PLURAL_LOWER_NAME'])) { |
|
486 | 486 | $replacements['routes/api'][] = 'PLURAL_LOWER_NAME'; |
487 | 487 | } |
488 | 488 | |
489 | - if (! isset($replacements[$stub])) { |
|
489 | + if (!isset($replacements[$stub])) { |
|
490 | 490 | return []; |
491 | 491 | } |
492 | 492 | |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | { |
527 | 527 | $path = $this->module->getModulePath($this->getName()).'module.json'; |
528 | 528 | |
529 | - $this->component->task("Generating file $path", function () use ($path) { |
|
530 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
529 | + $this->component->task("Generating file $path", function() use ($path) { |
|
530 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
531 | 531 | $this->filesystem->makeDirectory($dir, 0775, true); |
532 | 532 | } |
533 | 533 |
@@ -115,7 +115,7 @@ |
||
115 | 115 | { |
116 | 116 | $path = $this->path(); |
117 | 117 | |
118 | - if (! $this->filesystem->exists($path)) { |
|
118 | + if (!$this->filesystem->exists($path)) { |
|
119 | 119 | return $this->filesystem->put($path, $this->getContents()); |
120 | 120 | } |
121 | 121 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Illuminate\Support\Facades\Vite as ViteFacade; |
6 | 6 | use Nwidart\Modules\Laravel\Module; |
7 | 7 | |
8 | -if (! function_exists('module')) { |
|
8 | +if (!function_exists('module')) { |
|
9 | 9 | /** |
10 | 10 | * Retrieves a module status or its instance. |
11 | 11 | * |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | * @param bool $instance Whether to return the module's instance instead of the status. Defaults to false [status]. |
14 | 14 | * @return bool|Module The module instance or its status. |
15 | 15 | */ |
16 | - function module(string $name, bool $instance = false): bool|Module |
|
16 | + function module(string $name, bool $instance = false): bool | Module |
|
17 | 17 | { |
18 | 18 | $modules = app('modules'); |
19 | - if (! $modules->has($name)) { |
|
19 | + if (!$modules->has($name)) { |
|
20 | 20 | Log::error("Module '$name' not found."); |
21 | 21 | |
22 | 22 | return false; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | -if (! function_exists('module_path')) { |
|
29 | +if (!function_exists('module_path')) { |
|
30 | 30 | function module_path(string $name, string $path = ''): string |
31 | 31 | { |
32 | 32 | $module = module($name, true); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | -if (! function_exists('config_path')) { |
|
38 | +if (!function_exists('config_path')) { |
|
39 | 39 | /** |
40 | 40 | * Get the configuration path. |
41 | 41 | */ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | -if (! function_exists('public_path')) { |
|
48 | +if (!function_exists('public_path')) { |
|
49 | 49 | /** |
50 | 50 | * Get the path to the public folder. |
51 | 51 | */ |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | -if (! function_exists('module_vite')) { |
|
58 | +if (!function_exists('module_vite')) { |
|
59 | 59 | /** |
60 | 60 | * support for vite |
61 | 61 | */ |