Completed
Pull Request — master (#1151)
by
unknown
11:07 queued 01:06
created
src/Laravel/Module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function getCachedServicesPath(): string
17 17
     {
18
-        return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath());
18
+        return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->getCachedServicesPath());
19 19
     }
20 20
 
21 21
     /**
Please login to merge, or discard this patch.
src/Module.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     /**
246 246
      * Get a specific data from composer.json file by given the key.
247 247
      *
248
-     * @param $key
248
+     * @param string $key
249 249
      * @param null $default
250 250
      *
251 251
      * @return mixed
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     /**
321 321
      * Determine whether the given status same with the current module status.
322 322
      *
323
-     * @param bool $status
323
+     * @param integer $status
324 324
      *
325 325
      * @return bool
326 326
      */
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
     /**
353 353
      * Set active state for current module.
354 354
      *
355
-     * @param bool $active
355
+     * @param integer $active
356 356
      *
357
-     * @return void
357
+     * @return boolean
358 358
      */
359 359
     public function setActive(int $active): bool
360 360
     {
Please login to merge, or discard this patch.
src/Contracts/ModuleInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
147 147
      * @param int $active
148 148
      * @return bool
149 149
      */
150
-    public function setActive(int $active): bool ;
150
+    public function setActive(int $active): bool;
151 151
 
152 152
     /**
153 153
      * Disable the current module.
Please login to merge, or discard this patch.
src/Laravel/LaravelEloquentRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function getCached(): array
44 44
     {
45
-        return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () {
45
+        return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() {
46 46
             return $this->toCollection()->toArray();
47 47
         });
48 48
     }
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
 
192 192
     public function config($key, $default = null)
193 193
     {
194
-        return $this->app['config']->get('modules.' . $key, $default);
194
+        return $this->app['config']->get('modules.'.$key, $default);
195 195
     }
196 196
 
197 197
     private function convertToCollection(EloquentCollection $eloquentCollection): Collection
198 198
     {
199 199
         $collection = new Collection();
200
-        $eloquentCollection->map(function ($module) use ($collection) {
200
+        $eloquentCollection->map(function($module) use ($collection) {
201 201
             $collection->push($this->createModule($this->app, $module->name, $module->path));
202 202
         });
203 203
         return $collection;
Please login to merge, or discard this patch.
src/ModulesServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     protected function registerNamespaces()
38 38
     {
39
-        $configPath = __DIR__ . '/../config/config.php';
39
+        $configPath = __DIR__.'/../config/config.php';
40 40
 
41 41
         $this->mergeConfigFrom($configPath, 'modules');
42 42
         $this->publishes([
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     protected function registerMigrations()
72 72
     {
73
-        if (! class_exists('CreateModulesTable')) {
73
+        if (!class_exists('CreateModulesTable')) {
74 74
             $this->publishes([
75 75
                 __DIR__.'/../database/migrations/create_modules_table.php.stub' => database_path('migrations/'.date('Y_m_d_His').'_create_modules_table.php'),
76 76
             ], 'migrations');
Please login to merge, or discard this patch.
src/FileRepository.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
200 200
      */
201 201
     public function getCached(): array
202 202
     {
203
-        return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () {
203
+        return $this->cache->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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.