Completed
Pull Request — master (#313)
by Philippe
33:32 queued 57s
created
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
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     public function fieldArrangement($key = null): FieldArrangement
132 132
     {
133 133
         if ($key == 'create') {
134
-            return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function ($field) {
134
+            return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function($field) {
135 135
                 return in_array($field->key, ['title']);
136 136
             }));
137 137
         }
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
         if ($this->model->id) {
154 154
             return parent::details()
155 155
                 ->set('title', ucfirst($this->model->title))
156
-                ->set('intro', 'Aangepast ' . $this->model->updated_at->format('d/m/Y H:i'))
157
-                ->set('context', '<span class="inline-xs stack-s">' . $this->assistant('publish')->publicationStatusAsLabel() . '</span>');
156
+                ->set('intro', 'Aangepast '.$this->model->updated_at->format('d/m/Y H:i'))
157
+                ->set('context', '<span class="inline-xs stack-s">'.$this->assistant('publish')->publicationStatusAsLabel().'</span>');
158 158
         }
159 159
 
160 160
         return parent::details();
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     public function saveFields(Request $request)
164 164
     {
165 165
         // Store the morph_key upon creation
166
-        if ($this->model instanceof MorphableContract && ! $this->model->morph_key) {
166
+        if ($this->model instanceof MorphableContract && !$this->model->morph_key) {
167 167
             $this->model->morph_key = $this->model->morphKey();
168 168
         }
169 169
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             if (is_array_empty($translation)) {
209 209
 
210 210
                 // Nullify all values
211
-                $trans[$locale] = array_map(function ($value) {
211
+                $trans[$locale] = array_map(function($value) {
212 212
                     return null;
213 213
                 }, $translation);
214 214
                 continue;
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
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             return $this->indexPagination($builder);
84 84
         }
85 85
         
86
-        return $builder->get()->map(function ($model) {
86
+        return $builder->get()->map(function($model) {
87 87
             return (new static($this->registration))->manage($model);
88 88
         });
89 89
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $paginator = $builder->paginate($this->pageCount);
113 113
 
114
-        $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function ($model) {
114
+        $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function($model) {
115 115
             return (new static($this->registration))->manage($model);
116 116
         });
117 117
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
     public function guard($verb): Manager
187 187
     {
188
-        if (! $this->can($verb)) {
188
+        if (!$this->can($verb)) {
189 189
             NotAllowedManagerRoute::notAllowedVerb($verb, $this);
190 190
         }
191 191
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         $fields = $this->fields();
209 209
 
210 210
         foreach ($this->assistants() as $assistant) {
211
-            if (! method_exists($assistant, 'fields')) {
211
+            if (!method_exists($assistant, 'fields')) {
212 212
                 continue;
213 213
             }
214 214
 
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
         $this->{'booted'.$baseMethod} = [];
286 286
         
287 287
         foreach (class_uses_recursive($class) as $trait) {
288
-            $method = class_basename($trait) . ucfirst($baseMethod);
288
+            $method = class_basename($trait).ucfirst($baseMethod);
289 289
             
290
-            if (method_exists($class, $method) && ! in_array($method, $this->{'booted'.$baseMethod})) {
290
+            if (method_exists($class, $method) && !in_array($method, $this->{'booted'.$baseMethod})) {
291 291
                 $this->{'booted'.$baseMethod}[] = lcfirst($method);
292 292
             }
293 293
         }
Please login to merge, or discard this patch.
src/Management/Nomadic.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
             throw NotAllowedManagerRoute::create($this);
13 13
         }
14 14
 
15
-        if (! auth()->guard('chief')->user()->hasRole('developer') && in_array($verb, ['create', 'store', 'delete'])) {
15
+        if (!auth()->guard('chief')->user()->hasRole('developer') && in_array($verb, ['create', 'store', 'delete'])) {
16 16
             throw NotAllowedManagerRoute::notAllowedVerb($verb, $this);
17 17
         }
18 18
     }
Please login to merge, or discard this patch.
src/Management/Managers.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $registrations = collect($this->register->filterByTag($tag)->all());
52 52
 
53
-        return $registrations->map(function ($registration) {
53
+        return $registrations->map(function($registration) {
54 54
             return $this->instance($registration);
55 55
         });
56 56
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $registrations = collect($this->register->filterByTag($tag)->all());
67 67
 
68
-        return $registrations->map(function ($registration) {
68
+        return $registrations->map(function($registration) {
69 69
             return $this->instance($registration)->details();
70 70
         });
71 71
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         //return array with group name and values
77 77
         $grouped = [];
78 78
 
79
-        $managers = $managers->map(function (Manager $item) {
79
+        $managers = $managers->map(function(Manager $item) {
80 80
             return [
81 81
                 'id'    => $item->details()->id,
82 82
                 'group' => $item->details()->plural,
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $registrations = collect($this->register->all());
92 92
 
93
-        return $registrations->map(function ($registration) {
93
+        return $registrations->map(function($registration) {
94 94
             return $this->instance($registration);
95 95
         });
96 96
     }
97 97
 
98 98
     public function hasRegistered($tag)
99 99
     {
100
-        return ! empty($this->register->filterByTag($tag)->all());
100
+        return !empty($this->register->filterByTag($tag)->all());
101 101
     }
102 102
 
103 103
     /**
Please login to merge, or discard this patch.
src/Modules/Module.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             return static::$managedModelKey;
68 68
         }
69 69
 
70
-        throw new \Exception('Missing required static property \'managedModelKey\' on ' . static::class. '.');
70
+        throw new \Exception('Missing required static property \'managedModelKey\' on '.static::class.'.');
71 71
     }
72 72
 
73 73
     /**
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public static function availableForCreate(): Collection
78 78
     {
79
-        $managers = app(Managers::class)->findByTag('module')->filter(function ($manager) {
79
+        $managers = app(Managers::class)->findByTag('module')->filter(function($manager) {
80 80
             return $manager->can('create');
81
-        })->map(function ($manager) {
81
+        })->map(function($manager) {
82 82
             return $manager->details();
83 83
         });
84 84
 
Please login to merge, or discard this patch.