@@ -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 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | use Nwidart\Modules\FileRepository; |
7 | 7 | use Nwidart\Modules\Module; |
8 | 8 | |
9 | -if (! function_exists('module')) { |
|
9 | +if (!function_exists('module')) { |
|
10 | 10 | /** |
11 | 11 | * Retrieves a module status or its instance. |
12 | 12 | * |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @param bool $instance Whether to return the module's instance instead of the status. Defaults to false [status]. |
15 | 15 | * @return bool|Module The module instance or its status. |
16 | 16 | */ |
17 | - function module(string $name, bool $instance = false): bool|Module |
|
17 | + function module(string $name, bool $instance = false): bool | Module |
|
18 | 18 | { |
19 | 19 | /** @var FileRepository $repository */ |
20 | 20 | $repository = app('modules'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | -if (! function_exists('module_path')) { |
|
32 | +if (!function_exists('module_path')) { |
|
33 | 33 | function module_path(string $name, string $path = ''): string |
34 | 34 | { |
35 | 35 | $module = module($name, true); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | -if (! function_exists('config_path')) { |
|
41 | +if (!function_exists('config_path')) { |
|
42 | 42 | /** |
43 | 43 | * Get the configuration path. |
44 | 44 | */ |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | -if (! function_exists('public_path')) { |
|
51 | +if (!function_exists('public_path')) { |
|
52 | 52 | /** |
53 | 53 | * Get the path to the public folder. |
54 | 54 | */ |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | -if (! function_exists('module_vite')) { |
|
61 | +if (!function_exists('module_vite')) { |
|
62 | 62 | /** |
63 | 63 | * support for vite |
64 | 64 | */ |