@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * {@inheritDoc} |
| 87 | 87 | */ |
| 88 | - public function hasStatus(Module|string $module, bool $status): bool |
|
| 88 | + public function hasStatus(Module | string $module, bool $status): bool |
|
| 89 | 89 | { |
| 90 | 90 | $name = $module instanceof Module ? $module->getName() : $module; |
| 91 | 91 | |
| 92 | - if (! isset($this->modulesStatuses[$name])) { |
|
| 92 | + if (!isset($this->modulesStatuses[$name])) { |
|
| 93 | 93 | return $status === false; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function delete(Module $module): void |
| 120 | 120 | { |
| 121 | - if (! isset($this->modulesStatuses[$module->getName()])) { |
|
| 121 | + if (!isset($this->modulesStatuses[$module->getName()])) { |
|
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | unset($this->modulesStatuses[$module->getName()]); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | private function readJson(): array |
| 142 | 142 | { |
| 143 | - if (! $this->files->exists($this->statusesFile)) { |
|
| 143 | + if (!$this->files->exists($this->statusesFile)) { |
|
| 144 | 144 | return []; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function config($key) |
| 102 | 102 | { |
| 103 | - return collect($this->getManifest())->flatMap(function ($configuration) use ($key) { |
|
| 104 | - return (array)($configuration[$key] ?? []); |
|
| 103 | + return collect($this->getManifest())->flatMap(function($configuration) use ($key) { |
|
| 104 | + return (array) ($configuration[$key] ?? []); |
|
| 105 | 105 | })->filter()->all(); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | protected function getManifest() |
| 114 | 114 | { |
| 115 | - if (! is_null($this->manifest)) { |
|
| 115 | + if (!is_null($this->manifest)) { |
|
| 116 | 116 | return $this->manifest; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - if (! is_file($this->manifestPath)) { |
|
| 119 | + if (!is_file($this->manifestPath)) { |
|
| 120 | 120 | $this->build(); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | protected function write(array $manifest): void |
| 157 | 157 | { |
| 158 | - if (! is_writable($dirname = dirname($this->manifestPath))) { |
|
| 158 | + if (!is_writable($dirname = dirname($this->manifestPath))) { |
|
| 159 | 159 | throw new Exception("The {$dirname} directory must be present and writable."); |
| 160 | 160 | } |
| 161 | 161 | $this->files->replace( |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | { |
| 169 | 169 | //todo check this section store on module.php or not? |
| 170 | 170 | $this->getModulesData() |
| 171 | - ->each(function (array $manifest) { |
|
| 171 | + ->each(function(array $manifest) { |
|
| 172 | 172 | if (empty($manifest['files'])) { |
| 173 | 173 | return; |
| 174 | 174 | } |
@@ -181,17 +181,17 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | public function getModulesData(): Collection |
| 183 | 183 | { |
| 184 | - if (! empty(self::$manifestData) && ! app()->runningUnitTests()) { |
|
| 184 | + if (!empty(self::$manifestData) && !app()->runningUnitTests()) { |
|
| 185 | 185 | return self::$manifestData; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | self::$manifestData = $this->paths |
| 189 | - ->flatMap(function ($path) { |
|
| 189 | + ->flatMap(function($path) { |
|
| 190 | 190 | $manifests = $this->files->glob("{$path}/module.json"); |
| 191 | 191 | is_array($manifests) || $manifests = []; |
| 192 | 192 | |
| 193 | 193 | return collect($manifests) |
| 194 | - ->map(function ($manifest) { |
|
| 194 | + ->map(function($manifest) { |
|
| 195 | 195 | return [ |
| 196 | 196 | 'module_directory' => dirname($manifest), |
| 197 | 197 | ...$this->files->json($manifest), |