Completed
Pull Request — master (#414)
by Philippe
32:33 queued 15:43
created
src/Concerns/Sluggable/UniqueSlug.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $this->model = $model;
21 21
         $this->blacklist = $blacklist;
22 22
 
23
-        $this->slugResolver = function ($slug) {
23
+        $this->slugResolver = function($slug) {
24 24
             return Str::slug($slug);
25 25
         };
26 26
     }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $i = 1;
44 44
 
45 45
         while (!$this->isSlugUnique($slug, $entity)) {
46
-            $slug = $originalslug . '-' . $i;
46
+            $slug = $originalslug.'-'.$i;
47 47
             $i++;
48 48
         }
49 49
 
Please login to merge, or discard this patch.
src/Concerns/Translatable/TranslatableController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@
 block discarded – undo
23 23
             }
24 24
 
25 25
             foreach ($rules as $key => $rule) {
26
-                $translationrules['trans.' . $locale . '.' . $key] = $rule;
26
+                $translationrules['trans.'.$locale.'.'.$key] = $rule;
27 27
             }
28 28
 
29 29
             foreach ($attributes as $key => $attribute) {
30
-                $translationattributes['trans.' . $locale . '.' . $key] = $attribute;
30
+                $translationattributes['trans.'.$locale.'.'.$key] = $attribute;
31 31
             }
32 32
 
33 33
             foreach ($messages as $key => $message) {
34
-                $translationmessages['trans.' . $locale . '.' . $key] = $message;
34
+                $translationmessages['trans.'.$locale.'.'.$key] = $message;
35 35
             }
36 36
         }
37 37
 
Please login to merge, or discard this patch.
src/Menu/ChiefMenu.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $collection = NodeCollection::fromArray($items);
27 27
 
28
-        $collection->mapRecursive(function ($node) {
28
+        $collection->mapRecursive(function($node) {
29 29
             return $node->replaceEntry((new MenuItem())->entry($node));
30 30
         });
31 31
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function items(): NodeCollection
43 43
     {
44 44
         if (!$this->includeHidden) {
45
-            $this->collection = $this->collection->shake(function ($node) {
45
+            $this->collection = $this->collection->shake(function($node) {
46 46
                 return !$node->hidden_in_menu && !$node->draft;
47 47
             });
48 48
         }
@@ -55,22 +55,22 @@  discard block
 block discarded – undo
55 55
         $this->collection = $this->items();
56 56
 
57 57
         if ($id) {
58
-            $this->collection = $this->collection->prune(function ($node) use ($id) {
58
+            $this->collection = $this->collection->prune(function($node) use ($id) {
59 59
                 return !in_array($id, $node->pluckAncestors('id'));
60 60
             });
61 61
         }
62 62
 
63
-        $menu = $this->collection->mapRecursive(function ($node) {
63
+        $menu = $this->collection->mapRecursive(function($node) {
64 64
             $entry = $node->entry();
65 65
             $label = $entry->label;
66
-            $entry->label = $node->depth() != 0 ? (str_repeat('-', $node->depth())) . '>' : '';
66
+            $entry->label = $node->depth() != 0 ? (str_repeat('-', $node->depth())).'>' : '';
67 67
             $entry->label .= $label;
68 68
 
69 69
             return $node->replaceEntry($entry);
70 70
         });
71 71
 
72 72
         $menuitems = collect();
73
-        $menu->flatten()->each(function ($node) use ($menuitems) {
73
+        $menu->flatten()->each(function($node) use ($menuitems) {
74 74
             $menuitems[] = [
75 75
                 'label' => $node->label,
76 76
                 'id'    => $node->id,
Please login to merge, or discard this patch.
src/Menu/Application/UpdateMenu.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
         if (in_array($menu->order, $sequence)) {
55 55
             foreach ($sequence as $id => $order) {
56 56
                 if ($order < $menu->order) {
57
-                } else {
57
+                }else {
58 58
                     $sequence[$id]++;
59 59
                 }
60 60
             }
61 61
         }
62 62
 
63
-        $sequence = $sequence + [$menu->id => $menu->order];
63
+        $sequence = $sequence+[$menu->id => $menu->order];
64 64
 
65 65
         asort($sequence);
66 66
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     private function reorder(array $sequence)
71 71
     {
72
-        array_walk($sequence, function ($order, $id) {
72
+        array_walk($sequence, function($order, $id) {
73 73
             MenuItem::withoutGlobalScope(SoftDeletingScope::class)
74 74
                 ->where('id', $id)
75 75
                 ->update(['order' => $order]);
Please login to merge, or discard this patch.
src/Menu/Menu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $types = config('thinktomorrow.chief.menus', []);
28 28
 
29
-        return collect($types)->map(function ($menu, $key) {
29
+        return collect($types)->map(function($menu, $key) {
30 30
             return new static($key, $menu['label'], $menu['view']);
31 31
         });
32 32
     }
33 33
 
34 34
     public static function find($key): ?self
35 35
     {
36
-        return static::all()->filter(function ($menu) use ($key) {
36
+        return static::all()->filter(function($menu) use ($key) {
37 37
             return $menu->key() == $key;
38 38
         })->first();
39 39
     }
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
     {
83 83
         $menu = [];
84 84
 
85
-        $this->items()->each(function ($item) use (&$menu) {
85
+        $this->items()->each(function($item) use (&$menu) {
86 86
             $menu[] = sprintf('<li><a href="%s">%s</a></li>', $item->url, $item->label);
87 87
         });
88 88
 
89
-        return '<ul>' . implode('', $menu) . '</ul>';
89
+        return '<ul>'.implode('', $menu).'</ul>';
90 90
     }
91 91
 }
Please login to merge, or discard this patch.
src/Users/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     public function getFullnameAttribute()
59 59
     {
60
-        return $this->firstname . ' ' . $this->lastname;
60
+        return $this->firstname.' '.$this->lastname;
61 61
     }
62 62
 
63 63
     public function isSquantoDeveloper()
@@ -67,6 +67,6 @@  discard block
 block discarded – undo
67 67
 
68 68
     public function getShortNameAttribute()
69 69
     {
70
-        return $this->firstname . ' ' . substr($this->lastname, 0, 1) . '.';
70
+        return $this->firstname.' '.substr($this->lastname, 0, 1).'.';
71 71
     }
72 72
 }
Please login to merge, or discard this patch.
src/Users/Invites/InvitationPresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,6 +36,6 @@
 block discarded – undo
36 36
                 break;
37 37
         }
38 38
 
39
-        return '<span class="label ' . $flair . '">uitnodiging ' . $this->invitation->stateOf(InvitationState::KEY) . '</span>';
39
+        return '<span class="label '.$flair.'">uitnodiging '.$this->invitation->stateOf(InvitationState::KEY).'</span>';
40 40
     }
41 41
 }
Please login to merge, or discard this patch.
src/Media/UploadMedia.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         if (is_string($file) && isset(json_decode($file)->output)) {
113 113
             $image_name = json_decode($file)->output->name;
114 114
             $asset = app(AddAsset::class)->add($model, json_decode($file)->output->image, $type, $locale, $this->sluggifyFilename($image_name));
115
-        } else {
115
+        }else {
116 116
             if ($file instanceof UploadedFile) {
117 117
                 $image_name = $file->getClientOriginalName();
118 118
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 if (false !== ($key = array_search($image_name, $files_order))) {
124 124
                     $files_order[$key] = (string)$asset->id;
125 125
                 }
126
-            } else {
126
+            }else {
127 127
                 $file = Asset::find($file);
128 128
                 if ($file) {
129 129
                     if ($model->assetRelation()->where('asset_pivots.type', $type)->where('asset_pivots.locale', $locale)->get()->contains($file)) {
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
      */
143 143
     private function sluggifyFilename($filename): string
144 144
     {
145
-        $extension = substr($filename, strrpos($filename, '.') + 1);
145
+        $extension = substr($filename, strrpos($filename, '.')+1);
146 146
         $filename = substr($filename, 0, strrpos($filename, '.'));
147
-        $filename = Str::slug($filename) . '.' . $extension;
147
+        $filename = Str::slug($filename).'.'.$extension;
148 148
 
149 149
         return $filename;
150 150
     }
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
                 if ($file instanceof UploadedFile && !$file->isValid()) {
161 161
                     if ($file->getError() == UPLOAD_ERR_INI_SIZE) {
162 162
                         throw new FileTooBigException(
163
-                            'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. ' .
164
-                            'upload_max_filesize: ' . (int)ini_get('upload_max_filesize') . 'MB, ' .
165
-                            'post_max_size: ' . (int)(ini_get('post_max_size')) . 'MB'
163
+                            'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. '.
164
+                            'upload_max_filesize: '.(int)ini_get('upload_max_filesize').'MB, '.
165
+                            'post_max_size: '.(int)(ini_get('post_max_size')).'MB'
166 166
                         );
167 167
                     }
168 168
                 }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             foreach ($files as $locale => $_files) {
178 178
                 foreach ($_files as $action => $file) {
179 179
                     if (!in_array($action, $actions)) {
180
-                        throw new \InvalidArgumentException('A valid files entry should have a key of either [' . implode(',', $actions) . ']. Instead ' . $action . ' is given.');
180
+                        throw new \InvalidArgumentException('A valid files entry should have a key of either ['.implode(',', $actions).']. Instead '.$action.' is given.');
181 181
                     }
182 182
                 }
183 183
             }
Please login to merge, or discard this patch.
src/Common/helpers.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $manifestPath = '/chief-assets/back';
21 21
 
22 22
         // Manifest expects each entry to start with a leading slash - we make sure to deduplicate the manifest path.
23
-        $entry = str_replace($manifestPath, '', '/' . ltrim($filepath, '/'));
23
+        $entry = str_replace($manifestPath, '', '/'.ltrim($filepath, '/'));
24 24
 
25 25
         try {
26 26
             // Paths should be given relative to the manifestpath so make sure to remove the basepath
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         } catch (\Exception $e) {
29 29
             \Illuminate\Support\Facades\Log::error($e);
30 30
 
31
-            return $manifestPath . $entry;
31
+            return $manifestPath.$entry;
32 32
         }
33 33
     }
34 34
 }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         }
115 115
         $teaser = substr($text, 0, $max);
116 116
 
117
-        return strlen($text) <= $max ? $teaser : $teaser . $ending;
117
+        return strlen($text) <= $max ? $teaser : $teaser.$ending;
118 118
     }
119 119
 }
120 120
 
@@ -245,16 +245,16 @@  discard block
 block discarded – undo
245 245
             'fragment',
246 246
         ], null), $parsed_url, $overrides);
247 247
 
248
-        $scheme = $parsed_url['scheme'] ? $parsed_url['scheme'] . '://' : null;
249
-        $port = $parsed_url['port'] ? ':' . $parsed_url['port'] : null;
250
-        $fragment = $parsed_url['fragment'] ? '#' . $parsed_url['fragment'] : null;
248
+        $scheme = $parsed_url['scheme'] ? $parsed_url['scheme'].'://' : null;
249
+        $port = $parsed_url['port'] ? ':'.$parsed_url['port'] : null;
250
+        $fragment = $parsed_url['fragment'] ? '#'.$parsed_url['fragment'] : null;
251 251
 
252
-        $baseurl = $scheme . $parsed_url['host'] . $port . $parsed_url['path'];
252
+        $baseurl = $scheme.$parsed_url['host'].$port.$parsed_url['path'];
253 253
         $current_query = [];
254 254
 
255 255
         $_query = explode('&', $parsed_url['query']);
256 256
 
257
-        array_map(function ($v) use (&$current_query) {
257
+        array_map(function($v) use (&$current_query) {
258 258
             if (!$v) {
259 259
                 return;
260 260
             }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         $query = urldecode(http_build_query(array_merge($current_query, $query_params)));
274 274
 
275
-        return $baseurl . '?' . $query . $fragment;
275
+        return $baseurl.'?'.$query.$fragment;
276 276
     }
277 277
 }
278 278
 
Please login to merge, or discard this patch.