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 (#1935)
by Cristian
02:39
created
src/app/Library/CrudPanel/Traits/HeadingsAndTitles.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function getTitle($action = false)
23 23
     {
24
-        if (! $action) {
24
+        if (!$action) {
25 25
             $action = $this->getActionMethod();
26 26
         }
27 27
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function setTitle($string, $action = false)
40 40
     {
41
-        if (! $action) {
41
+        if (!$action) {
42 42
             $action = $this->getActionMethod();
43 43
         }
44 44
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function getHeading($action = false)
60 60
     {
61
-        if (! $action) {
61
+        if (!$action) {
62 62
             $action = $this->getActionMethod();
63 63
         }
64 64
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function setHeading($string, $action = false)
77 77
     {
78
-        if (! $action) {
78
+        if (!$action) {
79 79
             $action = $this->getActionMethod();
80 80
         }
81 81
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function getSubheading($action = false)
97 97
     {
98
-        if (! $action) {
98
+        if (!$action) {
99 99
             $action = $this->getActionMethod();
100 100
         }
101 101
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public function setSubheading($string, $action = false)
114 114
     {
115
-        if (! $action) {
115
+        if (!$action) {
116 116
             $action = $this->getActionMethod();
117 117
         }
118 118
 
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Read.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $id = $this->getCurrentEntryId();
40 40
 
41
-        if (! $id) {
41
+        if (!$id) {
42 42
             return false;
43 43
         }
44 44
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getEntry($id)
56 56
     {
57
-        if (! $this->entry) {
57
+        if (!$this->entry) {
58 58
             $this->entry = $this->model->findOrFail($id);
59 59
             $this->entry = $this->entry->withFakes();
60 60
         }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     {
200 200
         // If the default Page Length isn't in the menu's values, Add it the beginnin and resort all to show a croissant list.
201 201
         // assume both arrays are the same length.
202
-        if (! in_array($this->getDefaultPageLength(), $this->getOperationSetting('pageLengthMenu')[0])) {
202
+        if (!in_array($this->getDefaultPageLength(), $this->getOperationSetting('pageLengthMenu')[0])) {
203 203
             // Loop through 2 arrays of prop. page_length_menu
204 204
             foreach ($this->getOperationSetting('pageLengthMenu') as $key => &$page_length_choices) {
205 205
                 // This is a condition that should be always true.
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     public function getPageLengthMenu()
231 231
     {
232 232
         // if already set, use that
233
-        if (! $this->getOperationSetting('pageLengthMenu')) {
233
+        if (!$this->getOperationSetting('pageLengthMenu')) {
234 234
             // try to get the menu settings from the config file
235 235
             $this->setOperationSetting('pageLengthMenu', config('backpack.crud.page_length_menu') ?? [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']]);
236 236
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -175,6 +175,7 @@
 block discarded – undo
175 175
 
176 176
     /**
177 177
      * Set the number of rows that should be show on the list view.
178
+     * @param integer $value
178 179
      */
179 180
     public function setDefaultPageLength($value)
180 181
     {
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/SaveActions.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 
25 25
         $saveOptions = collect($permissions)
26 26
             // Restrict list to allowed actions.
27
-            ->filter(function ($action, $permission) {
27
+            ->filter(function($action, $permission) {
28 28
                 return $this->hasAccess($permission);
29 29
             })
30 30
             // Generate list of possible actions.
31
-            ->mapWithKeys(function ($action, $permission) {
31
+            ->mapWithKeys(function($action, $permission) {
32 32
                 return [$action => $this->getSaveActionButtonName($action)];
33 33
             })
34 34
             ->all();
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function setSaveAction($forceSaveAction = null)
65 65
     {
66
-        $saveAction = $forceSaveAction ?:
67
-            \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
66
+        $saveAction = $forceSaveAction ?: \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
68 67
 
69 68
         if (config('backpack.crud.show_save_action_change', true) &&
70 69
             session('save_action', 'save_and_back') !== $saveAction) {
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Update.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         foreach ($fields as &$field) {
53 53
             // set the value
54
-            if (! isset($field['value'])) {
54
+            if (!isset($field['value'])) {
55 55
                 if (isset($field['subfields'])) {
56 56
                     $field['value'] = [];
57 57
                     foreach ($field['subfields'] as $subfield) {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         }
65 65
 
66 66
         // always have a hidden input for the entry id
67
-        if (! array_key_exists('id', $fields)) {
67
+        if (!array_key_exists('id', $fields)) {
68 68
             $fields['id'] = [
69 69
                 'name'  => $entry->getKeyName(),
70 70
                 'value' => $entry->getKey(),
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         if (isset($field['entity'])) {
89 89
             $relationArray = explode('.', $field['entity']);
90
-            $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) {
90
+            $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function($obj, $method) {
91 91
                 return $obj->{$method} ? $obj->{$method} : $obj;
92 92
             }, $model);
93 93
 
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Access.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             $this->set($op.'.access', false);
34 34
         }
35 35
 
36
-        return ! $this->hasAccessToAny($operation);
36
+        return !$this->hasAccessToAny($operation);
37 37
     }
38 38
 
39 39
     /**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function hasAccessToAll($operation_array)
74 74
     {
75 75
         foreach ((array) $operation_array as $key => $operation) {
76
-            if (! $this->get($operation.'.access')) {
76
+            if (!$this->get($operation.'.access')) {
77 77
                 return false;
78 78
             }
79 79
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function hasAccessOrFail($operation)
92 92
     {
93
-        if (! $this->get($operation.'.access')) {
93
+        if (!$this->get($operation.'.access')) {
94 94
             throw new AccessDeniedException(trans('backpack::crud.unauthorized_access', ['access' => $operation]));
95 95
         }
96 96
 
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Filters.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $this->enableFilters();
60 60
 
61 61
         // check if another filter with the same name exists
62
-        if (! isset($options['name'])) {
62
+        if (!isset($options['name'])) {
63 63
             abort(500, 'All your filters need names.');
64 64
         }
65 65
         if ($this->filters()->contains('name', $options['name'])) {
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     {
202 202
         $filter = $this->filters()->firstWhere('name', $name);
203 203
 
204
-        if (! $filter) {
204
+        if (!$filter) {
205 205
             abort(500, 'CRUD Filter "'.$name.'" not found. Please check the filter exists before you modify it.');
206 206
         }
207 207
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
     public function removeFilter($name)
218 218
     {
219
-        $strippedFiltersCollection = $this->filters()->reject(function ($filter) use ($name) {
219
+        $strippedFiltersCollection = $this->filters()->reject(function($filter) use ($name) {
220 220
             return $filter->name == $name;
221 221
         });
222 222
 
@@ -278,16 +278,16 @@  discard block
 block discarded – undo
278 278
 
279 279
     public function checkOptionsIntegrity($options)
280 280
     {
281
-        if (! isset($options['name'])) {
281
+        if (!isset($options['name'])) {
282 282
             abort(500, 'Please make sure all your filters have names.');
283 283
         }
284
-        if (! isset($options['type'])) {
284
+        if (!isset($options['type'])) {
285 285
             abort(500, 'Please make sure all your filters have types.');
286 286
         }
287
-        if (! \View::exists('crud::filters.'.$options['type'])) {
287
+        if (!\View::exists('crud::filters.'.$options['type'])) {
288 288
             abort(500, 'No filter view named "'.$options['type'].'.blade.php" was found.');
289 289
         }
290
-        if (! isset($options['label'])) {
290
+        if (!isset($options['label'])) {
291 291
             abort(500, 'Please make sure all your filters have labels.');
292 292
         }
293 293
     }
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Columns.php 2 patches
Spacing   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function addColumn($column)
64 64
     {
65 65
         // if a string was passed, not an array, change it to an array
66
-        if (! is_array($column)) {
66
+        if (!is_array($column)) {
67 67
             $column = ['name' => $column];
68 68
         }
69 69
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $column_with_details = $this->addDefaultLabel($column);
72 72
 
73 73
         // make sure the column has a name
74
-        if (! array_key_exists('name', $column_with_details)) {
74
+        if (!array_key_exists('name', $column_with_details)) {
75 75
             $column_with_details['name'] = 'anonymous_column_'.str_random(5);
76 76
         }
77 77
 
@@ -79,27 +79,27 @@  discard block
 block discarded – undo
79 79
         $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']);
80 80
 
81 81
         // make sure the column has a type
82
-        if (! array_key_exists('type', $column_with_details)) {
82
+        if (!array_key_exists('type', $column_with_details)) {
83 83
             $column_with_details['type'] = 'text';
84 84
         }
85 85
 
86 86
         // make sure the column has a key
87
-        if (! array_key_exists('key', $column_with_details)) {
87
+        if (!array_key_exists('key', $column_with_details)) {
88 88
             $column_with_details['key'] = $column_with_details['name'];
89 89
         }
90 90
 
91 91
         // make sure the column has a tableColumn boolean
92
-        if (! array_key_exists('tableColumn', $column_with_details)) {
92
+        if (!array_key_exists('tableColumn', $column_with_details)) {
93 93
             $column_with_details['tableColumn'] = $columnExistsInDb ? true : false;
94 94
         }
95 95
 
96 96
         // make sure the column has a orderable boolean
97
-        if (! array_key_exists('orderable', $column_with_details)) {
97
+        if (!array_key_exists('orderable', $column_with_details)) {
98 98
             $column_with_details['orderable'] = $columnExistsInDb ? true : false;
99 99
         }
100 100
 
101 101
         // make sure the column has a searchLogic
102
-        if (! array_key_exists('searchLogic', $column_with_details)) {
102
+        if (!array_key_exists('searchLogic', $column_with_details)) {
103 103
             $column_with_details['searchLogic'] = $columnExistsInDb ? true : false;
104 104
         }
105 105
 
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 
109 109
         // make sure the column has a priority in terms of visibility
110 110
         // if no priority has been defined, use the order in the array plus one
111
-        if (! array_key_exists('priority', $column_with_details)) {
111
+        if (!array_key_exists('priority', $column_with_details)) {
112 112
             $position_in_columns_array = (int) array_search($column_with_details['key'], array_keys($this->columns()));
113 113
             $columnsArray[$column_with_details['key']]['priority'] = $position_in_columns_array + 1;
114 114
         }
115 115
 
116 116
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
117 117
         // defined in the main model
118
-        if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) {
118
+        if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) {
119 119
             $columnsArray[$column_with_details['key']]['model'] = $this->getRelationModel($column_with_details['entity']);
120 120
         }
121 121
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function makeFirstColumn()
166 166
     {
167
-        if (! $this->columns()) {
167
+        if (!$this->columns()) {
168 168
             return false;
169 169
         }
170 170
 
@@ -186,8 +186,7 @@  discard block
 block discarded – undo
186 186
         $columnsArray = $this->columns();
187 187
 
188 188
         if (array_key_exists($targetColumnName, $columnsArray)) {
189
-            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) :
190
-                array_search($targetColumnName, array_keys($columnsArray)) + 1;
189
+            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) : array_search($targetColumnName, array_keys($columnsArray)) + 1;
191 190
 
192 191
             $element = array_pop($columnsArray);
193 192
             $beginningPart = array_slice($columnsArray, 0, $targetColumnPosition, true);
@@ -225,7 +224,7 @@  discard block
 block discarded – undo
225 224
      */
226 225
     public function addDefaultLabel($array)
227 226
     {
228
-        if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
227
+        if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
229 228
             $array = array_merge(['label' => mb_ucfirst($this->makeLabel($array['name']))], $array);
230 229
 
231 230
             return $array;
@@ -253,7 +252,7 @@  discard block
 block discarded – undo
253 252
      */
254 253
     public function removeColumns($columns)
255 254
     {
256
-        if (! empty($columns)) {
255
+        if (!empty($columns)) {
257 256
             foreach ($columns as $columnKey) {
258 257
                 $this->removeColumn($columnKey);
259 258
             }
@@ -331,7 +330,7 @@  discard block
 block discarded – undo
331 330
     {
332 331
         $columns = $this->columns();
333 332
 
334
-        return collect($columns)->pluck('entity')->reject(function ($value, $key) {
333
+        return collect($columns)->pluck('entity')->reject(function($value, $key) {
335 334
             return $value == null;
336 335
         })->toArray();
337 336
     }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     /**
142 142
      * Move the most recently added column after the given target column.
143 143
      *
144
-     * @param string|array $targetColumn The target column name or array.
144
+     * @param string $targetColumn The target column name or array.
145 145
      */
146 146
     public function afterColumn($targetColumn)
147 147
     {
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     /**
162 162
      * Move this column to be first in the columns list.
163 163
      *
164
-     * @return bool|null
164
+     * @return false|null
165 165
      */
166 166
     public function makeFirstColumn()
167 167
     {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     /**
240 240
      * Remove a column from the CRUD panel by name.
241 241
      *
242
-     * @param string $column The column key.
242
+     * @param string $columnKey The column key.
243 243
      */
244 244
     public function removeColumn($columnKey)
245 245
     {
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Query.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
      */
69 69
     public function customOrderBy($column, $columnDirection = 'asc')
70 70
     {
71
-        if (! isset($column['orderLogic'])) {
71
+        if (!isset($column['orderLogic'])) {
72 72
             return $this->query;
73 73
         }
74 74
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
      * Order results of the query in a custom way.
66 66
      *
67 67
      * @param array  $column           Column array with all attributes
68
-     * @param string $column_direction ASC or DESC
68
+     * @param string $columnDirection ASC or DESC
69 69
      *
70 70
      * @return \Illuminate\Database\Eloquent\Builder
71 71
      */
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Validation.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
      */
95 95
     public function isRequired($inputKey)
96 96
     {
97
-        if (! $this->hasOperationSetting('requiredFields')) {
97
+        if (!$this->hasOperationSetting('requiredFields')) {
98 98
             return false;
99 99
         }
100 100
 
Please login to merge, or discard this patch.
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,6 @@
 block discarded – undo
107 107
      * for the given operation.
108 108
      *
109 109
      * @param string $inputKey  Field or input name.
110
-     * @param string $operation create / update
111 110
      *
112 111
      * @return bool
113 112
      */
Please login to merge, or discard this patch.