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
Push — master ( cb61c4...e26c47 )
by Cristian
12:02 queued 05:38
created
src/app/Library/CrudPanel/Traits/Columns.php 1 patch
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,17 +71,17 @@  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
 
78 78
         // make sure the column has a type
79
-        if (! array_key_exists('type', $column_with_details)) {
79
+        if (!array_key_exists('type', $column_with_details)) {
80 80
             $column_with_details['type'] = 'text';
81 81
         }
82 82
 
83 83
         // make sure the column has a key
84
-        if (! array_key_exists('key', $column_with_details)) {
84
+        if (!array_key_exists('key', $column_with_details)) {
85 85
             $column_with_details['key'] = str_replace('.', '__', $column_with_details['name']);
86 86
         }
87 87
 
@@ -89,17 +89,17 @@  discard block
 block discarded – undo
89 89
         $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']);
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
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function makeFirstColumn()
167 167
     {
168
-        if (! $this->columns()) {
168
+        if (!$this->columns()) {
169 169
             return false;
170 170
         }
171 171
 
@@ -187,8 +187,7 @@  discard block
 block discarded – undo
187 187
         $columnsArray = $this->columns();
188 188
 
189 189
         if (array_key_exists($targetColumnName, $columnsArray)) {
190
-            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) :
191
-                array_search($targetColumnName, array_keys($columnsArray)) + 1;
190
+            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) : array_search($targetColumnName, array_keys($columnsArray)) + 1;
192 191
 
193 192
             $element = array_pop($columnsArray);
194 193
             $beginningPart = array_slice($columnsArray, 0, $targetColumnPosition, true);
@@ -227,7 +226,7 @@  discard block
 block discarded – undo
227 226
      */
228 227
     public function addDefaultLabel($array)
229 228
     {
230
-        if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
229
+        if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
231 230
             $array = array_merge(['label' => mb_ucfirst($this->makeLabel($array['name']))], $array);
232 231
 
233 232
             return $array;
@@ -255,7 +254,7 @@  discard block
 block discarded – undo
255 254
      */
256 255
     public function removeColumns($columns)
257 256
     {
258
-        if (! empty($columns)) {
257
+        if (!empty($columns)) {
259 258
             foreach ($columns as $columnKey) {
260 259
                 $this->removeColumn($columnKey);
261 260
             }
@@ -334,7 +333,7 @@  discard block
 block discarded – undo
334 333
     {
335 334
         $columns = $this->columns();
336 335
 
337
-        return collect($columns)->pluck('entity')->reject(function ($value, $key) {
336
+        return collect($columns)->pluck('entity')->reject(function($value, $key) {
338 337
             return $value == null;
339 338
         })->toArray();
340 339
     }
Please login to merge, or discard this patch.
src/app/Http/Controllers/Operations/ReorderOperation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
         $this->crud->set('reorder.enabled', true);
37 37
         $this->crud->allowAccess('reorder');
38 38
 
39
-        $this->crud->operation('reorder', function () {
39
+        $this->crud->operation('reorder', function() {
40 40
             $this->crud->loadDefaultOperationSettingsFromConfig();
41 41
         });
42 42
 
43
-        $this->crud->operation('list', function () {
43
+        $this->crud->operation('list', function() {
44 44
             $this->crud->addButton('top', 'reorder', 'view', 'crud::buttons.reorder');
45 45
         });
46 46
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $this->crud->hasAccessOrFail('reorder');
58 58
 
59
-        if (! $this->crud->isReorderEnabled()) {
59
+        if (!$this->crud->isReorderEnabled()) {
60 60
             abort(403, 'Reorder is disabled.');
61 61
         }
62 62
 
Please login to merge, or discard this patch.
src/resources/views/crud/fields/table.blade.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 <?php
4 4
     $max = isset($field['max']) && (int) $field['max'] > 0 ? $field['max'] : -1;
5 5
     $min = isset($field['min']) && (int) $field['min'] > 0 ? $field['min'] : -1;
6
-    $item_name = strtolower(isset($field['entity_singular']) && ! empty($field['entity_singular']) ? $field['entity_singular'] : $field['label']);
6
+    $item_name = strtolower(isset($field['entity_singular']) && !empty($field['entity_singular']) ? $field['entity_singular'] : $field['label']);
7 7
 
8 8
     $items = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? '';
9 9
 
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
         } else {
16 16
             $items = '[]';
17 17
         }
18
-    } elseif (is_string($items) && ! is_array(json_decode($items))) {
18
+    } elseif (is_string($items) && !is_array(json_decode($items))) {
19 19
         $items = '[]';
20 20
     }
21 21
 
22 22
     // make sure columns are defined
23
-    if (! isset($field['columns'])) {
23
+    if (!isset($field['columns'])) {
24 24
         $field['columns'] = ['value' => 'Value'];
25 25
     }
26 26
 ?>
Please login to merge, or discard this patch.
src/app/Http/Controllers/Operations/ListOperation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $this->crud->allowAccess('list');
43 43
 
44
-        $this->crud->operation('list', function () {
44
+        $this->crud->operation('list', function() {
45 45
             $this->crud->loadDefaultOperationSettingsFromConfig();
46 46
         });
47 47
     }
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
         // if there was an order set, this will be the last one (after all others were applied)
113 113
         $orderBy = $this->crud->query->getQuery()->orders;
114 114
         $hasOrderByPrimaryKey = false;
115
-        collect($orderBy)->each(function ($item, $key) use ($hasOrderByPrimaryKey) {
116
-            if (! isset($item['column'])) {
115
+        collect($orderBy)->each(function($item, $key) use ($hasOrderByPrimaryKey) {
116
+            if (!isset($item['column'])) {
117 117
                 return false;
118 118
             }
119 119
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 return false;
124 124
             }
125 125
         });
126
-        if (! $hasOrderByPrimaryKey) {
126
+        if (!$hasOrderByPrimaryKey) {
127 127
             $this->crud->query->orderByDesc($this->crud->model->getKeyName());
128 128
         }
129 129
 
Please login to merge, or discard this patch.
src/resources/views/crud/columns/select_from_array.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
                 $array_of_values = [];
11 11
 
12 12
                 foreach ($values as $key => $value) {
13
-                    if (! is_null($value)) {
13
+                    if (!is_null($value)) {
14 14
                         $array_of_values[] = $column['options'][$value];
15 15
                     } else {
16 16
                         echo '-';
Please login to merge, or discard this patch.
src/app/Models/Traits/CrudTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             //check if column exists in database
73 73
             $conn->getDoctrineColumn($table, $column_name);
74 74
 
75
-            return ! $conn->getDoctrineColumn($table, $column_name)->getNotnull();
75
+            return !$conn->getDoctrineColumn($table, $column_name)->getNotnull();
76 76
         } catch (Exception $e) {
77 77
             return true;
78 78
         }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     public function addFakes($columns = ['extras'])
93 93
     {
94 94
         foreach ($columns as $key => $column) {
95
-            if (! isset($this->attributes[$column])) {
95
+            if (!isset($this->attributes[$column])) {
96 96
                 continue;
97 97
             }
98 98
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function shouldDecodeFake($column)
143 143
     {
144
-        return ! in_array($column, array_keys($this->casts));
144
+        return !in_array($column, array_keys($this->casts));
145 145
     }
146 146
 
147 147
     /**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function shouldEncodeFake($column)
155 155
     {
156
-        return ! in_array($column, array_keys($this->casts));
156
+        return !in_array($column, array_keys($this->casts));
157 157
     }
158 158
 
159 159
     /*
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     public function uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path)
228 228
     {
229 229
         $request = \Request::instance();
230
-        if (! is_array($this->{$attribute_name})) {
230
+        if (!is_array($this->{$attribute_name})) {
231 231
             $attribute_value = json_decode($this->{$attribute_name}, true) ?? [];
232 232
         } else {
233 233
             $attribute_value = $this->{$attribute_name};
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         if ($files_to_clear) {
240 240
             foreach ($files_to_clear as $key => $filename) {
241 241
                 \Storage::disk($disk)->delete($filename);
242
-                $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) {
242
+                $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) {
243 243
                     return $value != $filename;
244 244
                 });
245 245
             }
Please login to merge, or discard this patch.
src/app/Http/Controllers/CrudController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
         // call the setup function inside this closure to also have the request there
29 29
         // this way, developers can use things stored in session (auth variables, etc)
30
-        $this->middleware(function ($request, $next) {
30
+        $this->middleware(function($request, $next) {
31 31
             // make a new CrudPanel object, from the one stored in Laravel's service container
32 32
             $this->crud = app()->make('crud');
33 33
             // ensure crud has the latest request
Please login to merge, or discard this patch.
tests/Unit/Http/CrudControllerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         $controller = '\Backpack\CRUD\Tests\Unit\Http\Controllers\UserCrudController';
20 20
         $app['router']->get('users/{id}/edit', "$controller@edit");
21 21
         $app['router']->put('users/{id}', "$controller@update");
22
-        $app->singleton('crud', function ($app) {
22
+        $app->singleton('crud', function($app) {
23 23
             return new CrudPanel($app);
24 24
         });
25 25
     }
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/CrudPanel.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function setRequest($request = null)
71 71
     {
72
-        if (! $request) {
72
+        if (!$request) {
73 73
             $request = \Request::instance();
74 74
         }
75 75
         $this->request = $request;
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function setModel($model_namespace)
91 91
     {
92
-        if (! class_exists($model_namespace)) {
92
+        if (!class_exists($model_namespace)) {
93 93
             throw new \Exception('The model does not exist.', 500);
94 94
         }
95 95
 
96
-        if (! method_exists($model_namespace, 'hasCrudTrait')) {
96
+        if (!method_exists($model_namespace, 'hasCrudTrait')) {
97 97
             throw new \Exception('Please use CrudTrait on the model.', 500);
98 98
         }
99 99
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $complete_route = $route.'.index';
158 158
 
159
-        if (! \Route::has($complete_route)) {
159
+        if (!\Route::has($complete_route)) {
160 160
             throw new \Exception('There are no routes for this route name.', 404);
161 161
         }
162 162
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     public function getFirstOfItsTypeInArray($type, $array)
259 259
     {
260
-        return array_first($array, function ($item) use ($type) {
260
+        return array_first($array, function($item) use ($type) {
261 261
             return $item['type'] == $type;
262 262
         });
263 263
     }
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 
275 275
     public function sync($type, $fields, $attributes)
276 276
     {
277
-        if (! empty($this->{$type})) {
278
-            $this->{$type} = array_map(function ($field) use ($fields, $attributes) {
277
+        if (!empty($this->{$type})) {
278
+            $this->{$type} = array_map(function($field) use ($fields, $attributes) {
279 279
                 if (in_array($field['name'], (array) $fields)) {
280 280
                     $field = array_merge($field, $attributes);
281 281
                 }
@@ -306,15 +306,15 @@  discard block
 block discarded – undo
306 306
     {
307 307
         $relationArray = explode('.', $relationString);
308 308
 
309
-        if (! isset($length)) {
309
+        if (!isset($length)) {
310 310
             $length = count($relationArray);
311 311
         }
312 312
 
313
-        if (! isset($model)) {
313
+        if (!isset($model)) {
314 314
             $model = $this->model;
315 315
         }
316 316
 
317
-        $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) {
317
+        $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) {
318 318
             return $obj->$method()->getRelated();
319 319
         }, $model);
320 320
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         $relation = $model->{$firstRelationName};
365 365
 
366 366
         $results = [];
367
-        if (! empty($relation)) {
367
+        if (!empty($relation)) {
368 368
             if ($relation instanceof Collection) {
369 369
                 $currentResults = $relation->toArray();
370 370
             } else {
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
             array_shift($relationArray);
375 375
 
376
-            if (! empty($relationArray)) {
376
+            if (!empty($relationArray)) {
377 377
                 foreach ($currentResults as $currentResult) {
378 378
                     $results = array_merge($results, $this->getRelationModelInstances($currentResult, implode('.', $relationArray)));
379 379
                 }
Please login to merge, or discard this patch.