@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function hasStatus(Module $module, bool $status): bool |
113 | 113 | { |
114 | - if (! isset($this->modulesStatuses[$module->getName()])) { |
|
114 | + if (!isset($this->modulesStatuses[$module->getName()])) { |
|
115 | 115 | return $status === false; |
116 | 116 | } |
117 | 117 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function delete(Module $module): void |
143 | 143 | { |
144 | - if (! isset($this->modulesStatuses[$module->getName()])) { |
|
144 | + if (!isset($this->modulesStatuses[$module->getName()])) { |
|
145 | 145 | return; |
146 | 146 | } |
147 | 147 | unset($this->modulesStatuses[$module->getName()]); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | private function readJson(): array |
166 | 166 | { |
167 | - if (! $this->files->exists($this->statusesFile)) { |
|
167 | + if (!$this->files->exists($this->statusesFile)) { |
|
168 | 168 | return []; |
169 | 169 | } |
170 | 170 | |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | */ |
180 | 180 | private function getModulesStatuses(): array |
181 | 181 | { |
182 | - if (! $this->config->get('modules.cache.enabled')) { |
|
182 | + if (!$this->config->get('modules.cache.enabled')) { |
|
183 | 183 | return $this->readJson(); |
184 | 184 | } |
185 | 185 | |
186 | - return $this->cache->remember($this->cacheKey, $this->cacheLifetime, function () { |
|
186 | + return $this->cache->remember($this->cacheKey, $this->cacheLifetime, function() { |
|
187 | 187 | return $this->readJson(); |
188 | 188 | }); |
189 | 189 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | foreach ($this->getFiles() as $stub => $file) { |
364 | 364 | $path = $this->module->getModulePath($this->getName()).$file; |
365 | 365 | |
366 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
366 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
367 | 367 | $this->filesystem->makeDirectory($dir, 0775, true); |
368 | 368 | } |
369 | 369 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | { |
443 | 443 | $replacements = $this->module->config('stubs.replacements'); |
444 | 444 | |
445 | - if (! isset($replacements[$stub])) { |
|
445 | + if (!isset($replacements[$stub])) { |
|
446 | 446 | return []; |
447 | 447 | } |
448 | 448 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | { |
475 | 475 | $path = $this->module->getModulePath($this->getName()).'module.json'; |
476 | 476 | |
477 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
477 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
478 | 478 | $this->filesystem->makeDirectory($dir, 0775, true); |
479 | 479 | } |
480 | 480 |
@@ -132,7 +132,7 @@ |
||
132 | 132 | public function generate() |
133 | 133 | { |
134 | 134 | $path = $this->getPath(); |
135 | - if (! $this->filesystem->exists($path)) { |
|
135 | + if (!$this->filesystem->exists($path)) { |
|
136 | 136 | return $this->filesystem->put($path, $this->getContents()); |
137 | 137 | } |
138 | 138 | if ($this->overwriteFile === true) { |
@@ -42,12 +42,12 @@ |
||
42 | 42 | */ |
43 | 43 | protected function registerServices() |
44 | 44 | { |
45 | - $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
45 | + $this->app->singleton(Contracts\RepositoryInterface::class, function($app) { |
|
46 | 46 | $path = $app['config']->get('modules.paths.modules'); |
47 | 47 | |
48 | 48 | return new Lumen\LumenFileRepository($app, $path); |
49 | 49 | }); |
50 | - $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) { |
|
50 | + $this->app->singleton(Contracts\ActivatorInterface::class, function($app) { |
|
51 | 51 | $activator = $app['config']->get('modules.activator'); |
52 | 52 | $class = $app['config']->get('modules.activators.'.$activator)['class']; |
53 | 53 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $concatenatedPackages .= "\"{$name}:{$version}\" "; |
45 | 45 | } |
46 | 46 | |
47 | - if (! empty($concatenatedPackages)) { |
|
47 | + if (!empty($concatenatedPackages)) { |
|
48 | 48 | $this->run("composer require {$concatenatedPackages}{$this->isComposerSilenced()}"); |
49 | 49 | } |
50 | 50 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $concatenatedPackages .= "\"{$name}:{$version}\" "; |
62 | 62 | } |
63 | 63 | |
64 | - if (! empty($concatenatedPackages)) { |
|
64 | + if (!empty($concatenatedPackages)) { |
|
65 | 65 | $this->run("composer require --dev {$concatenatedPackages}{$this->isComposerSilenced()}"); |
66 | 66 | } |
67 | 67 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $module = $this->argument('module'); |
34 | 34 | |
35 | - if ($module && ! $this->getModuleName()) { |
|
35 | + if ($module && !$this->getModuleName()) { |
|
36 | 36 | $this->error("Module [$module] does not exists."); |
37 | 37 | |
38 | 38 | return E_ERROR; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | $module = $this->argument('module'); |
82 | 82 | |
83 | - if (! $module) { |
|
83 | + if (!$module) { |
|
84 | 84 | return null; |
85 | 85 | } |
86 | 86 |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | public function recursiveSearch(string $folder, string $filename): array |
144 | 144 | { |
145 | 145 | // if that folder doesn't exist, then return an empty array to indicate that there is no $filename in such dir |
146 | - if (! is_dir($folder)) { |
|
146 | + if (!is_dir($folder)) { |
|
147 | 147 | return []; |
148 | 148 | } |
149 | 149 | |
150 | - $ignoreFiles = function ($fileInfo) { |
|
150 | + $ignoreFiles = function($fileInfo) { |
|
151 | 151 | $filesToIgnore = ['.git', '.idea']; |
152 | 152 | |
153 | 153 | if (in_array($fileInfo->getFilename(), $filesToIgnore)) { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | return true; |
158 | 158 | }; |
159 | 159 | |
160 | - $dir = new \RecursiveDirectoryIterator($folder, \FilesystemIterator::KEY_AS_PATHNAME|\FilesystemIterator::CURRENT_AS_FILEINFO|\FilesystemIterator::FOLLOW_SYMLINKS); |
|
160 | + $dir = new \RecursiveDirectoryIterator($folder, \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::FOLLOW_SYMLINKS); |
|
161 | 161 | $filtered = new \RecursiveCallbackFilterIterator($dir, $ignoreFiles); |
162 | 162 | $ite = new \RecursiveIteratorIterator($filtered); |
163 | 163 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function all() : array |
207 | 207 | { |
208 | - if (! $this->config('cache.enabled')) { |
|
208 | + if (!$this->config('cache.enabled')) { |
|
209 | 209 | return $this->scan(); |
210 | 210 | } |
211 | 211 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | */ |
240 | 240 | public function getCached() |
241 | 241 | { |
242 | - return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
242 | + return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
243 | 243 | return $this->toCollection()->toArray(); |
244 | 244 | }); |
245 | 245 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | { |
329 | 329 | $modules = $this->allEnabled(); |
330 | 330 | |
331 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
331 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
332 | 332 | if ($a->get('priority') === $b->get('priority')) { |
333 | 333 | return 0; |
334 | 334 | } |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | } |
489 | 489 | |
490 | 490 | $path = storage_path('app/modules/modules.used'); |
491 | - if (! $this->getFiles()->exists($path)) { |
|
491 | + if (!$this->getFiles()->exists($path)) { |
|
492 | 492 | $this->getFiles()->put($path, ''); |
493 | 493 | } |
494 | 494 | |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | */ |
583 | 583 | public function isDisabled(string $name) : bool |
584 | 584 | { |
585 | - return ! $this->isEnabled($name); |
|
585 | + return !$this->isEnabled($name); |
|
586 | 586 | } |
587 | 587 | |
588 | 588 | /** |