Test Failed
Push — ft/urls ( fa7ece...21da8c )
by Ben
30:35
created
src/Urls/ChiefResponse.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
                 // If model is not found, it probably means it is archived or removed
41 41
                 // So we detect the model based on the redirect target url.
42
-                if(!$model){
42
+                if (!$model) {
43 43
                     $targetUrlRecord = $urlRecord->redirectTo();
44 44
                     $targetModel = Morphables::instance($targetUrlRecord->model_type)->find($targetUrlRecord->model_id);
45 45
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 
52 52
 
53 53
 
54
-            if (method_exists($model, 'isPublished') && ! $model->isPublished()) {
54
+            if (method_exists($model, 'isPublished') && !$model->isPublished()) {
55 55
 
56 56
                 /** When admin is logged in and this request is in preview mode, we allow the view */
57
-                if (! PreviewMode::fromRequest()->check()) {
58
-                    throw new NotFoundHttpException('Model found for request ['. $slug .'] but it is not published.');
57
+                if (!PreviewMode::fromRequest()->check()) {
58
+                    throw new NotFoundHttpException('Model found for request ['.$slug.'] but it is not published.');
59 59
                 }
60 60
             }
61 61
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             }
67 67
         }
68 68
 
69
-        throw new NotFoundHttpException('No url or model found for request ['. $slug .'] for locale ['.$locale.'].');
69
+        throw new NotFoundHttpException('No url or model found for request ['.$slug.'] for locale ['.$locale.'].');
70 70
     }
71 71
 
72 72
     private static function createRedirect(string $url)
Please login to merge, or discard this patch.
src/Pages/PageManager.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $permission = 'update-page';
61 61
 
62
-        if (in_array($verb, ['index','show'])) {
62
+        if (in_array($verb, ['index', 'show'])) {
63 63
             $permission = 'view-page';
64
-        } elseif (in_array($verb, ['create','store'])) {
64
+        } elseif (in_array($verb, ['create', 'store'])) {
65 65
             $permission = 'create-page';
66 66
         } elseif (in_array($verb, ['delete'])) {
67 67
             $permission = 'delete-page';
68 68
         }
69 69
 
70
-        if (! auth()->guard('chief')->user()->hasPermissionTo($permission)) {
70
+        if (!auth()->guard('chief')->user()->hasPermissionTo($permission)) {
71 71
             throw NotAllowedManagerRoute::notAllowedPermission($permission, $this);
72 72
         }
73 73
     }
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     public function fieldArrangement($key = null): FieldArrangement
128 128
     {
129 129
         if ($key == 'create') {
130
-            return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function ($field) {
131
-                return in_array($field->key,['title']);
130
+            return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function($field) {
131
+                return in_array($field->key, ['title']);
132 132
             }));
133 133
         }
134 134
 
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
         if ($this->model->id) {
147 147
             return parent::details()
148 148
                 ->set('title', $this->model->title)
149
-                ->set('intro', 'laatst aangepast op ' . $this->model->updated_at->format('d/m/Y H:i'))
150
-                ->set('context', '<span class="inline-s">' . $this->assistant('publish')->publicationStatusAsLabel() . '</span>');
149
+                ->set('intro', 'laatst aangepast op '.$this->model->updated_at->format('d/m/Y H:i'))
150
+                ->set('context', '<span class="inline-s">'.$this->assistant('publish')->publicationStatusAsLabel().'</span>');
151 151
         }
152 152
 
153 153
         return parent::details();
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function saveFields(): Manager
157 157
     {
158 158
         // Store the morph_key upon creation
159
-        if (! $this->model->morph_key) {
159
+        if (!$this->model->morph_key) {
160 160
             $this->model->morph_key = $this->model->morphKey();
161 161
         }
162 162
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             $trans[$locale] = $this->addDefaultShortDescription($translation);
186 186
 
187 187
             // Automatically add an url for this locale based on the given title
188
-            if(!isset($urls[$locale]) && isset($translation['title'])) {
188
+            if (!isset($urls[$locale]) && isset($translation['title'])) {
189 189
                 $urls[$locale] = Str::slug($translation['title']);
190 190
             }
191 191
         }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             if (is_array_empty($translation)) {
202 202
 
203 203
                 // Nullify all values
204
-                $trans[$locale] = array_map(function ($value) {
204
+                $trans[$locale] = array_map(function($value) {
205 205
                     return null;
206 206
                 }, $translation);
207 207
                 continue;
Please login to merge, or discard this patch.