Completed
Pull Request — master (#193)
by Ben
126:51 queued 101:25
created
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/Pages/PageManager.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         parent::__construct($registration);
41 41
 
42
-        $this->uniqueSlug = UniqueSlug::make(new PageTranslation)->slugResolver(function ($value) {
42
+        $this->uniqueSlug = UniqueSlug::make(new PageTranslation)->slugResolver(function($value) {
43 43
             return str_slug_slashed($value);
44 44
         });
45 45
     }
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $permission = 'update-page';
65 65
 
66
-        if (in_array($verb, ['index','show'])) {
66
+        if (in_array($verb, ['index', 'show'])) {
67 67
             $permission = 'view-page';
68
-        } elseif (in_array($verb, ['create','store'])) {
68
+        } elseif (in_array($verb, ['create', 'store'])) {
69 69
             $permission = 'create-page';
70 70
         } elseif (in_array($verb, ['delete'])) {
71 71
             $permission = 'delete-page';
72 72
         }
73 73
 
74
-        if (! auth()->guard('chief')->user()->hasPermissionTo($permission)) {
74
+        if (!auth()->guard('chief')->user()->hasPermissionTo($permission)) {
75 75
             throw NotAllowedManagerRoute::notAllowedPermission($permission, $this);
76 76
         }
77 77
     }
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
             InputField::make('slug')
99 99
                 ->translatable($this->model->availableLocales())
100 100
                 ->validation($this->model->id
101
-                    ? 'required-fallback-locale|unique:page_translations,slug,' . $this->model->id . ',page_id'
101
+                    ? 'required-fallback-locale|unique:page_translations,slug,'.$this->model->id.',page_id'
102 102
                     : 'required-fallback-locale|unique:page_translations,slug', [], [
103 103
                     'trans.'.config('app.fallback_locale', 'nl').'.slug' => 'slug'
104 104
                 ])
105 105
                 ->label('Link')
106 106
                 ->description('De unieke url verwijzing naar deze pagina.')
107
-                ->prepend(collect($this->model->availableLocales())->mapWithKeys(function ($locale) {
107
+                ->prepend(collect($this->model->availableLocales())->mapWithKeys(function($locale) {
108 108
                     return [$locale => url($this->model->baseUrlSegment($locale)).'/'];
109 109
                 })->all()),
110 110
             InputField::make('seo_title')
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     public function fieldArrangement($key = null): FieldArrangement
141 141
     {
142 142
         if ($key == 'create') {
143
-            return new FieldArrangement($this->fields()->filterBy(function ($field) {
143
+            return new FieldArrangement($this->fields()->filterBy(function($field) {
144 144
                 return $field->key == 'title';
145 145
             }));
146 146
         }
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
         if ($this->model->id) {
160 160
             return parent::details()
161 161
                 ->set('title', $this->model->title)
162
-                ->set('intro', 'laatst aangepast op ' . $this->model->updated_at->format('d/m/Y H:i'))
163
-                ->set('context', '<span>' . $this->assistant('publish')->publicationStatusAsLabel() . '</span>');
162
+                ->set('intro', 'laatst aangepast op '.$this->model->updated_at->format('d/m/Y H:i'))
163
+                ->set('context', '<span>'.$this->assistant('publish')->publicationStatusAsLabel().'</span>');
164 164
         }
165 165
 
166 166
         return parent::details();
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     public function saveFields(): Manager
170 170
     {
171 171
         // Store the morph_key upon creation
172
-        if (! $this->model->morph_key) {
172
+        if (!$this->model->morph_key) {
173 173
             $this->model->morph_key = $this->model->morphKey();
174 174
         }
175 175
 
@@ -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.