@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $generatorPath = GenerateConfigReader::read('provider'); |
89 | 89 | |
90 | - return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
90 | + return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected function getWebRoutesPath() |
97 | 97 | { |
98 | - return '/' . $this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php'); |
|
98 | + return '/'.$this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | protected function getApiRoutesPath() |
105 | 105 | { |
106 | - return '/' . $this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php'); |
|
106 | + return '/'.$this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | public function getDefaultNamespace(): string |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function getMigrations($reverse = false) |
90 | 90 | { |
91 | - $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php'); |
|
91 | + $files = $this->laravel['files']->glob($this->getPath().'/*_*.php'); |
|
92 | 92 | |
93 | 93 | // Once we have the array of files in the directory we will just remove the |
94 | 94 | // extension and take the basename of the file which is all we need when |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return []; |
98 | 98 | } |
99 | 99 | |
100 | - $files = array_map(function ($file) { |
|
100 | + $files = array_map(function($file) { |
|
101 | 101 | return str_replace('.php', '', basename($file)); |
102 | 102 | }, $files); |
103 | 103 | |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | |
203 | 203 | $class = Str::studly($name); |
204 | 204 | |
205 | - if (!class_exists($class) && file_exists($this->getPath() . '/' . $file . '.php')) { |
|
206 | - return include $this->getPath() . '/' . $file . '.php'; |
|
205 | + if (!class_exists($class) && file_exists($this->getPath().'/'.$file.'.php')) { |
|
206 | + return include $this->getPath().'/'.$file.'.php'; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | return new $class(); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | { |
219 | 219 | $path = $this->getPath(); |
220 | 220 | foreach ($files as $file) { |
221 | - $this->laravel['files']->requireOnce($path . '/' . $file . '.php'); |
|
221 | + $this->laravel['files']->requireOnce($path.'/'.$file.'.php'); |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | $result = $query->orderBy('migration', 'desc')->get(); |
303 | 303 | |
304 | - return collect($result)->map(function ($item) { |
|
304 | + return collect($result)->map(function($item) { |
|
305 | 305 | return (array) $item; |
306 | 306 | })->pluck('migration'); |
307 | 307 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | continue; |
332 | 332 | } |
333 | 333 | |
334 | - $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath(); |
|
334 | + $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath(); |
|
335 | 335 | |
336 | 336 | $this->filesystem->makeDirectory($path, 0755, true); |
337 | 337 | if (config('modules.stubs.gitkeep')) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function generateGitKeep($path) |
349 | 349 | { |
350 | - $this->filesystem->put($path . '/.gitkeep', ''); |
|
350 | + $this->filesystem->put($path.'/.gitkeep', ''); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | public function generateFiles() |
357 | 357 | { |
358 | 358 | foreach ($this->getFiles() as $stub => $file) { |
359 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
359 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
360 | 360 | |
361 | 361 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
362 | 362 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | if (GenerateConfigReader::read('provider')->generate() === true) { |
385 | 385 | $this->console->call('module:make-provider', [ |
386 | - 'name' => $this->getName() . 'ServiceProvider', |
|
386 | + 'name' => $this->getName().'ServiceProvider', |
|
387 | 387 | 'module' => $this->getName(), |
388 | 388 | '--master' => true, |
389 | 389 | ]); |
@@ -393,11 +393,11 @@ discard block |
||
393 | 393 | } |
394 | 394 | |
395 | 395 | if (GenerateConfigReader::read('controller')->generate() === true) { |
396 | - $options = $this->type=='api' ? ['--api'=>true] : []; |
|
396 | + $options = $this->type == 'api' ? ['--api'=>true] : []; |
|
397 | 397 | $this->console->call('module:make-controller', [ |
398 | - 'controller' => $this->getName() . 'Controller', |
|
398 | + 'controller' => $this->getName().'Controller', |
|
399 | 399 | 'module' => $this->getName(), |
400 | - ]+$options); |
|
400 | + ] + $options); |
|
401 | 401 | } |
402 | 402 | } |
403 | 403 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | protected function getStubContents($stub) |
412 | 412 | { |
413 | 413 | return (new Stub( |
414 | - '/' . $stub . '.stub', |
|
414 | + '/'.$stub.'.stub', |
|
415 | 415 | $this->getReplacement($stub) |
416 | 416 | ) |
417 | 417 | )->render(); |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | } |
452 | 452 | foreach ($keys as $key) { |
453 | - if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) { |
|
453 | + if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) { |
|
454 | 454 | $replaces[$key] = $this->$method(); |
455 | 455 | } else { |
456 | 456 | $replaces[$key] = null; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | */ |
466 | 466 | private function generateModuleJsonFile() |
467 | 467 | { |
468 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
468 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
469 | 469 | |
470 | 470 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
471 | 471 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -482,13 +482,13 @@ discard block |
||
482 | 482 | */ |
483 | 483 | private function cleanModuleJsonFile() |
484 | 484 | { |
485 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
485 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
486 | 486 | |
487 | 487 | $content = $this->filesystem->get($path); |
488 | 488 | $namespace = $this->getModuleNamespaceReplacement(); |
489 | 489 | $studlyName = $this->getStudlyNameReplacement(); |
490 | 490 | |
491 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
491 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
492 | 492 | |
493 | 493 | $content = str_replace($provider, '', $content); |
494 | 494 |
@@ -59,9 +59,9 @@ |
||
59 | 59 | |
60 | 60 | $rootNamespace = config('modules.namespace'); |
61 | 61 | |
62 | - $modelPath = glob($rootNamespace . DIRECTORY_SEPARATOR . |
|
63 | - '*' . DIRECTORY_SEPARATOR . |
|
64 | - config('modules.paths.generator.model.path') . DIRECTORY_SEPARATOR . |
|
62 | + $modelPath = glob($rootNamespace.DIRECTORY_SEPARATOR. |
|
63 | + '*'.DIRECTORY_SEPARATOR. |
|
64 | + config('modules.paths.generator.model.path').DIRECTORY_SEPARATOR. |
|
65 | 65 | "$model.php"); |
66 | 66 | |
67 | 67 | if (!count($modelPath)) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | return $this->readJson(); |
184 | 184 | } |
185 | 185 | |
186 | - return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->cacheKey, $this->cacheLifetime, function () { |
|
186 | + return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->cacheKey, $this->cacheLifetime, function() { |
|
187 | 187 | return $this->readJson(); |
188 | 188 | }); |
189 | 189 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | private function config(string $key, $default = null) |
199 | 199 | { |
200 | - return $this->config->get('modules.activators.file.' . $key, $default); |
|
200 | + return $this->config->get('modules.activators.file.'.$key, $default); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -123,14 +123,14 @@ |
||
123 | 123 | |
124 | 124 | // any JSON parsing errors should throw an exception |
125 | 125 | if (json_last_error() > 0) { |
126 | - throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg()); |
|
126 | + throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg()); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | if (config('modules.cache.enabled') === false) { |
130 | 130 | return $attributes; |
131 | 131 | } |
132 | 132 | |
133 | - return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function () use ($attributes) { |
|
133 | + return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function() use ($attributes) { |
|
134 | 134 | return $attributes; |
135 | 135 | }); |
136 | 136 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $paths = array_merge($paths, $this->config('scan.paths')); |
117 | 117 | } |
118 | 118 | |
119 | - $paths = array_map(function ($path) { |
|
119 | + $paths = array_map(function($path) { |
|
120 | 120 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
121 | 121 | }, $paths); |
122 | 122 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function getCached() |
202 | 202 | { |
203 | - return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
203 | + return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
204 | 204 | return $this->toCollection()->toArray(); |
205 | 205 | }); |
206 | 206 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | { |
290 | 290 | $modules = $this->allEnabled(); |
291 | 291 | |
292 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
292 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
293 | 293 | if ($a->get('priority') === $b->get('priority')) { |
294 | 294 | return 0; |
295 | 295 | } |
@@ -418,9 +418,9 @@ discard block |
||
418 | 418 | public function getModulePath($module) |
419 | 419 | { |
420 | 420 | try { |
421 | - return $this->findOrFail($module)->getPath() . '/'; |
|
421 | + return $this->findOrFail($module)->getPath().'/'; |
|
422 | 422 | } catch (ModuleNotFoundException $e) { |
423 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
423 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
424 | 424 | } |
425 | 425 | } |
426 | 426 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | */ |
430 | 430 | public function assetPath(string $module): string |
431 | 431 | { |
432 | - return $this->config('paths.assets') . '/' . $module; |
|
432 | + return $this->config('paths.assets').'/'.$module; |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | public function config(string $key, $default = null) |
439 | 439 | { |
440 | - return $this->config->get('modules.' . $key, $default); |
|
440 | + return $this->config->get('modules.'.$key, $default); |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | /** |
@@ -527,9 +527,9 @@ discard block |
||
527 | 527 | } |
528 | 528 | list($name, $url) = explode(':', $asset); |
529 | 529 | |
530 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
530 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
531 | 531 | |
532 | - $url = $this->url->asset($baseUrl . "/{$name}/" . $url); |
|
532 | + $url = $this->url->asset($baseUrl."/{$name}/".$url); |
|
533 | 533 | |
534 | 534 | return str_replace(['http://', 'https://'], '//', $url); |
535 | 535 | } |