Completed
Pull Request — master (#1947)
by
unknown
07:07
created
src/ModuleManifest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function config($key)
89 89
     {
90
-        return collect($this->getManifest())->flatMap(function ($configuration) use ($key) {
90
+        return collect($this->getManifest())->flatMap(function($configuration) use ($key) {
91 91
             return (array) ($configuration[$key] ?? []);
92 92
         })->filter()->all();
93 93
     }
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
      */
100 100
     protected function getManifest()
101 101
     {
102
-        if (! is_null($this->manifest)) {
102
+        if (!is_null($this->manifest)) {
103 103
             return $this->manifest;
104 104
         }
105 105
 
106
-        if (! is_file($this->manifestPath)) {
106
+        if (!is_file($this->manifestPath)) {
107 107
             $this->build();
108 108
         }
109 109
 
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
     public function build()
120 120
     {
121 121
         $providers = $this->paths
122
-            ->flatMap(function ($path) {
122
+            ->flatMap(function($path) {
123 123
                 $manifests = $this->files->glob("{$path}/module.json");
124 124
                 is_array($manifests) || $manifests = [];
125 125
 
126 126
                 return collect($manifests)
127
-                    ->map(function ($manifest) {
127
+                    ->map(function($manifest) {
128 128
                         return $this->files->json($manifest);
129 129
                     });
130 130
             })
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     protected function write(array $manifest)
154 154
     {
155
-        if (! is_writable($dirname = dirname($this->manifestPath))) {
155
+        if (!is_writable($dirname = dirname($this->manifestPath))) {
156 156
             throw new Exception("The {$dirname} directory must be present and writable.");
157 157
         }
158 158
         $this->files->replace(
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
     {
166 166
         //todo check this section store on module.php or not?
167 167
         $this->paths
168
-            ->flatMap(function ($path) {
168
+            ->flatMap(function($path) {
169 169
                 $manifests = $this->files->glob("{$path}/module.json");
170 170
                 is_array($manifests) || $manifests = [];
171 171
 
172 172
                 return collect($manifests)
173
-                    ->map(function ($manifest) {
173
+                    ->map(function($manifest) {
174 174
                         $json = $this->files->json($manifest);
175 175
 
176
-                        if (! empty($json['files'])) {
176
+                        if (!empty($json['files'])) {
177 177
                             return [
178 178
                                 'module_directory' => dirname($manifest),
179 179
                                 ...$this->files->json($manifest),
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             })
184 184
             ->filter()
185 185
             ->sortBy(fn ($module) => $module['priority'] ?? 0)
186
-            ->each(function (array $manifest) {
186
+            ->each(function(array $manifest) {
187 187
                 foreach ($manifest['files'] as $file) {
188 188
                     include_once $manifest['module_directory'].DIRECTORY_SEPARATOR.$file;
189 189
                 }
Please login to merge, or discard this patch.