| @@ -221,7 +221,7 @@ discard block | ||
| 221 | 221 | $file = 'module.json'; | 
| 222 | 222 | } | 
| 223 | 223 | |
| 224 | -        return Arr::get($this->moduleJson, $file, function () use ($file) { | |
| 224 | +        return Arr::get($this->moduleJson, $file, function() use ($file) { | |
| 225 | 225 | return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->files); | 
| 226 | 226 | }); | 
| 227 | 227 | } | 
| @@ -328,7 +328,7 @@ discard block | ||
| 328 | 328 | */ | 
| 329 | 329 | public function isDisabled(): bool | 
| 330 | 330 |      { | 
| 331 | - return ! $this->isEnabled(); | |
| 331 | + return !$this->isEnabled(); | |
| 332 | 332 | } | 
| 333 | 333 | |
| 334 | 334 | /** | 
| @@ -394,7 +394,7 @@ discard block | ||
| 394 | 394 |      { | 
| 395 | 395 |          return config('modules.register.files', 'register') === 'boot' && | 
| 396 | 396 | // force register method if option == boot && app is AsgardCms | 
| 397 | -            ! class_exists('\Modules\Core\Foundation\AsgardCms'); | |
| 397 | +            !class_exists('\Modules\Core\Foundation\AsgardCms'); | |
| 398 | 398 | } | 
| 399 | 399 | |
| 400 | 400 | /** | 
| @@ -20,7 +20,7 @@ | ||
| 20 | 20 | */ | 
| 21 | 21 | public function toArray(): array | 
| 22 | 22 |      { | 
| 23 | -        return array_map(function ($value) { | |
| 23 | +        return array_map(function($value) { | |
| 24 | 24 |              if ($value instanceof Module) { | 
| 25 | 25 | $attributes = $value->json()->getAttributes(); | 
| 26 | 26 | $attributes['path'] = $value->getPath(); | 
| @@ -52,7 +52,7 @@ | ||
| 52 | 52 | /** | 
| 53 | 53 | * Get modules by the given status. | 
| 54 | 54 | */ | 
| 55 | - public function getByStatus(int|bool $status); | |
| 55 | + public function getByStatus(int | bool $status); | |
| 56 | 56 | |
| 57 | 57 | /** | 
| 58 | 58 | * Find a specific module. | 
| @@ -79,7 +79,7 @@ discard block | ||
| 79 | 79 | */ | 
| 80 | 80 | public function config(string $key): array | 
| 81 | 81 |      { | 
| 82 | -        return collect($this->getManifest())->flatMap(function ($configuration) use ($key) { | |
| 82 | +        return collect($this->getManifest())->flatMap(function($configuration) use ($key) { | |
| 83 | 83 | return (array) ($configuration[$key] ?? []); | 
| 84 | 84 | })->filter()->all(); | 
| 85 | 85 | } | 
| @@ -89,11 +89,11 @@ discard block | ||
| 89 | 89 | */ | 
| 90 | 90 | protected function getManifest(): array | 
| 91 | 91 |      { | 
| 92 | -        if (! is_null($this->manifest)) { | |
| 92 | +        if (!is_null($this->manifest)) { | |
| 93 | 93 | return $this->manifest; | 
| 94 | 94 | } | 
| 95 | 95 | |
| 96 | -        if (! is_file($this->manifestPath)) { | |
| 96 | +        if (!is_file($this->manifestPath)) { | |
| 97 | 97 | $this->build(); | 
| 98 | 98 | } | 
| 99 | 99 | |
| @@ -128,7 +128,7 @@ discard block | ||
| 128 | 128 | */ | 
| 129 | 129 | protected function write(array $manifest): void | 
| 130 | 130 |      { | 
| 131 | -        if (! is_writable($dirname = dirname($this->manifestPath))) { | |
| 131 | +        if (!is_writable($dirname = dirname($this->manifestPath))) { | |
| 132 | 132 |              throw new Exception("The {$dirname} directory must be present and writable."); | 
| 133 | 133 | } | 
| 134 | 134 | $this->files->replace( | 
| @@ -141,7 +141,7 @@ discard block | ||
| 141 | 141 |      { | 
| 142 | 142 | // todo check this section store on module.php or not? | 
| 143 | 143 | $this->getModulesData() | 
| 144 | -            ->each(function (array $manifest) { | |
| 144 | +            ->each(function(array $manifest) { | |
| 145 | 145 |                  if (empty($manifest['files'])) { | 
| 146 | 146 | return; | 
| 147 | 147 | } | 
| @@ -154,17 +154,17 @@ discard block | ||
| 154 | 154 | |
| 155 | 155 | public function getModulesData(): Collection | 
| 156 | 156 |      { | 
| 157 | -        if (! empty(self::$manifestData) && ! app()->runningUnitTests()) { | |
| 157 | +        if (!empty(self::$manifestData) && !app()->runningUnitTests()) { | |
| 158 | 158 | return self::$manifestData; | 
| 159 | 159 | } | 
| 160 | 160 | |
| 161 | 161 | self::$manifestData = $this->paths | 
| 162 | -            ->flatMap(function ($path) { | |
| 162 | +            ->flatMap(function($path) { | |
| 163 | 163 |                  $manifests = $this->files->glob("{$path}/module.json"); | 
| 164 | 164 | is_array($manifests) || $manifests = []; | 
| 165 | 165 | |
| 166 | 166 | return collect($manifests) | 
| 167 | -                    ->map(function ($manifest) { | |
| 167 | +                    ->map(function($manifest) { | |
| 168 | 168 | return [ | 
| 169 | 169 | 'module_directory' => dirname($manifest), | 
| 170 | 170 | ...$this->files->json($manifest), | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 |              $paths = array_merge($paths, $this->config('scan.paths')); | 
| 111 | 111 | } | 
| 112 | 112 | |
| 113 | -        $paths = array_map(function ($path) { | |
| 113 | +        $paths = array_map(function($path) { | |
| 114 | 114 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); | 
| 115 | 115 | }, $paths); | 
| 116 | 116 | |
| @@ -127,7 +127,7 @@ discard block | ||
| 127 | 127 | */ | 
| 128 | 128 | public function scan(): array | 
| 129 | 129 |      { | 
| 130 | -        if (! empty(self::$modules) && ! $this->app->runningUnitTests()) { | |
| 130 | +        if (!empty(self::$modules) && !$this->app->runningUnitTests()) { | |
| 131 | 131 | return self::$modules; | 
| 132 | 132 | } | 
| 133 | 133 | |
| @@ -223,7 +223,7 @@ discard block | ||
| 223 | 223 |      { | 
| 224 | 224 | $modules = $this->allEnabled(); | 
| 225 | 225 | |
| 226 | -        uasort($modules, function (Module $a, Module $b) use ($direction) { | |
| 226 | +        uasort($modules, function(Module $a, Module $b) use ($direction) { | |
| 227 | 227 |              if ($a->get('priority') === $b->get('priority')) { | 
| 228 | 228 | return 0; | 
| 229 | 229 | } | 
| @@ -337,7 +337,7 @@ discard block | ||
| 337 | 337 | } | 
| 338 | 338 | |
| 339 | 339 |          $path = storage_path('app/modules/modules.used'); | 
| 340 | -        if (! $this->getFiles()->exists($path)) { | |
| 340 | +        if (!$this->getFiles()->exists($path)) { | |
| 341 | 341 | $this->getFiles()->put($path, ''); | 
| 342 | 342 | } | 
| 343 | 343 | |
| @@ -426,7 +426,7 @@ discard block | ||
| 426 | 426 | */ | 
| 427 | 427 | public function isDisabled(string $name): bool | 
| 428 | 428 |      { | 
| 429 | - return ! $this->isEnabled($name); | |
| 429 | + return !$this->isEnabled($name); | |
| 430 | 430 | } | 
| 431 | 431 | |
| 432 | 432 | /** | 
| @@ -3,7 +3,7 @@ discard block | ||
| 3 | 3 | use Illuminate\Foundation\Vite; | 
| 4 | 4 | use Illuminate\Support\Facades\Vite as ViteFacade; | 
| 5 | 5 | |
| 6 | -if (! function_exists('module_path')) { | |
| 6 | +if (!function_exists('module_path')) { | |
| 7 | 7 | function module_path($name, $path = '') | 
| 8 | 8 |      { | 
| 9 | 9 |          $module = app('modules')->find($name); | 
| @@ -12,7 +12,7 @@ discard block | ||
| 12 | 12 | } | 
| 13 | 13 | } | 
| 14 | 14 | |
| 15 | -if (! function_exists('config_path')) { | |
| 15 | +if (!function_exists('config_path')) { | |
| 16 | 16 | /** | 
| 17 | 17 | * Get the configuration path. | 
| 18 | 18 | */ | 
| @@ -22,7 +22,7 @@ discard block | ||
| 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 | */ | 
| @@ -32,7 +32,7 @@ discard block | ||
| 32 | 32 | } | 
| 33 | 33 | } | 
| 34 | 34 | |
| 35 | -if (! function_exists('module_vite')) { | |
| 35 | +if (!function_exists('module_vite')) { | |
| 36 | 36 | /** | 
| 37 | 37 | * support for vite | 
| 38 | 38 | */ | 
| @@ -31,13 +31,13 @@ | ||
| 31 | 31 |          $phpunitXmlPath = base_path('phpunit.xml'); | 
| 32 | 32 |          $modulesStatusPath = base_path('modules_statuses.json'); | 
| 33 | 33 | |
| 34 | -        if (! file_exists($phpunitXmlPath)) { | |
| 34 | +        if (!file_exists($phpunitXmlPath)) { | |
| 35 | 35 |              $this->error("phpunit.xml file not found: {$phpunitXmlPath}"); | 
| 36 | 36 | |
| 37 | 37 | return 100; | 
| 38 | 38 | } | 
| 39 | 39 | |
| 40 | -        if (! file_exists($modulesStatusPath)) { | |
| 40 | +        if (!file_exists($modulesStatusPath)) { | |
| 41 | 41 |              $this->error("Modules statuses file not found: {$modulesStatusPath}"); | 
| 42 | 42 | |
| 43 | 43 | return 99; |