@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if (! empty($input->getArgument('module'))) { |
|
| 53 | + if (!empty($input->getArgument('module'))) { |
|
| 54 | 54 | return; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -77,15 +77,15 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | protected function models(): Collection |
| 79 | 79 | { |
| 80 | - if (! empty($models = $this->option('model'))) { |
|
| 81 | - return collect($models)->filter(function ($model) { |
|
| 80 | + if (!empty($models = $this->option('model'))) { |
|
| 81 | + return collect($models)->filter(function($model) { |
|
| 82 | 82 | return class_exists($model); |
| 83 | 83 | })->values(); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $except = $this->option('except'); |
| 87 | 87 | |
| 88 | - if (! empty($models) && ! empty($except)) { |
|
| 88 | + if (!empty($models) && !empty($except)) { |
|
| 89 | 89 | throw new InvalidArgumentException('The --models and --except options cannot be combined.'); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return collect(Finder::create()->in($path)->files()->name('*.php')) |
| 112 | - ->map(function ($model) { |
|
| 112 | + ->map(function($model) { |
|
| 113 | 113 | |
| 114 | 114 | $namespace = config('modules.namespace'); |
| 115 | 115 | |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | ); |
| 121 | 121 | }) |
| 122 | 122 | ->values() |
| 123 | - ->when(! empty($except), function ($models) use ($except) { |
|
| 124 | - return $models->reject(function ($model) use ($except) { |
|
| 123 | + ->when(!empty($except), function($models) use ($except) { |
|
| 124 | + return $models->reject(function($model) use ($except) { |
|
| 125 | 125 | return in_array($model, $except); |
| 126 | 126 | }); |
| 127 | - })->filter(function ($model) { |
|
| 127 | + })->filter(function($model) { |
|
| 128 | 128 | return class_exists($model); |
| 129 | - })->filter(function ($model) { |
|
| 129 | + })->filter(function($model) { |
|
| 130 | 130 | return $this->isPrunable($model); |
| 131 | 131 | })->values(); |
| 132 | 132 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function getProviders(): array |
| 56 | 56 | { |
| 57 | - if (! empty($this->manifest)) { |
|
| 57 | + if (!empty($this->manifest)) { |
|
| 58 | 58 | return $this->manifest; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | // todo check this section store on module.php or not? |
| 79 | 79 | $this->getModulesData() |
| 80 | - ->each(function (array $manifest) { |
|
| 80 | + ->each(function(array $manifest) { |
|
| 81 | 81 | if (empty($manifest['files'])) { |
| 82 | 82 | return; |
| 83 | 83 | } |
@@ -90,17 +90,17 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function getModulesData(): Collection |
| 92 | 92 | { |
| 93 | - if (! empty(self::$manifestData) && ! app()->runningUnitTests()) { |
|
| 93 | + if (!empty(self::$manifestData) && !app()->runningUnitTests()) { |
|
| 94 | 94 | return self::$manifestData; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | self::$manifestData = $this->paths |
| 98 | - ->flatMap(function ($path) { |
|
| 98 | + ->flatMap(function($path) { |
|
| 99 | 99 | $manifests = $this->files->glob("{$path}/module.json"); |
| 100 | 100 | is_array($manifests) || $manifests = []; |
| 101 | 101 | |
| 102 | 102 | return collect($manifests) |
| 103 | - ->map(function ($manifest) { |
|
| 103 | + ->map(function($manifest) { |
|
| 104 | 104 | return [ |
| 105 | 105 | 'module_directory' => dirname($manifest), |
| 106 | 106 | ...$this->files->json($manifest), |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | use Illuminate\Support\Facades\Vite as ViteFacade; |
| 5 | 5 | use Nwidart\Modules\Laravel\Module; |
| 6 | 6 | |
| 7 | -if (! function_exists('module')) { |
|
| 7 | +if (!function_exists('module')) { |
|
| 8 | 8 | /** |
| 9 | 9 | * Retrieves a module instance or its status. |
| 10 | 10 | * |
@@ -12,11 +12,11 @@ discard block |
||
| 12 | 12 | * @param bool $status Whether to return the module's status instead of the instance. Defaults to false. |
| 13 | 13 | * @return Module|bool The module instance or its status. |
| 14 | 14 | */ |
| 15 | - function module(string $name, bool $status = false): Module|bool |
|
| 15 | + function module(string $name, bool $status = false): Module | bool |
|
| 16 | 16 | { |
| 17 | 17 | $modules = app('modules'); |
| 18 | 18 | |
| 19 | - if (! $modules->has($name)) { |
|
| 19 | + if (!$modules->has($name)) { |
|
| 20 | 20 | throw new InvalidArgumentException("Module '$name' not found."); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -if (! function_exists('module_path')) { |
|
| 27 | +if (!function_exists('module_path')) { |
|
| 28 | 28 | function module_path(string $name, string $path = ''): string |
| 29 | 29 | { |
| 30 | 30 | $module = app('modules')->find($name); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -if (! function_exists('config_path')) { |
|
| 36 | +if (!function_exists('config_path')) { |
|
| 37 | 37 | /** |
| 38 | 38 | * Get the configuration path. |
| 39 | 39 | */ |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -if (! function_exists('public_path')) { |
|
| 46 | +if (!function_exists('public_path')) { |
|
| 47 | 47 | /** |
| 48 | 48 | * Get the path to the public folder. |
| 49 | 49 | */ |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -if (! function_exists('module_vite')) { |
|
| 56 | +if (!function_exists('module_vite')) { |
|
| 57 | 57 | /** |
| 58 | 58 | * support for vite |
| 59 | 59 | */ |