Passed
Pull Request — 2.x (#1421)
by Quentin
09:12
created
src/Commands/GenerateBlocks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             ->collect()
72 72
             ->where('compiled', true)
73 73
             ->whereIn('source', [Block::SOURCE_APP, Block::SOURCE_CUSTOM])
74
-            ->map(function ($block) {
74
+            ->map(function($block) {
75 75
                 $blockName = str_replace('a17-block-', '', $block->component);
76 76
                 $basename = str_replace('.blade.php', '', $block->fileName);
77 77
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                     $this->filesystem->put($vueBlockPath, $vueBlockContent);
94 94
                     $this->info("Block " . Str::title($blockName) . " generated successfully");
95 95
                 } else {
96
-                    $this->info("Skipping block " .  Str::title($blockName) . ".");
96
+                    $this->info("Skipping block " . Str::title($blockName) . ".");
97 97
                 }
98 98
             });
99 99
 
Please login to merge, or discard this patch.
src/Services/Assets/Twill.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
     private function readManifest()
70 70
     {
71 71
         try {
72
-            return Cache::rememberForever('twill-manifest', function () {
72
+            return Cache::rememberForever('twill-manifest', function() {
73 73
                 return $this->readJson($this->getManifestFilename());
74 74
             });
75 75
         } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/Services/Routing/HasRoutes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         $routesFile
18 18
     ) {
19 19
         if (file_exists($routesFile)) {
20
-            $hostRoutes = function ($router) use (
20
+            $hostRoutes = function($router) use (
21 21
                 $middlewares,
22 22
                 $namespace,
23 23
                 $routesFile
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                         'namespace' => $namespace,
28 28
                         'middleware' => $middlewares,
29 29
                     ],
30
-                    function ($router) use ($routesFile) {
30
+                    function($router) use ($routesFile) {
31 31
                         require $routesFile;
32 32
                     }
33 33
                 );
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $manager = (new Manager());
127 127
 
128 128
         $manager->getCapsuleList()
129
-                ->each(function ($capsule) use ($router, $manager) {
129
+                ->each(function($capsule) use ($router, $manager) {
130 130
                     $this->registerCapsuleRoutes($router, $capsule, $manager);
131 131
                 });
132 132
     }
Please login to merge, or discard this patch.
src/Helpers/i18n_helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      */
17 17
     function getLocales()
18 18
     {
19
-        $locales = collect(config('translatable.locales'))->map(function ($locale, $index) {
20
-            return collect($locale)->map(function ($country) use ($locale, $index) {
19
+        $locales = collect(config('translatable.locales'))->map(function($locale, $index) {
20
+            return collect($locale)->map(function($country) use ($locale, $index) {
21 21
                 return is_numeric($index)
22 22
                     ? $locale
23 23
                     : "$index-$country";
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $manageMultipleLanguages = count(getLocales()) > 1;
44 44
         if ($manageMultipleLanguages && $translate) {
45
-            $allLanguages = Collection::make(getLocales())->map(function ($locale, $index) use ($form_fields) {
45
+            $allLanguages = Collection::make(getLocales())->map(function($locale, $index) use ($form_fields) {
46 46
                 return [
47 47
                     'shortlabel' => strtoupper($locale),
48 48
                     'label' => getLanguageLabelFromLocaleCode($locale),
Please login to merge, or discard this patch.
src/Models/Behaviors/HasRevisions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function scopeMine($query)
24 24
     {
25
-        return $query->whereHas('revisions', function ($query) {
25
+        return $query->whereHas('revisions', function($query) {
26 26
             $query->where('user_id', auth('twill_users')->user()->id);
27 27
         });
28 28
     }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function revisionsArray()
36 36
     {
37
-        return $this->revisions->map(function ($revision) {
37
+        return $this->revisions->map(function($revision) {
38 38
             return [
39 39
                 'id' => $revision->id,
40 40
                 'author' => $revision->user->name ?? 'Unknown',
Please login to merge, or discard this patch.
src/Models/Behaviors/HasSlug.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  discard block
 block discarded – undo
11 11
 
12 12
     protected static function bootHasSlug()
13 13
     {
14
-        static::created(function ($model) {
14
+        static::created(function($model) {
15 15
             $model->setSlugs();
16 16
         });
17 17
 
18
-        static::updated(function ($model) {
18
+        static::updated(function($model) {
19 19
             $model->setSlugs();
20 20
         });
21 21
 
22
-        static::restored(function ($model) {
22
+        static::restored(function($model) {
23 23
             $model->setSlugs($restoring = true);
24 24
         });
25 25
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function scopeForSlug($query, $slug)
74 74
     {
75
-        return $query->whereHas('slugs', function ($query) use ($slug) {
75
+        return $query->whereHas('slugs', function($query) use ($slug) {
76 76
             $query->whereSlug($slug);
77 77
             $query->whereActive(true);
78 78
             $query->whereLocale(app()->getLocale());
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function scopeForInactiveSlug($query, $slug)
88 88
     {
89
-        return $query->whereHas('slugs', function ($query) use ($slug) {
89
+        return $query->whereHas('slugs', function($query) use ($slug) {
90 90
             $query->whereSlug($slug);
91 91
             $query->whereLocale(app()->getLocale());
92 92
         })->with(['slugs']);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function scopeForFallbackLocaleSlug($query, $slug)
101 101
     {
102
-        return $query->whereHas('slugs', function ($query) use ($slug) {
102
+        return $query->whereHas('slugs', function($query) use ($slug) {
103 103
             $query->whereSlug($slug);
104 104
             $query->whereActive(true);
105 105
             $query->whereLocale(config('translatable.fallback_locale'));
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         foreach ($slugParams as $key => $value) {
156 156
             //check variations of the slug
157 157
             if ($key == 'slug') {
158
-                $query->where(function ($query) use ($value) {
158
+                $query->where(function($query) use ($value) {
159 159
                     $query->orWhere('slug', $value);
160 160
                     $query->orWhere('slug', $value . '-' . $this->getSuffixSlug());
161 161
                     for ($i = 2; $i <= $this->nb_variation_slug; $i++) {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      */
236 236
     public function getActiveSlug($locale = null)
237 237
     {
238
-        return $this->slugs->first(function ($slug) use ($locale) {
238
+        return $this->slugs->first(function($slug) use ($locale) {
239 239
             return ($slug->locale === ($locale ?? app()->getLocale())) && $slug->active;
240 240
         }) ?? null;
241 241
     }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     public function getFallbackActiveSlug()
249 249
     {
250
-        return $this->slugs->first(function ($slug) {
250
+        return $this->slugs->first(function($slug) {
251 251
             return $slug->locale === config('translatable.fallback_locale') && $slug->active;
252 252
         }) ?? null;
253 253
     }
Please login to merge, or discard this patch.
src/Repositories/Behaviors/HandleTags.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         if (!empty($ids)) {
58 58
             foreach ($ids as $id) {
59
-                $tagQuery->whereHas('tagged', function ($query) use ($id) {
59
+                $tagQuery->whereHas('tagged', function($query) use ($id) {
60 60
                     $query->where('taggable_id', $id);
61 61
                 });
62 62
             }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function getTagsList()
72 72
     {
73
-        return $this->getTagsQuery()->where('count', '>', 0)->select('name', 'id')->get()->map(function ($tag) {
73
+        return $this->getTagsQuery()->where('count', '>', 0)->select('name', 'id')->get()->map(function($tag) {
74 74
             return [
75 75
                 'label' => $tag->name,
76 76
                 'value' => $tag->id,
Please login to merge, or discard this patch.
src/Repositories/Behaviors/HandleRelatedBrowsers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
      */
67 67
     protected function getRelatedBrowsers()
68 68
     {
69
-        return collect($this->relatedBrowsers)->map(function ($browser, $key) {
69
+        return collect($this->relatedBrowsers)->map(function($browser, $key) {
70 70
             $browserName = is_string($browser) ? $browser : $key;
71 71
             $moduleName = !empty($browser['moduleName']) ? $browser['moduleName'] : $this->inferModuleNameFromBrowserName($browserName);
72 72
 
Please login to merge, or discard this patch.
src/Models/Model.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@
 block discarded – undo
42 42
     public function scopeVisible($query)
43 43
     {
44 44
         if ($this->isFillable('publish_start_date')) {
45
-            $query->where(function ($query) {
45
+            $query->where(function($query) {
46 46
                 $query->whereNull("{$this->getTable()}.publish_start_date")->orWhere("{$this->getTable()}.publish_start_date", '<=', Carbon::now());
47 47
             });
48 48
 
49 49
             if ($this->isFillable('publish_end_date')) {
50
-                $query->where(function ($query) {
50
+                $query->where(function($query) {
51 51
                     $query->whereNull("{$this->getTable()}.publish_end_date")->orWhere("{$this->getTable()}.publish_end_date", '>=', Carbon::now());
52 52
                 });
53 53
             }
Please login to merge, or discard this patch.