Test Failed
Push — ft/setup-command ( 180250...bc1d4c )
by Ben
58:49 queued 36:20
created
src/Urls/ChiefResponse.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
                 return static::createRedirect($model->url($locale));
40 40
             }
41 41
 
42
-            if (method_exists($model, 'isPublished') && ! $model->isPublished()) {
42
+            if (method_exists($model, 'isPublished') && !$model->isPublished()) {
43 43
 
44 44
                 /** When admin is logged in and this request is in preview mode, we allow the view */
45
-                if (! PreviewMode::fromRequest()->check()) {
46
-                    throw new NotFoundHttpException('Model found for request ['. $slug .'] but it is not published.');
45
+                if (!PreviewMode::fromRequest()->check()) {
46
+                    throw new NotFoundHttpException('Model found for request ['.$slug.'] but it is not published.');
47 47
                 }
48 48
             }
49 49
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             }
55 55
         }
56 56
 
57
-        throw new NotFoundHttpException('No url or model found for request ['. $slug .'] for locale ['.$locale.'].');
57
+        throw new NotFoundHttpException('No url or model found for request ['.$slug.'] for locale ['.$locale.'].');
58 58
     }
59 59
 
60 60
     private static function createRedirect(string $url)
Please login to merge, or discard this patch.
src/Nav/Nav.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     public static function fromKeys($keys)
21 21
     {
22
-        $keys = (array) $keys;
22
+        $keys = (array)$keys;
23 23
         $collection = collect();
24 24
 
25 25
         /** @var Managers */
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     public static function fromTags($tags)
35 35
     {
36
-        $tags = (array) $tags;
36
+        $tags = (array)$tags;
37 37
         $collection = collect();
38 38
 
39 39
         /** @var Managers */
@@ -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()
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
     public function rejectKeys($keys)
66 66
     {
67
-        $keys = (array) $keys;
67
+        $keys = (array)$keys;
68 68
 
69 69
         foreach ($this->items as $k => $item) {
70 70
             if (in_array($item->details('key', ''), $keys)) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function rejectTags($tags)
79 79
     {
80
-        $tags = (array) $tags;
80
+        $tags = (array)$tags;
81 81
 
82 82
         foreach ($this->items as $k => $item) {
83 83
             if (count(array_intersect($item->details('tags', []), $tags)) > 0) {
@@ -119,7 +119,7 @@  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
         }
@@ -146,14 +146,14 @@  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 .= $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>';
Please login to merge, or discard this patch.
src/Filters/Filters.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function anyApplied(): bool
37 37
     {
38 38
         foreach ($this->all() as $filter) {
39
-            if(request()->filled($filter->name)) {
39
+            if (request()->filled($filter->name)) {
40 40
                 return true;
41 41
             }
42 42
         }
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $requestInput = request()->all();
50 50
 
51
-        return array_reduce($this->all(), function ($carry, Filter $filter) use ($requestInput) {
52
-            return $carry . $filter->render($requestInput);
51
+        return array_reduce($this->all(), function($carry, Filter $filter) use ($requestInput) {
52
+            return $carry.$filter->render($requestInput);
53 53
         }, '');
54 54
     }
55 55
 
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 
66 66
     public function keys(): array
67 67
     {
68
-        return array_map(function (Filter $filter) {
68
+        return array_map(function(Filter $filter) {
69 69
             return $filter->key();
70 70
         }, $this->filters);
71 71
     }
72 72
 
73 73
     private function validateFilters(array $filters)
74 74
     {
75
-        array_map(function (Filter $filter) {
75
+        array_map(function(Filter $filter) {
76 76
         }, $filters);
77 77
     }
78 78
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 
98 98
     public function offsetSet($offset, $value)
99 99
     {
100
-        if (! $value instanceof Filter) {
101
-            throw new \InvalidArgumentException('Passed value must be of type ' . Filter::class);
100
+        if (!$value instanceof Filter) {
101
+            throw new \InvalidArgumentException('Passed value must be of type '.Filter::class);
102 102
         }
103 103
 
104 104
         $this->filters[$offset] = $value;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     private function sanitizeFilters(array $filters)
118 118
     {
119
-        return array_map(function ($filter) {
119
+        return array_map(function($filter) {
120 120
             if (is_string($filter) && class_exists($filter)) {
121 121
                 return $filter::init();
122 122
             }
Please login to merge, or discard this patch.
src/Concerns/Viewable/ViewPath.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  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
 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
         }
54 54
 
55 55
         foreach ($viewPaths as $viewPath) {
56
-            if (! view()->exists($viewPath)) {
56
+            if (!view()->exists($viewPath)) {
57 57
                 continue;
58 58
             }
59 59
 
60 60
             return $viewPath;
61 61
         }
62 62
 
63
-        if (! view()->exists($basePath.'show')){
63
+        if (!view()->exists($basePath.'show')) {
64 64
             throw new NotFoundView('Viewfile not found for ['.get_class($this->viewable).']. Make sure the default view ['.$basePath.'show] exists.');
65 65
         }
66 66
     }
Please login to merge, or discard this patch.
src/Urls/UrlSlugField.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
         // If this is a '/' slug, it indicates the homepage for this locale. In this case,
41 41
         // we wont be trimming the slash
42
-        if($slug === '/') return $slug;
42
+        if ($slug === '/') return $slug;
43 43
 
44 44
         if ($this->startsWithBaseUrlSegment($slug)) {
45 45
             $slug = trim(substr($slug, strlen($this->baseUrlSegment)), '/');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@
 block discarded – undo
39 39
 
40 40
         // If this is a '/' slug, it indicates the homepage for this locale. In this case,
41 41
         // we wont be trimming the slash
42
-        if($slug === '/') return $slug;
42
+        if($slug === '/') {
43
+            return $slug;
44
+        }
43 45
 
44 46
         if ($this->startsWithBaseUrlSegment($slug)) {
45 47
             $slug = trim(substr($slug, strlen($this->baseUrlSegment)), '/');
Please login to merge, or discard this patch.
src/Management/Registration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,12 +83,12 @@
 block discarded – undo
83 83
         }
84 84
 
85 85
         $manager = new \ReflectionClass($managerClass);
86
-        if (! $manager->implementsInterface(Manager::class)) {
86
+        if (!$manager->implementsInterface(Manager::class)) {
87 87
             throw new \InvalidArgumentException('Class ['.$managerClass.'] is expected to implement the ['.Manager::class.'] contract.');
88 88
         }
89 89
 
90 90
         $model = new \ReflectionClass($modelClass);
91
-        if (! $model->implementsInterface(ManagedModel::class)) {
91
+        if (!$model->implementsInterface(ManagedModel::class)) {
92 92
             throw new \InvalidArgumentException('Class ['.$modelClass.'] is expected to implement the ['.ManagedModel::class.'] contract.');
93 93
         }
94 94
     }
Please login to merge, or discard this patch.
src/Urls/UrlSlugFields.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  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
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             $fields[$key] = UrlSlugField::make($key)
30 30
                 ->setUrlRecord($record)
31 31
                 ->setBaseUrlSegment($model->baseUrlSegment($record->locale))
32
-                ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)) . '/');
32
+                ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)).'/');
33 33
         }
34 34
 
35 35
         return $fields;
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
         $fields = new static([]);
62 62
 
63 63
         foreach ($locales as $locale) {
64
-            $fields['url-slugs.' . $locale] = UrlSlugField::make('url-slugs.' . $locale)
64
+            $fields['url-slugs.'.$locale] = UrlSlugField::make('url-slugs.'.$locale)
65 65
                                                 ->setBaseUrlSegment($model->baseUrlSegment($locale))
66
-                                                ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)) .'/')
67
-                                                ->name('url-slugs[' . $locale . ']')
66
+                                                ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)).'/')
67
+                                                ->name('url-slugs['.$locale.']')
68 68
                                                 ->label($locale);
69 69
         }
70 70
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     private static function fillWithExistingValues(ProvidesUrl $model, self $fields): void
79 79
     {
80
-        $records = MemoizedUrlRecord::getByModel($model)->reject(function ($record) {
80
+        $records = MemoizedUrlRecord::getByModel($model)->reject(function($record) {
81 81
             return $record->isRedirect();
82 82
         })->sortBy('locale');
83 83
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $fields['url-slugs.'.$record->locale]
90 90
                 ->setUrlRecord($record)
91 91
                 ->setBaseUrlSegment($model->baseUrlSegment($record->locale))
92
-                ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)) .'/');
92
+                ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)).'/');
93 93
         }
94 94
     }
95 95
 }
Please login to merge, or discard this patch.
src/Fields/Fields.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 
124 124
     public function offsetSet($offset, $value)
125 125
     {
126
-        if (! $value instanceof Field) {
127
-            throw new \InvalidArgumentException('Passed value must be of type ' . Field::class);
126
+        if (!$value instanceof Field) {
127
+            throw new \InvalidArgumentException('Passed value must be of type '.Field::class);
128 128
         }
129 129
 
130 130
         $this->fields[$offset] = $value;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
     private function validateFields(array $fields)
155 155
     {
156
-        array_map(function (Field $field) {
156
+        array_map(function(Field $field) {
157 157
         }, $fields);
158 158
     }
159 159
 
Please login to merge, or discard this patch.
src/Pages/PageManager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $permission = 'update-page';
63 63
 
64
-        if (in_array($verb, ['index','show'])) {
64
+        if (in_array($verb, ['index', 'show'])) {
65 65
             $permission = 'view-page';
66
-        } elseif (in_array($verb, ['create','store'])) {
66
+        } elseif (in_array($verb, ['create', 'store'])) {
67 67
             $permission = 'create-page';
68 68
         } elseif (in_array($verb, ['delete'])) {
69 69
             $permission = 'delete-page';
70 70
         }
71 71
 
72
-        if (! auth()->guard('chief')->user()->hasPermissionTo($permission)) {
72
+        if (!auth()->guard('chief')->user()->hasPermissionTo($permission)) {
73 73
             throw NotAllowedManagerRoute::notAllowedPermission($permission, $this);
74 74
         }
75 75
     }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     public function fieldArrangement($key = null): FieldArrangement
131 131
     {
132 132
         if ($key == 'create') {
133
-            return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function ($field) {
133
+            return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function($field) {
134 134
                 return in_array($field->key, ['title']);
135 135
             }));
136 136
         }
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
         if ($this->model->id) {
153 153
             return parent::details()
154 154
                 ->set('title', $this->model->title)
155
-                ->set('intro', 'Aangepast ' . $this->model->updated_at->format('d/m/Y H:i'))
156
-                ->set('context', '<span class="inline-s">' . $this->assistant('publish')->publicationStatusAsLabel() . '</span>');
155
+                ->set('intro', 'Aangepast '.$this->model->updated_at->format('d/m/Y H:i'))
156
+                ->set('context', '<span class="inline-s">'.$this->assistant('publish')->publicationStatusAsLabel().'</span>');
157 157
         }
158 158
 
159 159
         return parent::details();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     public function saveFields(): Manager
163 163
     {
164 164
         // Store the morph_key upon creation
165
-        if (! $this->model->morph_key) {
165
+        if (!$this->model->morph_key) {
166 166
             $this->model->morph_key = $this->model->morphKey();
167 167
         }
168 168
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             if (is_array_empty($translation)) {
208 208
 
209 209
                 // Nullify all values
210
-                $trans[$locale] = array_map(function ($value) {
210
+                $trans[$locale] = array_map(function($value) {
211 211
                     return null;
212 212
                 }, $translation);
213 213
                 continue;
Please login to merge, or discard this patch.