@@ -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), |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function handle(): int |
| 30 | 30 | { |
| 31 | 31 | $appFolder = config('modules.paths.app_folder', 'app/'); |
| 32 | - $appFolder = rtrim($appFolder, '/') . '/'; |
|
| 32 | + $appFolder = rtrim($appFolder, '/').'/'; |
|
| 33 | 33 | $phpunitXmlPath = base_path('phpunit.xml'); |
| 34 | 34 | $modulesStatusPath = base_path('modules_statuses.json'); |
| 35 | 35 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $enabledModules = json_decode(file_get_contents($modulesStatusPath), true); |
| 47 | 47 | |
| 48 | 48 | if (json_last_error() !== JSON_ERROR_NONE) { |
| 49 | - $this->error("Error decoding JSON from {$modulesStatusPath}: " . json_last_error_msg()); |
|
| 49 | + $this->error("Error decoding JSON from {$modulesStatusPath}: ".json_last_error_msg()); |
|
| 50 | 50 | return 98; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | foreach ($enabledModules as $module => $status) { |
| 57 | 57 | if ($status) { // Only add enabled modules |
| 58 | - $moduleDir = $modulesPath . $module . '/' . $appFolder; |
|
| 58 | + $moduleDir = $modulesPath.$module.'/'.$appFolder; |
|
| 59 | 59 | if (is_dir($moduleDir)) { |
| 60 | 60 | $moduleDirs[] = $moduleDir; |
| 61 | 61 | } |