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 (#1647)
by Cristian
04:33
created
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/ModelTraits/SpatieTranslatable/Sluggable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $separator = $config['separator'];
49 49
         $attribute = $attribute.'->'.$this->getLocale();
50 50
 
51
-        return $query->where(function (Builder $q) use ($attribute, $slug, $separator) {
51
+        return $query->where(function(Builder $q) use ($attribute, $slug, $separator) {
52 52
             $q->where($attribute, '=', $slug)
53 53
                 ->orWhere($attribute, 'LIKE', $slug.$separator.'%')
54 54
                 // Fixes issues with Json data types in MySQL where data is sourrounded by "
Please login to merge, or discard this patch.
src/CrudUsageStats.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     private function sendUsageStats()
39 39
     {
40 40
         // only send usage stats in production
41
-        if (! $this->runningInProduction()) {
41
+        if (!$this->runningInProduction()) {
42 42
             return;
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/resources/views/columns/array_count.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 <span>
3 3
     <?php
4 4
     $array = $entry->{$column['name']};
5
-    $suffix = isset($column['suffix'])?$column['suffix']:'items';
5
+    $suffix = isset($column['suffix']) ? $column['suffix'] : 'items';
6 6
 
7 7
     // the value should be an array wether or not attribute casting is used
8 8
     if (!is_array($array)) {
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
          */
108 108
         $button = $this->buttons()->firstWhere('name', $name);
109 109
 
110
-        if (! $button) {
110
+        if (!$button) {
111 111
             abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.');
112 112
         }
113 113
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function removeButton($name, $stack = null)
130 130
     {
131
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
131
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
132 132
             return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name);
133 133
         });
134 134
     }
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 
141 141
     public function removeAllButtonsFromStack($stack)
142 142
     {
143
-        $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
143
+        $this->buttons = $this->buttons->reject(function($button) use ($stack) {
144 144
             return $button->stack == $stack;
145 145
         });
146 146
     }
147 147
 
148 148
     public function removeButtonFromStack($name, $stack)
149 149
     {
150
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
150
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
151 151
             return $button->name == $name && $button->stack == $stack;
152 152
         });
153 153
     }
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
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
      */
12 12
     public function filtersEnabled()
13 13
     {
14
-        return ! is_array($this->filters);
14
+        return !is_array($this->filters);
15 15
     }
16 16
 
17 17
     /**
@@ -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'])) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     {
161 161
         $filter = $this->filters->firstWhere('name', $name);
162 162
 
163
-        if (! $filter) {
163
+        if (!$filter) {
164 164
             abort(500, 'CRUD Filter "'.$name.'" not found. Please check the filter exists before you modify it.');
165 165
         }
166 166
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
     public function removeFilter($name)
177 177
     {
178
-        $this->filters = $this->filters->reject(function ($filter) use ($name) {
178
+        $this->filters = $this->filters->reject(function($filter) use ($name) {
179 179
             return $filter->name == $name;
180 180
         });
181 181
     }
@@ -259,16 +259,16 @@  discard block
 block discarded – undo
259 259
 
260 260
     public function checkOptionsIntegrity($options)
261 261
     {
262
-        if (! isset($options['name'])) {
262
+        if (!isset($options['name'])) {
263 263
             abort(500, 'Please make sure all your filters have names.');
264 264
         }
265
-        if (! isset($options['type'])) {
265
+        if (!isset($options['type'])) {
266 266
             abort(500, 'Please make sure all your filters have types.');
267 267
         }
268
-        if (! \View::exists('crud::filters.'.$options['type'])) {
268
+        if (!\View::exists('crud::filters.'.$options['type'])) {
269 269
             abort(500, 'No filter view named "'.$options['type'].'.blade.php" was found.');
270 270
         }
271
-        if (! isset($options['label'])) {
271
+        if (!isset($options['label'])) {
272 272
             abort(500, 'Please make sure all your filters have labels.');
273 273
         }
274 274
     }
Please login to merge, or discard this patch.
src/PanelTraits/Tabs.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function tabsDisabled()
37 37
     {
38
-        return ! $this->tabsEnabled;
38
+        return !$this->tabsEnabled;
39 39
     }
40 40
 
41 41
     public function setTabsType($type)
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
     {
117 117
         $all_fields = $this->getCurrentFields();
118 118
 
119
-        $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) {
120
-            return ! isset($value['tab']);
119
+        $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) {
120
+            return !isset($value['tab']);
121 121
         });
122 122
 
123 123
         return $fields_without_a_tab;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         if ($this->tabExists($label)) {
134 134
             $all_fields = $this->getCurrentFields();
135 135
 
136
-            $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) {
136
+            $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) {
137 137
                 return isset($value['tab']) && $value['tab'] == $label;
138 138
             });
139 139
 
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
         $fields = $this->getCurrentFields();
153 153
 
154 154
         $fields_with_tabs = collect($fields)
155
-            ->filter(function ($value, $key) {
155
+            ->filter(function($value, $key) {
156 156
                 return isset($value['tab']);
157 157
             })
158
-            ->each(function ($value, $key) use (&$tabs) {
159
-                if (! in_array($value['tab'], $tabs)) {
158
+            ->each(function($value, $key) use (&$tabs) {
159
+                if (!in_array($value['tab'], $tabs)) {
160 160
                     $tabs[] = $value['tab'];
161 161
                 }
162 162
             });
Please login to merge, or discard this patch.
src/CrudPanel.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function setModel($model_namespace)
92 92
     {
93
-        if (! class_exists($model_namespace)) {
93
+        if (!class_exists($model_namespace)) {
94 94
             throw new \Exception('The model does not exist.', 500);
95 95
         }
96 96
 
97
-        if (! method_exists($model_namespace, 'hasCrudTrait')) {
97
+        if (!method_exists($model_namespace, 'hasCrudTrait')) {
98 98
             throw new \Exception('Please use CrudTrait on the model.', 500);
99 99
         }
100 100
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     {
148 148
         $complete_route = $route.'.index';
149 149
 
150
-        if (! \Route::has($complete_route)) {
150
+        if (!\Route::has($complete_route)) {
151 151
             throw new \Exception('There are no routes for this route name.', 404);
152 152
         }
153 153
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      */
249 249
     public function getFirstOfItsTypeInArray($type, $array)
250 250
     {
251
-        return array_first($array, function ($item) use ($type) {
251
+        return array_first($array, function($item) use ($type) {
252 252
             return $item['type'] == $type;
253 253
         });
254 254
     }
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
 
266 266
     public function sync($type, $fields, $attributes)
267 267
     {
268
-        if (! empty($this->{$type})) {
269
-            $this->{$type} = array_map(function ($field) use ($fields, $attributes) {
268
+        if (!empty($this->{$type})) {
269
+            $this->{$type} = array_map(function($field) use ($fields, $attributes) {
270 270
                 if (in_array($field['name'], (array) $fields)) {
271 271
                     $field = array_merge($field, $attributes);
272 272
                 }
@@ -298,8 +298,8 @@  discard block
 block discarded – undo
298 298
                 }
299 299
             }
300 300
 
301
-            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function ($item) use ($items) {
302
-                return ! in_array($item['name'], $this->sort[$items]);
301
+            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use ($items) {
302
+                return !in_array($item['name'], $this->sort[$items]);
303 303
             }));
304 304
         }
305 305
 
@@ -328,15 +328,15 @@  discard block
 block discarded – undo
328 328
     {
329 329
         $relationArray = explode('.', $relationString);
330 330
 
331
-        if (! isset($length)) {
331
+        if (!isset($length)) {
332 332
             $length = count($relationArray);
333 333
         }
334 334
 
335
-        if (! isset($model)) {
335
+        if (!isset($model)) {
336 336
             $model = $this->model;
337 337
         }
338 338
 
339
-        $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) {
339
+        $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) {
340 340
             return $obj->$method()->getRelated();
341 341
         }, $model);
342 342
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         $relation = $model->{$firstRelationName};
387 387
 
388 388
         $results = [];
389
-        if (! empty($relation)) {
389
+        if (!empty($relation)) {
390 390
             if ($relation instanceof Collection) {
391 391
                 $currentResults = $relation->toArray();
392 392
             } else {
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 
396 396
             array_shift($relationArray);
397 397
 
398
-            if (! empty($relationArray)) {
398
+            if (!empty($relationArray)) {
399 399
                 foreach ($currentResults as $currentResult) {
400 400
                     $results = array_merge($results, $this->getRelationModelInstances($currentResult, implode('.', $relationArray)));
401 401
                 }
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
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $this->crud->hasAccessOrFail('reorder');
17 17
         $this->crud->setOperation('Reorder');
18 18
 
19
-        if (! $this->crud->isReorderEnabled()) {
19
+        if (!$this->crud->isReorderEnabled()) {
20 20
             abort(403, 'Reorder is disabled.');
21 21
         }
22 22
 
Please login to merge, or discard this patch.