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 (#1556)
by Thomas
07:32
created
src/PanelTraits/Columns.php 1 patch
Spacing   +16 added lines, -17 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     public function addColumn($column)
67 67
     {
68 68
         // if a string was passed, not an array, change it to an array
69
-        if (! is_array($column)) {
69
+        if (!is_array($column)) {
70 70
             $column = ['name' => $column];
71 71
         }
72 72
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $column_with_details = $this->addDefaultLabel($column);
75 75
 
76 76
         // make sure the column has a name
77
-        if (! array_key_exists('name', $column_with_details)) {
77
+        if (!array_key_exists('name', $column_with_details)) {
78 78
             $column_with_details['name'] = 'anonymous_column_'.str_random(5);
79 79
         }
80 80
 
@@ -82,27 +82,27 @@  discard block
 block discarded – undo
82 82
         $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']);
83 83
 
84 84
         // make sure the column has a type
85
-        if (! array_key_exists('type', $column_with_details)) {
85
+        if (!array_key_exists('type', $column_with_details)) {
86 86
             $column_with_details['type'] = 'text';
87 87
         }
88 88
 
89 89
         // make sure the column has a key
90
-        if (! array_key_exists('key', $column_with_details)) {
90
+        if (!array_key_exists('key', $column_with_details)) {
91 91
             $column_with_details['key'] = $column_with_details['name'];
92 92
         }
93 93
 
94 94
         // make sure the column has a tableColumn boolean
95
-        if (! array_key_exists('tableColumn', $column_with_details)) {
95
+        if (!array_key_exists('tableColumn', $column_with_details)) {
96 96
             $column_with_details['tableColumn'] = $columnExistsInDb ? true : false;
97 97
         }
98 98
 
99 99
         // make sure the column has a orderable boolean
100
-        if (! array_key_exists('orderable', $column_with_details)) {
100
+        if (!array_key_exists('orderable', $column_with_details)) {
101 101
             $column_with_details['orderable'] = $columnExistsInDb ? true : false;
102 102
         }
103 103
 
104 104
         // make sure the column has a searchLogic
105
-        if (! array_key_exists('searchLogic', $column_with_details)) {
105
+        if (!array_key_exists('searchLogic', $column_with_details)) {
106 106
             $column_with_details['searchLogic'] = $columnExistsInDb ? true : false;
107 107
         }
108 108
 
@@ -110,14 +110,14 @@  discard block
 block discarded – undo
110 110
 
111 111
         // make sure the column has a priority in terms of visibility
112 112
         // if no priority has been defined, use the order in the array plus one
113
-        if (! array_key_exists('priority', $column_with_details)) {
113
+        if (!array_key_exists('priority', $column_with_details)) {
114 114
             $position_in_columns_array = (int) array_search($column_with_details['key'], array_keys($this->columns));
115 115
             $this->columns[$column_with_details['key']]['priority'] = $position_in_columns_array + 1;
116 116
         }
117 117
 
118 118
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
119 119
         // defined in the main model
120
-        if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) {
120
+        if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) {
121 121
             $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']);
122 122
         }
123 123
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public function makeFirstColumn()
165 165
     {
166
-        if (! $this->columns) {
166
+        if (!$this->columns) {
167 167
             return false;
168 168
         }
169 169
 
@@ -184,8 +184,7 @@  discard block
 block discarded – undo
184 184
         $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn;
185 185
 
186 186
         if (array_key_exists($targetColumnName, $this->columns)) {
187
-            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) :
188
-                array_search($targetColumnName, array_keys($this->columns)) + 1;
187
+            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1;
189 188
 
190 189
             $element = array_pop($this->columns);
191 190
             $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true);
@@ -219,7 +218,7 @@  discard block
 block discarded – undo
219 218
      */
220 219
     public function addDefaultLabel($array)
221 220
     {
222
-        if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
221
+        if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
223 222
             $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array);
224 223
 
225 224
             return $array;
@@ -245,7 +244,7 @@  discard block
 block discarded – undo
245 244
      */
246 245
     public function removeColumns($columns)
247 246
     {
248
-        if (! empty($columns)) {
247
+        if (!empty($columns)) {
249 248
             foreach ($columns as $columnName) {
250 249
                 $this->removeColumn($columnName);
251 250
             }
@@ -266,8 +265,8 @@  discard block
 block discarded – undo
266 265
      */
267 266
     public function remove($entity, $fields)
268 267
     {
269
-        return array_values(array_filter($this->{$entity}, function ($field) use ($fields) {
270
-            return ! in_array($field['name'], (array) $fields);
268
+        return array_values(array_filter($this->{$entity}, function($field) use ($fields) {
269
+            return !in_array($field['name'], (array) $fields);
271 270
         }));
272 271
     }
273 272
 
@@ -312,7 +311,7 @@  discard block
 block discarded – undo
312 311
     {
313 312
         $columns = $this->getColumns();
314 313
 
315
-        return collect($columns)->pluck('entity')->reject(function ($value, $key) {
314
+        return collect($columns)->pluck('entity')->reject(function($value, $key) {
316 315
             return $value == null;
317 316
         })->toArray();
318 317
     }
Please login to merge, or discard this patch.
src/app/Http/Controllers/Operations/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.
src/app/Http/Controllers/Operations/Revisions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         $this->crud->hasAccessOrFail('revisions');
42 42
 
43 43
         $revisionId = \Request::input('revision_id', false);
44
-        if (! $revisionId) {
44
+        if (!$revisionId) {
45 45
             abort(500, 'Can\'t restore revision without revision_id');
46 46
         } else {
47 47
             $this->crud->restoreRevision($id, $revisionId); // do the update
Please login to merge, or discard this patch.
src/app/Http/Controllers/Operations/SaveActions.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 
23 23
         $saveOptions = collect($permissions)
24 24
             // Restrict list to allowed actions.
25
-            ->filter(function ($action, $permission) {
25
+            ->filter(function($action, $permission) {
26 26
                 return $this->crud->hasAccess($permission);
27 27
             })
28 28
             // Generate list of possible actions.
29
-            ->mapWithKeys(function ($action, $permission) {
29
+            ->mapWithKeys(function($action, $permission) {
30 30
                 return [$action => $this->getSaveActionButtonName($action)];
31 31
             })
32 32
             ->all();
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function setSaveAction($forceSaveAction = null)
63 63
     {
64
-        $saveAction = $forceSaveAction ?:
65
-            \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
64
+        $saveAction = $forceSaveAction ?: \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
66 65
 
67 66
         if (config('backpack.crud.show_save_action_change', true) &&
68 67
             session('save_action', 'save_and_back') !== $saveAction) {
Please login to merge, or discard this patch.
src/PanelTraits/Filters.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
     public function filtersEnabled()
10 10
     {
11
-        return ! is_array($this->filters);
11
+        return !is_array($this->filters);
12 12
     }
13 13
 
14 14
     public function filtersDisabled()
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $this->enableFilters();
54 54
 
55 55
         // check if another filter with the same name exists
56
-        if (! isset($options['name'])) {
56
+        if (!isset($options['name'])) {
57 57
             abort(500, 'All your filters need names.');
58 58
         }
59 59
         if ($this->filters->contains('name', $options['name'])) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     {
147 147
         $filter = $this->filters->firstWhere('name', $name);
148 148
 
149
-        if (! $filter) {
149
+        if (!$filter) {
150 150
             abort(500, 'CRUD Filter "'.$name.'" not found. Please check the filter exists before you modify it.');
151 151
         }
152 152
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 
162 162
     public function removeFilter($name)
163 163
     {
164
-        $this->filters = $this->filters->reject(function ($filter) use ($name) {
164
+        $this->filters = $this->filters->reject(function($filter) use ($name) {
165 165
             return $filter->name == $name;
166 166
         });
167 167
     }
@@ -245,16 +245,16 @@  discard block
 block discarded – undo
245 245
 
246 246
     public function checkOptionsIntegrity($options)
247 247
     {
248
-        if (! isset($options['name'])) {
248
+        if (!isset($options['name'])) {
249 249
             abort(500, 'Please make sure all your filters have names.');
250 250
         }
251
-        if (! isset($options['type'])) {
251
+        if (!isset($options['type'])) {
252 252
             abort(500, 'Please make sure all your filters have types.');
253 253
         }
254
-        if (! \View::exists('crud::filters.'.$options['type'])) {
254
+        if (!\View::exists('crud::filters.'.$options['type'])) {
255 255
             abort(500, 'No filter view named "'.$options['type'].'.blade.php" was found.');
256 256
         }
257
-        if (! isset($options['label'])) {
257
+        if (!isset($options['label'])) {
258 258
             abort(500, 'Please make sure all your filters have labels.');
259 259
         }
260 260
     }
Please login to merge, or discard this patch.
src/CrudTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'json_array');
60 60
         $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('jsonb', 'json_array');
61 61
 
62
-        return ! $conn->getDoctrineColumn($table, $column_name)->getNotnull();
62
+        return !$conn->getDoctrineColumn($table, $column_name)->getNotnull();
63 63
     }
64 64
 
65 65
     /*
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     public function addFakes($columns = ['extras'])
77 77
     {
78 78
         foreach ($columns as $key => $column) {
79
-            if (! isset($this->attributes[$column])) {
79
+            if (!isset($this->attributes[$column])) {
80 80
                 continue;
81 81
             }
82 82
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $model = '\\'.get_class($this);
107 107
 
108
-        if (! count($columns)) {
108
+        if (!count($columns)) {
109 109
             $columns = (property_exists($model, 'fakeColumns')) ? $this->fakeColumns : ['extras'];
110 110
         }
111 111
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function shouldDecodeFake($column)
124 124
     {
125
-        return ! in_array($column, array_keys($this->casts));
125
+        return !in_array($column, array_keys($this->casts));
126 126
     }
127 127
 
128 128
     /**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function shouldEncodeFake($column)
135 135
     {
136
-        return ! in_array($column, array_keys($this->casts));
136
+        return !in_array($column, array_keys($this->casts));
137 137
     }
138 138
 
139 139
     /*
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             $attribute_value = (array) $this->{$attribute_name};
217 217
             foreach ($files_to_clear as $key => $filename) {
218 218
                 \Storage::disk($disk)->delete($filename);
219
-                $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) {
219
+                $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) {
220 220
                     return $value != $filename;
221 221
                 });
222 222
             }
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function addButtonFromView($stack, $name, $view, $position = false)
63 63
     {
64
-        if (! view()->exists($view)) {
64
+        if (!view()->exists($view)) {
65 65
             $view = 'crud::buttons.'.$view;
66 66
         }
67 67
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $button = $this->buttons()->firstWhere('name', $name);
101 101
 
102
-        if (! $button) {
102
+        if (!$button) {
103 103
             abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.');
104 104
         }
105 105
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function removeButton($name, $stack = null)
122 122
     {
123
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
123
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
124 124
             return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name);
125 125
         });
126 126
     }
@@ -132,14 +132,14 @@  discard block
 block discarded – undo
132 132
 
133 133
     public function removeAllButtonsFromStack($stack)
134 134
     {
135
-        $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
135
+        $this->buttons = $this->buttons->reject(function($button) use ($stack) {
136 136
             return $button->stack == $stack;
137 137
         });
138 138
     }
139 139
 
140 140
     public function removeButtonFromStack($name, $stack)
141 141
     {
142
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
142
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
143 143
             return $button->name == $name && $button->stack == $stack;
144 144
         });
145 145
     }
Please login to merge, or discard this patch.