Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#574)
by Steven
02:52
created
src/CrudTrait.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
      *
70 70
      * @param array $columns - the database columns that contain the JSONs
71 71
      *
72
-     * @return Model
72
+     * @return CrudTrait
73 73
      */
74 74
     public function withFakes($columns = [])
75 75
     {
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 namespace Backpack\CRUD;
4 4
 
5 5
 use DB;
6
-use Illuminate\Support\Facades\Config;
7 6
 use Illuminate\Database\Eloquent\Model;
7
+use Illuminate\Support\Facades\Config;
8 8
 
9 9
 trait CrudTrait
10 10
 {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         // register the enum column type, because Doctrine doesn't support it
53 53
         $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
54 54
 
55
-        return ! $conn->getDoctrineColumn($table, $column_name)->getNotnull();
55
+        return !$conn->getDoctrineColumn($table, $column_name)->getNotnull();
56 56
     }
57 57
 
58 58
     /*
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         foreach ($columns as $key => $column) {
72 72
             $column_contents = $this->{$column};
73 73
 
74
-            if (! is_object($this->{$column})) {
74
+            if (!is_object($this->{$column})) {
75 75
                 $column_contents = json_decode($this->{$column});
76 76
             }
77 77
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $model = '\\'.get_class($this);
96 96
 
97
-        if (! count($columns)) {
97
+        if (!count($columns)) {
98 98
             $columns = (property_exists($model, 'fakeColumns')) ? $this->fakeColumns : ['extras'];
99 99
         }
100 100
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             $attribute_value = (array) $this->{$attribute_name};
185 185
             foreach ($files_to_clear as $key => $filename) {
186 186
                 \Storage::disk($disk)->delete($filename);
187
-                $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) {
187
+                $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) {
188 188
                     return $value != $filename;
189 189
                 });
190 190
             }
Please login to merge, or discard this patch.
src/resources/views-elfinder/filepicker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     <!-- Include jQuery, jQuery UI, elFinder (REQUIRED) -->
27 27
 
28 28
     <?php
29
-    $mimeTypes = implode(',', array_map(function ($t) {
29
+    $mimeTypes = implode(',', array_map(function($t) {
30 30
         return "'".$t."'";
31 31
     }, explode(',', $type)));
32 32
     ?>
Please login to merge, or discard this patch.
src/PanelTraits/Access.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function hasAccess($permission)
33 33
     {
34
-        if (! in_array($permission, $this->access)) {
34
+        if (!in_array($permission, $this->access)) {
35 35
             return false;
36 36
         }
37 37
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     public function hasAccessToAll($permission_array)
67 67
     {
68 68
         foreach ($permission_array as $key => $permission) {
69
-            if (! in_array($permission, $this->access)) {
69
+            if (!in_array($permission, $this->access)) {
70 70
                 return false;
71 71
             }
72 72
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function hasAccessOrFail($permission)
85 85
     {
86
-        if (! in_array($permission, $this->access)) {
86
+        if (!in_array($permission, $this->access)) {
87 87
             abort(403, trans('backpack::crud.unauthorized_access'));
88 88
         }
89 89
     }
Please login to merge, or discard this patch.
src/PanelTraits/FakeColumns.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,20 +29,20 @@
 block discarded – undo
29 29
             if (isset($fields[$k]['fake']) && $fields[$k]['fake'] == true) {
30 30
                 // add it to the request in its appropriate variable - the one defined, if defined
31 31
                 if (isset($fields[$k]['store_in'])) {
32
-                    if (! in_array($fields[$k]['store_in'], $fake_field_columns_to_encode, true)) {
32
+                    if (!in_array($fields[$k]['store_in'], $fake_field_columns_to_encode, true)) {
33 33
                         array_push($fake_field_columns_to_encode, $fields[$k]['store_in']);
34 34
                     }
35 35
                 } else {
36 36
                     //otherwise in the one defined in the $crud variable
37 37
 
38
-                    if (! in_array('extras', $fake_field_columns_to_encode, true)) {
38
+                    if (!in_array('extras', $fake_field_columns_to_encode, true)) {
39 39
                         array_push($fake_field_columns_to_encode, 'extras');
40 40
                     }
41 41
                 }
42 42
             }
43 43
         }
44 44
 
45
-        if (! count($fake_field_columns_to_encode)) {
45
+        if (!count($fake_field_columns_to_encode)) {
46 46
             return ['extras'];
47 47
         }
48 48
 
Please login to merge, or discard this patch.
src/PanelTraits/FakeFields.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
                     // remove the fake field
42 42
                     array_pull($request, $fields[$k]['name']);
43 43
 
44
-                    if (! in_array($fields[$k]['store_in'], $fake_field_columns_to_encode, true)) {
44
+                    if (!in_array($fields[$k]['store_in'], $fake_field_columns_to_encode, true)) {
45 45
                         array_push($fake_field_columns_to_encode, $fields[$k]['store_in']);
46 46
                     }
47 47
                 } else {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                     // remove the fake field
53 53
                     array_pull($request, $fields[$k]['name']);
54 54
 
55
-                    if (! in_array('extras', $fake_field_columns_to_encode, true)) {
55
+                    if (!in_array('extras', $fake_field_columns_to_encode, true)) {
56 56
                         array_push($fake_field_columns_to_encode, 'extras');
57 57
                     }
58 58
                 }
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -95,6 +95,12 @@
 block discarded – undo
95 95
     public $type = 'view';
96 96
     public $content;
97 97
 
98
+    /**
99
+     * @param string $stack
100
+     * @param string $name
101
+     * @param string $type
102
+     * @param string $content
103
+     */
98 104
     public function __construct($stack, $name, $type, $content)
99 105
     {
100 106
         $this->stack = $stack;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function removeButton($name)
79 79
     {
80
-        $this->buttons = $this->buttons->reject(function ($button) use ($name) {
80
+        $this->buttons = $this->buttons->reject(function($button) use ($name) {
81 81
             return $button->name == $name;
82 82
         });
83 83
     }
@@ -89,14 +89,14 @@  discard block
 block discarded – undo
89 89
 
90 90
     public function removeAllButtonsFromStack($stack)
91 91
     {
92
-        $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
92
+        $this->buttons = $this->buttons->reject(function($button) use ($stack) {
93 93
             return $button->stack == $stack;
94 94
         });
95 95
     }
96 96
 
97 97
     public function removeButtonFromStack($name, $stack)
98 98
     {
99
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
99
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
100 100
             return $button->name == $name && $button->stack == $stack;
101 101
         });
102 102
     }
Please login to merge, or discard this patch.
src/CrudPanel.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function setModel($model_namespace)
72 72
     {
73
-        if (! class_exists($model_namespace)) {
73
+        if (!class_exists($model_namespace)) {
74 74
             throw new \Exception('This model does not exist.', 404);
75 75
         }
76 76
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $complete_route = $route.'.index';
114 114
 
115
-        if (! \Route::has($complete_route)) {
115
+        if (!\Route::has($complete_route)) {
116 116
             throw new \Exception('There are no routes for this route name.', 404);
117 117
         }
118 118
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function getFirstOfItsTypeInArray($type, $array)
164 164
     {
165
-        return array_first($array, function ($item) use ($type) {
165
+        return array_first($array, function($item) use ($type) {
166 166
             return $item['type'] == $type;
167 167
         });
168 168
     }
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 
180 180
     public function sync($type, $fields, $attributes)
181 181
     {
182
-        if (! empty($this->{$type})) {
183
-            $this->{$type} = array_map(function ($field) use ($fields, $attributes) {
182
+        if (!empty($this->{$type})) {
183
+            $this->{$type} = array_map(function($field) use ($fields, $attributes) {
184 184
                 if (in_array($field['name'], (array) $fields)) {
185 185
                     $field = array_merge($field, $attributes);
186 186
                 }
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
                 }
207 207
             }
208 208
 
209
-            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function ($item) use ($items) {
210
-                return ! in_array($item['name'], $this->sort[$items]);
209
+            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use ($items) {
210
+                return !in_array($item['name'], $this->sort[$items]);
211 211
             }));
212 212
         }
213 213
 
Please login to merge, or discard this patch.
Unused Use Statements   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,24 +2,24 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD;
4 4
 
5
-use Backpack\CRUD\PanelTraits\Read;
6
-use Backpack\CRUD\PanelTraits\Tabs;
7
-use Backpack\CRUD\PanelTraits\Query;
8
-use Backpack\CRUD\PanelTraits\Views;
9 5
 use Backpack\CRUD\PanelTraits\Access;
6
+use Backpack\CRUD\PanelTraits\AutoFocus;
7
+use Backpack\CRUD\PanelTraits\AutoSet;
8
+use Backpack\CRUD\PanelTraits\Buttons;
9
+use Backpack\CRUD\PanelTraits\Columns;
10 10
 use Backpack\CRUD\PanelTraits\Create;
11 11
 use Backpack\CRUD\PanelTraits\Delete;
12 12
 use Backpack\CRUD\PanelTraits\Errors;
13
+use Backpack\CRUD\PanelTraits\FakeColumns;
14
+use Backpack\CRUD\PanelTraits\FakeFields;
13 15
 use Backpack\CRUD\PanelTraits\Fields;
14
-use Backpack\CRUD\PanelTraits\Update;
15
-use Backpack\CRUD\PanelTraits\AutoSet;
16
-use Backpack\CRUD\PanelTraits\Buttons;
17
-use Backpack\CRUD\PanelTraits\Columns;
18 16
 use Backpack\CRUD\PanelTraits\Filters;
17
+use Backpack\CRUD\PanelTraits\Query;
18
+use Backpack\CRUD\PanelTraits\Read;
19 19
 use Backpack\CRUD\PanelTraits\Reorder;
20
-use Backpack\CRUD\PanelTraits\AutoFocus;
21
-use Backpack\CRUD\PanelTraits\FakeFields;
22
-use Backpack\CRUD\PanelTraits\FakeColumns;
20
+use Backpack\CRUD\PanelTraits\Tabs;
21
+use Backpack\CRUD\PanelTraits\Update;
22
+use Backpack\CRUD\PanelTraits\Views;
23 23
 use Backpack\CRUD\PanelTraits\ViewsAndRestoresRevisions;
24 24
 
25 25
 class CrudPanel
Please login to merge, or discard this patch.
src/PanelTraits/ViewsAndRestoresRevisions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
             $revisionDate = date('Y-m-d', strtotime((string) $history->created_at));
22 22
 
23 23
             // Be sure to instantiate the initial grouping array
24
-            if (! array_key_exists($revisionDate, $revisions)) {
24
+            if (!array_key_exists($revisionDate, $revisions)) {
25 25
                 $revisions[$revisionDate] = [];
26 26
             }
27 27
 
Please login to merge, or discard this patch.
src/app/Http/Controllers/CrudFeatures/Reorder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
     {
175 175
         $this->crud->hasAccessOrFail('reorder');
176 176
 
177
-        if (! $this->crud->isReorderEnabled()) {
177
+        if (!$this->crud->isReorderEnabled()) {
178 178
             abort(403, 'Reorder is disabled.');
179 179
         }
180 180
 
Please login to merge, or discard this patch.