Test Setup Failed
Push — a-simpler-manager ( 549484...cc67c7 )
by Ben
07:31
created
src/Modules/Application/DeleteModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
             // Mark the slug as deleted to avoid any conflict with newly created modules with the same slug.
23 23
             $module->update([
24
-                'slug' => $module->slug . $this->appendDeleteMarker(),
24
+                'slug' => $module->slug.$this->appendDeleteMarker(),
25 25
             ]);
26 26
 
27 27
             $module->delete();
@@ -35,6 +35,6 @@  discard block
 block discarded – undo
35 35
 
36 36
     private function appendDeleteMarker(): string
37 37
     {
38
-        return '_DELETED_' . time();
38
+        return '_DELETED_'.time();
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
src/Modules/ModuleManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
             if (is_array_empty($translation)) {
160 160
 
161 161
                 // Nullify all values
162
-                $trans[$locale] = array_map(function ($value) {
162
+                $trans[$locale] = array_map(function($value) {
163 163
                     return null;
164 164
                 }, $translation);
165 165
                 continue;
Please login to merge, or discard this patch.
src/Managers/Assistants/RedactorFileUploadAssistant.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@
 block discarded – undo
43 43
             $filename = $filePayload['filename'];
44 44
 
45 45
             if (!$asset = AssetUploader::uploadFromBase64($base64EncodedFile, $filename)) {
46
-                $responseContent['file-' . rand(1 - 999)] = [
46
+                $responseContent['file-'.rand(1-999)] = [
47 47
                     'error'    => true,
48
-                    'messages' => 'Afbeelding [' . $filename . '] kan niet worden opgeladen.',
48
+                    'messages' => 'Afbeelding ['.$filename.'] kan niet worden opgeladen.',
49 49
                 ];
50 50
                 continue;
51 51
             }
52 52
 
53 53
             app(AddAsset::class)->add($model, $asset, MediaType::CONTENT, $request->input('locale', app()->getLocale()));
54 54
 
55
-            $responseContent['file-' . $asset->id] = [
55
+            $responseContent['file-'.$asset->id] = [
56 56
                 'url' => $asset->url(),
57 57
                 'id'  => $asset->id,
58 58
             ];
Please login to merge, or discard this patch.
src/Managers/Assistants/PreviewAssistant.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 {
10 10
     public function canPreviewAssistant(string $action, $model = null): bool
11 11
     {
12
-        if($action !== 'preview' || !$model) return false;
12
+        if ($action !== 'preview' || !$model) return false;
13 13
 
14 14
         return $model instanceof ProvidesUrl;
15 15
     }
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function routePreviewAssistant(string $action, $model = null, ...$parameters): ?string
29 29
     {
30
-        if(!$this->canPreviewAssistant($action, $model)) return null;
30
+        if (!$this->canPreviewAssistant($action, $model)) return null;
31 31
 
32 32
         return $model->url();
33 33
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,9 @@  discard block
 block discarded – undo
9 9
 {
10 10
     public function canPreviewAssistant(string $action, $model = null): bool
11 11
     {
12
-        if($action !== 'preview' || !$model) return false;
12
+        if($action !== 'preview' || !$model) {
13
+            return false;
14
+        }
13 15
 
14 16
         return $model instanceof ProvidesUrl;
15 17
     }
@@ -27,7 +29,9 @@  discard block
 block discarded – undo
27 29
      */
28 30
     public function routePreviewAssistant(string $action, $model = null, ...$parameters): ?string
29 31
     {
30
-        if(!$this->canPreviewAssistant($action, $model)) return null;
32
+        if(!$this->canPreviewAssistant($action, $model)) {
33
+            return null;
34
+        }
31 35
 
32 36
         return $model->url();
33 37
     }
Please login to merge, or discard this patch.
src/Legacy/Pages/Page.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             return static::$managedModelKey;
99 99
         }
100 100
 
101
-        throw new \Exception('Missing required static property \'managedModelKey\' on ' . static::class . '.');
101
+        throw new \Exception('Missing required static property \'managedModelKey\' on '.static::class.'.');
102 102
     }
103 103
 
104 104
     /**
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
     public function modelReferenceLabel(): string
139 139
     {
140 140
         if ($this->exists) {
141
-            $status = !$this->isPublished() ? ' [' . $this->statusAsPlainLabel() . ']' : null;
141
+            $status = !$this->isPublished() ? ' ['.$this->statusAsPlainLabel().']' : null;
142 142
 
143
-            return $this->title ? $this->title . $status : '';
143
+            return $this->title ? $this->title.$status : '';
144 144
         }
145 145
 
146 146
         return '';
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $classKey = get_class($this);
152 152
         if (property_exists($this, 'labelSingular')) {
153 153
             $labelSingular = $this->labelSingular;
154
-        } else {
154
+        }else {
155 155
             $labelSingular = Str::singular($classKey);
156 156
         }
157 157
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             $locale = app()->getLocale();
171 171
         }
172 172
         try {
173
-            $memoizedKey = $this->getMorphClass() . '-' . $this->id . '-' . $locale;
173
+            $memoizedKey = $this->getMorphClass().'-'.$this->id.'-'.$locale;
174 174
 
175 175
             if (isset(static::$cachedUrls[$memoizedKey])) {
176 176
                 return static::$cachedUrls[$memoizedKey];
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
     public function statusAsLabel()
227 227
     {
228 228
         if ($this->isPublished()) {
229
-            return '<a href="' . $this->url() . '" target="_blank"><em>online</em></a>';
229
+            return '<a href="'.$this->url().'" target="_blank"><em>online</em></a>';
230 230
         }
231 231
 
232 232
         if ($this->isDraft()) {
233
-            return '<a href="' . $this->url() . '" target="_blank" class="text-error"><em>offline</em></a>';
233
+            return '<a href="'.$this->url().'" target="_blank" class="text-error"><em>offline</em></a>';
234 234
         }
235 235
 
236 236
         if ($this->isArchived()) {
Please login to merge, or discard this patch.
src/Modules/Assistants/ModuleCrudAssistant.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,9 @@
 block discarded – undo
31 31
 
32 32
     public function routeModuleCrudAssistant(string $action, $model = null, ...$parameters): ?string
33 33
     {
34
-        if(!in_array($action, ['create','store'])) return null;
34
+        if(!in_array($action, ['create','store'])) {
35
+            return null;
36
+        }
35 37
 
36 38
         return $this->generateRoute($action, $model, ... $parameters);
37 39
     }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function routeModuleCrudAssistant(string $action, $model = null, ...$parameters): ?string
32 32
     {
33
-        if(!in_array($action, ['create','store'])) return null;
33
+        if (!in_array($action, ['create', 'store'])) return null;
34 34
 
35 35
         return $this->generateRoute($action, $model, ... $parameters);
36 36
     }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $model->saveFields($model->fields()->tagged('create'), $request->all(), $request->allFiles());
60 60
 
61 61
         return redirect()->to($this->route('edit', $model))
62
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is toegevoegd');
62
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is toegevoegd');
63 63
     }
64 64
 
65 65
     public function edit($id)
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         return view('chief::back.managers.edit', [
75 75
             'manager'    => $this,
76 76
             'model'      => $model,
77
-            'fields'     => $model->fields()->map(function (Field $field) use ($model) {
77
+            'fields'     => $model->fields()->map(function(Field $field) use ($model) {
78 78
                 // TODO refactor so render method of field takes model and managerViewModel as arguments.
79 79
                 return $field->model($model);
80 80
             }),
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $model->saveFields($model->fields(), $request->all(), $request->allFiles());
94 94
 
95 95
         return redirect()->to($this->route('edit', $model))
96
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is aangepast');
96
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is aangepast');
97 97
     }
98 98
 
99 99
     public function delete($id, Request $request)
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
         $model = $this->managedModelClass()::findOrFail($id);
104 104
 
105 105
         if ($request->get('deleteconfirmation') !== 'DELETE') {
106
-            return redirect()->back()->with('messages.warning', $model->adminLabel('title') . ' is niet verwijderd.');
106
+            return redirect()->back()->with('messages.warning', $model->adminLabel('title').' is niet verwijderd.');
107 107
         }
108 108
 
109 109
         app(DeleteModel::class)->handle($model);
110 110
 
111 111
         return redirect()->to($this->route('index'))
112
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is verwijderd.');
112
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is verwijderd.');
113 113
     }
114 114
 }
Please login to merge, or discard this patch.
src/ManagedModels/States/PageStatePresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     {
28 28
         $class = $this->pageState->isOnline() ? 'text-success' : 'text-warning';
29 29
 
30
-        return '<span class="inline-xs stack-s ' . $class . '">' . $this->stateAsLabel() . '</span>';
30
+        return '<span class="inline-xs stack-s '.$class.'">'.$this->stateAsLabel().'</span>';
31 31
     }
32 32
 
33 33
     /**
Please login to merge, or discard this patch.
src/ManagedModels/States/State/StateException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
 {
7 7
     public static function invalidState($state, $currentState, $stateMachine)
8 8
     {
9
-        return new self('Transition to state [' . $state . '] is not allowed from state [' . $currentState . '] or state does not exist on ' . get_class($stateMachine));
9
+        return new self('Transition to state ['.$state.'] is not allowed from state ['.$currentState.'] or state does not exist on '.get_class($stateMachine));
10 10
     }
11 11
 
12 12
     public static function malformedTransition($transition, $stateMachine)
13 13
     {
14
-        return new self('Transition [' . $transition . '] is malformed on ' . get_class($stateMachine) . '. It should contain both a [from:array] and [to:string] value.');
14
+        return new self('Transition ['.$transition.'] is malformed on '.get_class($stateMachine).'. It should contain both a [from:array] and [to:string] value.');
15 15
     }
16 16
 
17 17
     public static function invalidTransitionKey($transition, $stateMachine)
18 18
     {
19
-        return new self('unknown transition [' . $transition . '] on ' . get_class($stateMachine));
19
+        return new self('unknown transition ['.$transition.'] on '.get_class($stateMachine));
20 20
     }
21 21
 
22 22
     public static function invalidTransition($transition, $state, $stateMachine)
23 23
     {
24
-        return new self('Transition [' . $transition . '] cannot be applied from current state [' . $state . '] on ' . get_class($stateMachine));
24
+        return new self('Transition ['.$transition.'] cannot be applied from current state ['.$state.'] on '.get_class($stateMachine));
25 25
     }
26 26
 
27 27
     public static function invalidTransitionState($transition, $state, $stateMachine)
28 28
     {
29
-        return new self('Transition [' . $transition . '] contains a non existing [' . $state . '] on ' . get_class($stateMachine));
29
+        return new self('Transition ['.$transition.'] contains a non existing ['.$state.'] on '.get_class($stateMachine));
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/ManagedModels/States/Publishable/CheckPreviewTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
             Session::now('note.default', 'U bekijkt een preview.');
13 13
 
14 14
             return true;
15
-        } else {
15
+        }else {
16 16
             return false;
17 17
         }
18 18
     }
Please login to merge, or discard this patch.