Test Failed
Push — fix/media-validation ( 3351fe )
by Ben
09:34
created
src/Users/User.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,6 +75,6 @@
 block discarded – undo
75 75
 
76 76
     public function getShortNameAttribute()
77 77
     {
78
-        return $this->firstname . ' ' . substr($this->lastname, 0, 1) . '.';
78
+        return $this->firstname.' '.substr($this->lastname, 0, 1).'.';
79 79
     }
80 80
 }
Please login to merge, or discard this patch.
src/Authorization/Permission.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,15 +19,15 @@
 block discarded – undo
19 19
     {
20 20
         $abilities = ['view', 'create', 'update', 'delete'];
21 21
 
22
-        return array_map(function ($val) use ($scope) {
23
-            return $val . '-'. $scope;
22
+        return array_map(function($val) use ($scope) {
23
+            return $val.'-'.$scope;
24 24
         }, $abilities);
25 25
     }
26 26
 
27 27
     public static function getPermissionsForIndex()
28 28
     {
29 29
         $permissions = $temp = [];
30
-        self::all()->each(function ($permission) use (&$permissions, &$temp) {
30
+        self::all()->each(function($permission) use (&$permissions, &$temp) {
31 31
             $model = explode("_", $permission->name, 2)[1];
32 32
             $temp[$model][$permission->id] = explode("_", $permission->name, 2)[0];
33 33
             $permissions = $temp;
Please login to merge, or discard this patch.
src/Authorization/Console/GeneratePermissionCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             Permission::findOrCreate($permission, 'chief');
40 40
         }
41 41
 
42
-        $this->info('Permissions ' . implode(', ', $permissions) . ' created.');
42
+        $this->info('Permissions '.implode(', ', $permissions).' created.');
43 43
     }
44 44
 
45 45
     /**
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         foreach ($roleNames as $roleName) {
57 57
             if ($role = Role::where('name', trim($roleName))->first()) {
58 58
                 $role->syncPermissions($permissions);
59
-                $this->info('Role ' . $roleName . ' assigned the given permissions.');
60
-            } else {
61
-                $this->warn('Role not found by name ' . $roleName . '!');
59
+                $this->info('Role '.$roleName.' assigned the given permissions.');
60
+            }else {
61
+                $this->warn('Role not found by name '.$roleName.'!');
62 62
             }
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
src/Authorization/Console/GenerateRoleCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             // Generate all permissions if only scope is passed
43 43
             if (false === strpos($permissionName, '-')) {
44 44
                 $cleanPermissionNames = array_merge($cleanPermissionNames, Permission::generate($permissionName));
45
-            } else {
45
+            }else {
46 46
                 // Trim the value
47 47
                 $cleanPermissionNames[] = $permissionName;
48 48
             }
@@ -55,6 +55,6 @@  discard block
 block discarded – undo
55 55
             $role->givePermissionTo($cleanPermissionName);
56 56
         }
57 57
 
58
-        $this->info('Role ' . $role->name . ' was assigned the permissions: ' . implode(',', $cleanPermissionNames));
58
+        $this->info('Role '.$role->name.' was assigned the permissions: '.implode(',', $cleanPermissionNames));
59 59
     }
60 60
 }
Please login to merge, or discard this patch.
src/PageBuilder/UpdateSections.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     private function removeExistingSets()
91 91
     {
92 92
         foreach ($this->model->children() as $instance) {
93
-            if (! $instance instanceof StoredSetReference) {
93
+            if (!$instance instanceof StoredSetReference) {
94 94
                 continue;
95 95
             }
96 96
             $this->model->rejectChild($instance);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         }
145 145
 
146 146
         foreach ($this->text_modules['replace'] as $text_module) {
147
-            if (! $module = FlatReferenceFactory::fromString($text_module['id'])->instance()) {
147
+            if (!$module = FlatReferenceFactory::fromString($text_module['id'])->instance()) {
148 148
                 continue;
149 149
             }
150 150
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
     private function removeTextualModule($module)
165 165
     {
166
-        if (! $module instanceof TextModule && ! $module instanceof PagetitleModule) {
166
+        if (!$module instanceof TextModule && !$module instanceof PagetitleModule) {
167 167
             throw new \Exception('Invalid request to remove non textual module');
168 168
         }
169 169
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 continue;
186 186
             }
187 187
 
188
-            $child = $children->first(function ($c) use ($reference) {
188
+            $child = $children->first(function($c) use ($reference) {
189 189
                 return $c->flatReference()->get() == $reference;
190 190
             });
191 191
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     private function stripTagsBlacklist($value, $blacklist = [])
237 237
     {
238 238
         foreach ($blacklist as $tag) {
239
-            $value = preg_replace('/<\/?' . $tag . '(.|\s)*?>/', '', $value);
239
+            $value = preg_replace('/<\/?'.$tag.'(.|\s)*?>/', '', $value);
240 240
         }
241 241
 
242 242
         return $value;
Please login to merge, or discard this patch.
src/Menu/Application/UpdateMenu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             $menu->parent_id = ($request->get('allow_parent') && $request->get('parent_id')) ? $request->get('parent_id') : null;
25 25
             $menu->page_id = ($page_id = $request->get('page_id')) ? $this->getPage($request->get('page_id'))->id : null;
26 26
             $menu->collection_type = $request->get('collection_type', null);
27
-            $menu->order        = $request->get('order', 0);
27
+            $menu->order = $request->get('order', 0);
28 28
 
29 29
             $this->reorderAgainstSiblings($menu);
30 30
             $menu->save();
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
         if (in_array($menu->order, $sequence)) {
53 53
             foreach ($sequence as $id => $order) {
54 54
                 if ($order < $menu->order) {
55
-                } else {
55
+                }else {
56 56
                     $sequence[$id]++;
57 57
                 }
58 58
             }
59 59
         }
60 60
 
61
-        $sequence = $sequence + [$menu->id => $menu->order];
61
+        $sequence = $sequence+[$menu->id => $menu->order];
62 62
 
63 63
         asort($sequence);
64 64
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
     private function reorder(array $sequence)
69 69
     {
70
-        array_walk($sequence, function ($order, $id) {
70
+        array_walk($sequence, function($order, $id) {
71 71
             MenuItem::withoutGlobalScope(SoftDeletingScope::class)
72 72
                 ->where('id', $id)
73 73
                 ->update(['order' => $order]);
Please login to merge, or discard this patch.
src/Menu/MenuItem.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
             if ($item->collection_type) {
111 111
                 $pages = Morphables::instance($item->collection_type)->getAllPublished();
112 112
 
113
-                $pages->each(function (ActsAsMenuItem $page) use (&$collectionItems, $item) {
113
+                $pages->each(function(ActsAsMenuItem $page) use (&$collectionItems, $item) {
114 114
                     $collectionItems->push(MenuItem::make([
115
-                        'id'             => 1000 . $item->id . $page->id,         // Unique integer identifier since model->id is automatically casted to int.
115
+                        'id'             => 1000.$item->id.$page->id, // Unique integer identifier since model->id is automatically casted to int.
116 116
                         'label'          => $page->menuLabel(),
117 117
                         'url'            => self::composePageUrl($item, $page),
118 118
                         'parent_id'      => $item->id,
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             if ($item->ofType(static::TYPE_INTERNAL) && $page = $item->page) {
128 128
                 if ($page->isArchived()) {
129 129
                     unset($items[$k]);
130
-                } else {
130
+                }else {
131 131
                     $item->url            = self::composePageUrl($item, $page);
132 132
                     $item->page_label     = $page->menuLabel();
133 133
                     $item->hidden_in_menu = $page->hidden_in_menu;
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
      */
173 173
     public function entry(Node $node)
174 174
     {
175
-        return (object) [
175
+        return (object)[
176 176
             'id'             => $node->id,
177 177
             'type'           => $node->type,
178 178
             'label'          => $node->label,
179
-            'page_label'     => $node->page_label,                       // Extra info when dealing with internal links
179
+            'page_label'     => $node->page_label, // Extra info when dealing with internal links
180 180
             'url'            => $node->url,
181 181
             'order'          => $node->order,
182 182
             'page_id'        => $node->page_id,
Please login to merge, or discard this patch.
src/Menu/Menu.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $types = config('thinktomorrow.chief.menus', []);
29 29
 
30
-        return collect($types)->map(function ($menu, $key) {
30
+        return collect($types)->map(function($menu, $key) {
31 31
             return new static($key, $menu['label'], $menu['view']);
32 32
         });
33 33
     }
34 34
 
35 35
     public static function find($key): ?self
36 36
     {
37
-        return static::all()->filter(function ($menu) use ($key) {
37
+        return static::all()->filter(function($menu) use ($key) {
38 38
             return $menu->key() == $key;
39 39
         })->first();
40 40
     }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $menu = [];
85 85
 
86
-        $this->items()->each(function ($item) use (&$menu) {
86
+        $this->items()->each(function($item) use (&$menu) {
87 87
             $menu[] = sprintf('<li><a href="%s">%s</a></li>', $item->url, $item->label);
88 88
         });
89 89
 
Please login to merge, or discard this patch.
src/Snippets/SnippetParser.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
             return $value;
13 13
         }
14 14
 
15
-        $value = preg_replace_callback(static::$pattern, function ($matches) {
15
+        $value = preg_replace_callback(static::$pattern, function($matches) {
16 16
 
17 17
             // First entry of matches contains our full captured group, which we want to replace.
18 18
             // Second entry is the text itself, without the brackets
Please login to merge, or discard this patch.