Completed
Pull Request — master (#303)
by Ben
59:09 queued 08:39
created
src/States/State/StateMachine.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $transitions = [];
97 97
 
98
-        foreach($this->transitions as $transitionKey => $transition){
98
+        foreach ($this->transitions as $transitionKey => $transition) {
99 99
             if (false !== array_search($this->statefulContract->stateOf($this->stateKey), $transition['from'])) {
100 100
                 $transitions[] = $transitionKey;
101 101
             }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     private function validateTransitions()
108 108
     {
109 109
         foreach ($this->transitions as $transitionKey => $transition) {
110
-            if (!array_key_exists('from', $transition) || !array_key_exists('to',$transition) || !is_array($transition['from'])) {
110
+            if (!array_key_exists('from', $transition) || !array_key_exists('to', $transition) || !is_array($transition['from'])) {
111 111
                 throw StateException::malformedTransition($transitionKey, $this);
112 112
             }
113 113
 
Please login to merge, or discard this patch.
src/Management/Assistants/PublishAssistant.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         app(PublishManagedModel::class)->handle($this->manager->existingModel());
57 57
 
58
-        return redirect()->to($this->manager->route('edit'))->with('messages.success', $this->manager->details()->title .' is online gezet.');
58
+        return redirect()->to($this->manager->route('edit'))->with('messages.success', $this->manager->details()->title.' is online gezet.');
59 59
     }
60 60
 
61 61
     public function unpublish()
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 
65 65
         app(UnpublishManagedModel::class)->handle($this->manager->existingModel());
66 66
 
67
-        return redirect()->to($this->manager->route('edit'))->with('messages.success', $this->manager->details()->title .' is offline gehaald.');
67
+        return redirect()->to($this->manager->route('edit'))->with('messages.success', $this->manager->details()->title.' is offline gehaald.');
68 68
     }
69 69
 
70 70
     public function findAll(): Collection
71 71
     {
72
-        return $this->manager->existingModel()->published()->get()->map(function ($model) {
72
+        return $this->manager->existingModel()->published()->get()->map(function($model) {
73 73
             return $this->managers->findByModel($model);
74 74
         });
75 75
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
     private function guard($verb): Assistant
93 93
     {
94
-        if (! $this->can($verb)) {
94
+        if (!$this->can($verb)) {
95 95
             NotAllowedManagerRoute::notAllowedVerb($verb, $this->manager);
96 96
         }
97 97
 
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
             $class = 'text-warning';
117 117
         }
118 118
 
119
-        $statusAsLabel = '<span class="font-bold '. $class .'"><em>' . $label . '</em></span>';
119
+        $statusAsLabel = '<span class="font-bold '.$class.'"><em>'.$label.'</em></span>';
120 120
 
121 121
         if (!$plain && $this->hasPreviewUrl()) {
122
-            $statusAsLabel =  '<a href="'.$this->previewUrl().'" target="_blank">'. $statusAsLabel .'</a>';
122
+            $statusAsLabel = '<a href="'.$this->previewUrl().'" target="_blank">'.$statusAsLabel.'</a>';
123 123
         }
124 124
 
125 125
         return $statusAsLabel;
Please login to merge, or discard this patch.
src/Management/Details/HasDetails.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $genericModelInstance = $this->modelInstance();
17 17
 
18 18
         // Generic model details
19
-        $id = Str::slug($this->registration->key(). ($this->hasExistingModel() ? '-'. $this->existingModel()->id : ''));
19
+        $id = Str::slug($this->registration->key().($this->hasExistingModel() ? '-'.$this->existingModel()->id : ''));
20 20
         $key = $this->registration->key();
21 21
         $labelSingular = property_exists($genericModelInstance, 'labelSingular') ? $genericModelInstance->labelSingular : Str::singular($key);
22 22
         $labelPlural = property_exists($genericModelInstance, 'labelPlural') ? $genericModelInstance->labelPlural : Str::plural($key);
Please login to merge, or discard this patch.
src/Management/AbstractManager.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             return $this->indexPagination($builder);
88 88
         }
89 89
 
90
-        return $builder->get()->map(function ($model) {
90
+        return $builder->get()->map(function($model) {
91 91
             return (new static($this->registration))->manage($model);
92 92
         });
93 93
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     {
116 116
         $paginator = $builder->paginate($this->pageCount);
117 117
 
118
-        $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function ($model) {
118
+        $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function($model) {
119 119
             return (new static($this->registration))->manage($model);
120 120
         });
121 121
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
     public function guard($verb): Manager
190 190
     {
191
-        if (! $this->can($verb)) {
191
+        if (!$this->can($verb)) {
192 192
             NotAllowedManagerRoute::notAllowedVerb($verb, $this);
193 193
         }
194 194
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         $fields = $this->fields();
212 212
 
213 213
         foreach ($this->assistantsAsClassNames() as $assistantClass) {
214
-            if (! method_exists($assistantClass, 'fields')) {
214
+            if (!method_exists($assistantClass, 'fields')) {
215 215
                 continue;
216 216
             }
217 217
 
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
             static::$bootedTraitMethods[$baseMethod] = [];
304 304
 
305 305
             foreach (class_uses_recursive($class) as $trait) {
306
-                $method = class_basename($trait) . ucfirst($baseMethod);
306
+                $method = class_basename($trait).ucfirst($baseMethod);
307 307
 
308
-                if (method_exists($class, $method) && ! in_array($method, static::$bootedTraitMethods[$baseMethod])) {
308
+                if (method_exists($class, $method) && !in_array($method, static::$bootedTraitMethods[$baseMethod])) {
309 309
                     static::$bootedTraitMethods[$baseMethod][] = lcfirst($method);
310 310
                 }
311 311
             }
Please login to merge, or discard this patch.
src/HealthMonitor/Checks/HomepageAccessibleCheck.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Thinktomorrow\Chief\HealthMonitor\Checks;
4 4
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
     private function get_http_response_code(string $url)
16 16
     {
17
-        if ($url =='') {
17
+        if ($url == '') {
18 18
             return false;
19 19
         }
20 20
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function message(): string
34 34
     {
35
-        return 'Het lijkt erop dat de homepagina niet meer bereikbaar is. <a href="'. route('chief.back.settings.edit') .'" class="text-secondary-800 underline hover:text-white">Kies een nieuwe</a>.';
35
+        return 'Het lijkt erop dat de homepagina niet meer bereikbaar is. <a href="'.route('chief.back.settings.edit').'" class="text-secondary-800 underline hover:text-white">Kies een nieuwe</a>.';
36 36
     }
37 37
 
38 38
     public function notifiers(): array
Please login to merge, or discard this patch.
src/HealthMonitor/Checks/HealthCheck.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Thinktomorrow\Chief\HealthMonitor\Checks;
4 4
 
Please login to merge, or discard this patch.
src/HealthMonitor/Checks/HomepageSetCheck.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Thinktomorrow\Chief\HealthMonitor\Checks;
4 4
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
     public function message(): string
18 18
     {
19
-        return 'Het lijkt erop dat er geen homepagina ingesteld is. Stel er een in hier: <a href="'. route('chief.back.settings.edit') .'" class="text-secondary-800 underline hover:text-white">Settings</a>';
19
+        return 'Het lijkt erop dat er geen homepagina ingesteld is. Stel er een in hier: <a href="'.route('chief.back.settings.edit').'" class="text-secondary-800 underline hover:text-white">Settings</a>';
20 20
     }
21 21
 
22 22
     public function notifiers(): array
Please login to merge, or discard this patch.
src/HealthMonitor/Notifiers/Notifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Thinktomorrow\Chief\HealthMonitor\Notifiers;
4 4
 
Please login to merge, or discard this patch.
src/HealthMonitor/Monitor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Thinktomorrow\Chief\HealthMonitor;
4 4
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         foreach ($this->checks as $check) {
21 21
             $checkInstance = app($check);
22 22
 
23
-            if (! $checkInstance instanceof HealthCheck) {
23
+            if (!$checkInstance instanceof HealthCheck) {
24 24
                 throw new InvalidClassException('Checks must implement Healthcheck interface.');
25 25
             }
26 26
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
                     app($notifier)->onFailure($checkInstance);
32 32
                 }
33 33
                 return;
34
-            } else {
34
+            }else {
35 35
                 foreach ($notifiers as $notifier) {
36 36
                     app($notifier)->onSuccess($checkInstance);
37 37
                 }
Please login to merge, or discard this patch.