Test Setup Failed
Push — ft/duplicate-page ( 3cb9e2 )
by Ben
65:03 queued 56:56
created
src/Nav/Nav.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 
53 53
     private static function fromManagers(Collection $collection)
54 54
     {
55
-        return new static(...$collection->reject(function ($manager) {
55
+        return new static(...$collection->reject(function($manager) {
56 56
             return !$manager->can('index');
57
-        })->map(function ($manager) {
57
+        })->map(function($manager) {
58 58
             return new NavItem($manager->details()->plural, $manager->route('index'), [
59 59
                 'key'  => $manager->details()->key,
60 60
                 'tags' => app(Register::class)->filterByKey($manager->details()->key)->first()->tags(),
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
         $output = '';
120 120
 
121 121
         foreach ($this->items as $item) {
122
-            $output .= '<a class="' . (isActiveUrl($item->url()) ? 'active' : '') . '" href="' . $item->url() . '">';
122
+            $output .= '<a class="'.(isActiveUrl($item->url()) ? 'active' : '').'" href="'.$item->url().'">';
123 123
             $output .= $title ?? ucfirst($item->title());
124 124
             $output .= '</a>';
125 125
         }
126 126
 
127
-        return '<li>' . $output . '</li>';
127
+        return '<li>'.$output.'</li>';
128 128
     }
129 129
 
130 130
     /**
@@ -146,19 +146,19 @@  discard block
 block discarded – undo
146 146
 
147 147
         $items = '';
148 148
         foreach ($this->items as $item) {
149
-            $items .= '<a class="' . (isActiveUrl($item->url()) ? 'active' : '') . '" href="' . $item->url() . '">';
149
+            $items .= '<a class="'.(isActiveUrl($item->url()) ? 'active' : '').'" href="'.$item->url().'">';
150 150
             $items .= ucfirst($item->title());
151 151
             $items .= '</a>';
152 152
         }
153 153
 
154 154
         // Surround within vue dropdown
155 155
         $output = '<dropdown>';
156
-        $output .= '<span class="center-y nav-item" slot="trigger" slot-scope="{ toggle, isActive }" @click="toggle">' . ($title ?? 'Collecties') . '</span>';
156
+        $output .= '<span class="center-y nav-item" slot="trigger" slot-scope="{ toggle, isActive }" @click="toggle">'.($title ?? 'Collecties').'</span>';
157 157
         $output .= '<div v-cloak class="dropdown-box inset-s">';
158 158
         $output .= $items;
159 159
         $output .= '</div>';
160 160
         $output .= '</dropdown>';
161 161
 
162
-        return '<li>' . $output . '</li>';
162
+        return '<li>'.$output.'</li>';
163 163
     }
164 164
 }
Please login to merge, or discard this patch.
src/Urls/MemoizedUrlRecord.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
             ->first();
37 37
 
38 38
         if (!$record) {
39
-            throw new UrlRecordNotFound('No url record found for model [' . $model->getMorphClass() . '@' . $model->id . '] for locale [' . $locale . '].');
39
+            throw new UrlRecordNotFound('No url record found for model ['.$model->getMorphClass().'@'.$model->id.'] for locale ['.$locale.'].');
40 40
         }
41 41
 
42 42
         return $record;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     public static function getByModel(Model $model)
46 46
     {
47
-        return chiefMemoize('url-records-get-by-model', function ($model) {
47
+        return chiefMemoize('url-records-get-by-model', function($model) {
48 48
             return parent::getByModel($model);
49 49
         }, [$model]);
50 50
     }
Please login to merge, or discard this patch.
src/Urls/ChiefResponse.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                     $targetModel = Morphables::instance($targetUrlRecord->model_type)->find($targetUrlRecord->model_id);
38 38
 
39 39
                     if (!$targetModel) {
40
-                        throw new \DomainException('Corrupt target model for this url request. Model by reference [' . $targetUrlRecord->model_type . '@' . $targetUrlRecord->model_id . '] has probably been archived or deleted.');
40
+                        throw new \DomainException('Corrupt target model for this url request. Model by reference ['.$targetUrlRecord->model_type.'@'.$targetUrlRecord->model_id.'] has probably been archived or deleted.');
41 41
                     }
42 42
 
43 43
                     return static::createRedirect($targetModel->url($locale));
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
             }
48 48
 
49 49
             if (!$model) {
50
-                throw new \DomainException('Corrupt target model for this url request. Model by reference [' . $urlRecord->model_type . '@' . $urlRecord->model_id . '] has probably been archived or deleted.');
50
+                throw new \DomainException('Corrupt target model for this url request. Model by reference ['.$urlRecord->model_type.'@'.$urlRecord->model_id.'] has probably been archived or deleted.');
51 51
             }
52 52
 
53 53
             if (method_exists($model, 'isPublished') && !$model->isPublished()) {
54 54
 
55 55
                 /** When admin is logged in and this request is in preview mode, we allow the view */
56 56
                 if (!PreviewMode::fromRequest()->check()) {
57
-                    throw new NotFoundHttpException('Model found for request [' . $slug . '] but it is not published.');
57
+                    throw new NotFoundHttpException('Model found for request ['.$slug.'] but it is not published.');
58 58
                 }
59 59
             }
60 60
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             }
66 66
         }
67 67
 
68
-        throw new NotFoundHttpException('No url or model found for request [' . $slug . '] for locale [' . $locale . '].');
68
+        throw new NotFoundHttpException('No url or model found for request ['.$slug.'] for locale ['.$locale.'].');
69 69
     }
70 70
 
71 71
     private static function createRedirect(string $url)
Please login to merge, or discard this patch.
src/Urls/UrlSlugField.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         return $this->fullUrl
44 44
             ? $this->fullUrl
45
-            : $this->prepend . $this->getValue();
45
+            : $this->prepend.$this->getValue();
46 46
     }
47 47
 
48 48
     public function setFullUrl(string $fullUrl)
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             'baseUrlSegment' => $this->baseUrlSegment,
95 95
             'hint'           => null, // Hint placeholder to show url hint when it already exists
96 96
             'is_homepage'    => ($this->getValue() === '/'),
97
-            'show'           => !!$this->getValue(),// show input field or not
97
+            'show'           => !!$this->getValue(), // show input field or not
98 98
         ];
99 99
     }
100 100
 }
Please login to merge, or discard this patch.
src/Urls/ValidationRules/UniqueUrlSlugRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,6 +60,6 @@
 block discarded – undo
60 60
      */
61 61
     public function message()
62 62
     {
63
-        return 'De \'' . $this->failedDetails['slug'] . '\' link wordt in het ' . $this->failedDetails['locale'] . ' al door een andere pagina gebruikt.';
63
+        return 'De \''.$this->failedDetails['slug'].'\' link wordt in het '.$this->failedDetails['locale'].' al door een andere pagina gebruikt.';
64 64
     }
65 65
 }
Please login to merge, or discard this patch.
src/Urls/UrlSlugFields.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 
19 19
     public static function redirectsFromModel(ProvidesUrl $model)
20 20
     {
21
-        $records = MemoizedUrlRecord::getByModel($model)->reject(function ($record) {
21
+        $records = MemoizedUrlRecord::getByModel($model)->reject(function($record) {
22 22
             return !$record->isRedirect();
23 23
         })->sortByDesc('created_at');
24 24
 
25 25
         $fields = new static([]);
26 26
 
27 27
         foreach ($records as $record) {
28
-            $key = 'redirects-' . $record->locale . '-' . $record->slug;
28
+            $key = 'redirects-'.$record->locale.'-'.$record->slug;
29 29
             $fields[$key] = UrlSlugField::make($key)
30 30
                 ->setUrlRecord($record)
31 31
                 ->setFullUrl($model->resolveUrl($record->locale, $record->slug));
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
         $fields = new static([]);
61 61
 
62 62
         foreach ($locales as $locale) {
63
-            $fields['url-slugs.' . $locale] = UrlSlugField::make('url-slugs.' . $locale)
63
+            $fields['url-slugs.'.$locale] = UrlSlugField::make('url-slugs.'.$locale)
64 64
                 ->setBaseUrlSegment($model->baseUrlSegment($locale))
65
-                ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)) . '/')
66
-                ->name('url-slugs[' . $locale . ']')
65
+                ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)).'/')
66
+                ->name('url-slugs['.$locale.']')
67 67
                 ->label($locale);
68 68
         }
69 69
 
@@ -76,19 +76,19 @@  discard block
 block discarded – undo
76 76
      */
77 77
     private static function fillWithExistingValues(ProvidesUrl $model, self $fields): void
78 78
     {
79
-        $records = UrlRecord::getByModel($model)->reject(function ($record) {
79
+        $records = UrlRecord::getByModel($model)->reject(function($record) {
80 80
             return $record->isRedirect();
81 81
         })->sortBy('locale');
82 82
 
83 83
         foreach ($records as $record) {
84
-            if (!isset($fields['url-slugs.' . $record->locale])) {
84
+            if (!isset($fields['url-slugs.'.$record->locale])) {
85 85
                 continue;
86 86
             }
87 87
 
88
-            $fields['url-slugs.' . $record->locale]
88
+            $fields['url-slugs.'.$record->locale]
89 89
                 ->setUrlRecord($record)
90 90
                 ->setBaseUrlSegment($model->baseUrlSegment($record->locale))
91
-                ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)) . '/');
91
+                ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)).'/');
92 92
         }
93 93
     }
94 94
 }
Please login to merge, or discard this patch.
src/Concerns/Viewable/ViewPath.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,22 +34,22 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function get(): string
36 36
     {
37
-        $basePath = $this->viewBasePath ? $this->viewBasePath . '.' : '';
37
+        $basePath = $this->viewBasePath ? $this->viewBasePath.'.' : '';
38 38
         $guessedParentViewName = $this->parent ? $this->parent->viewKey() : '';
39 39
         $guessedViewName = $this->viewable->viewKey();
40 40
 
41 41
         $viewPaths = [
42
-            $basePath . $guessedParentViewName . '.' . $guessedViewName,
43
-            $basePath . $guessedViewName,
44
-            $basePath . $guessedViewName . '.show',
45
-            $basePath . 'show',
42
+            $basePath.$guessedParentViewName.'.'.$guessedViewName,
43
+            $basePath.$guessedViewName,
44
+            $basePath.$guessedViewName.'.show',
45
+            $basePath.'show',
46 46
         ];
47 47
 
48 48
         // In case the collection set is made out of pages, we'll also allow to use the
49 49
         // generic collection page view for these sets as well as a fallback view
50 50
         if ($this->viewable instanceof Set && $this->viewable->first() instanceof ViewableContract) {
51
-            $viewPaths[] = $basePath . $guessedParentViewName . '.' . $this->viewable->first()->viewKey();
52
-            $viewPaths[] = $basePath . $this->viewable->first()->viewKey();
51
+            $viewPaths[] = $basePath.$guessedParentViewName.'.'.$this->viewable->first()->viewKey();
52
+            $viewPaths[] = $basePath.$this->viewable->first()->viewKey();
53 53
         }
54 54
 
55 55
         foreach ($viewPaths as $viewPath) {
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
             return $viewPath;
61 61
         }
62 62
 
63
-        if (!view()->exists($basePath . 'show')) {
64
-            throw new NotFoundView('Viewfile not found for [' . get_class($this->viewable) . ']. Make sure the view [' . $basePath . $guessedViewName . '] or the default view [' . $basePath . 'show] exists.');
63
+        if (!view()->exists($basePath.'show')) {
64
+            throw new NotFoundView('Viewfile not found for ['.get_class($this->viewable).']. Make sure the view ['.$basePath.$guessedViewName.'] or the default view ['.$basePath.'show] exists.');
65 65
         }
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
src/Concerns/Sluggable/UniqueSlug.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $this->model = $model;
21 21
         $this->blacklist = $blacklist;
22 22
 
23
-        $this->slugResolver = function ($slug) {
23
+        $this->slugResolver = function($slug) {
24 24
             return Str::slug($slug);
25 25
         };
26 26
     }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $i = 1;
44 44
 
45 45
         while (!$this->isSlugUnique($slug, $entity)) {
46
-            $slug = $originalslug . '-' . $i;
46
+            $slug = $originalslug.'-'.$i;
47 47
             $i++;
48 48
         }
49 49
 
Please login to merge, or discard this patch.
src/Concerns/Translatable/TranslatableController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@
 block discarded – undo
23 23
             }
24 24
 
25 25
             foreach ($rules as $key => $rule) {
26
-                $translationrules['trans.' . $locale . '.' . $key] = $rule;
26
+                $translationrules['trans.'.$locale.'.'.$key] = $rule;
27 27
             }
28 28
 
29 29
             foreach ($attributes as $key => $attribute) {
30
-                $translationattributes['trans.' . $locale . '.' . $key] = $attribute;
30
+                $translationattributes['trans.'.$locale.'.'.$key] = $attribute;
31 31
             }
32 32
 
33 33
             foreach ($messages as $key => $message) {
34
-                $translationmessages['trans.' . $locale . '.' . $key] = $message;
34
+                $translationmessages['trans.'.$locale.'.'.$key] = $message;
35 35
             }
36 36
         }
37 37
 
Please login to merge, or discard this patch.