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 (#1504)
by Thomas
07:11 queued 03:32
created
src/PanelTraits/Filters.php 1 patch
Spacing   +7 added lines, -7 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'])) {
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
     public function removeFilter($name)
139 139
     {
140
-        $this->filters = $this->filters->reject(function ($filter) use ($name) {
140
+        $this->filters = $this->filters->reject(function($filter) use ($name) {
141 141
             return $filter->name == $name;
142 142
         });
143 143
     }
@@ -221,16 +221,16 @@  discard block
 block discarded – undo
221 221
 
222 222
     public function checkOptionsIntegrity($options)
223 223
     {
224
-        if (! isset($options['name'])) {
224
+        if (!isset($options['name'])) {
225 225
             abort(500, 'Please make sure all your filters have names.');
226 226
         }
227
-        if (! isset($options['type'])) {
227
+        if (!isset($options['type'])) {
228 228
             abort(500, 'Please make sure all your filters have types.');
229 229
         }
230
-        if (! \View::exists('crud::filters.'.$options['type'])) {
230
+        if (!\View::exists('crud::filters.'.$options['type'])) {
231 231
             abort(500, 'No filter view named "'.$options['type'].'.blade.php" was found.');
232 232
         }
233
-        if (! isset($options['label'])) {
233
+        if (!isset($options['label'])) {
234 234
             abort(500, 'Please make sure all your filters have labels.');
235 235
         }
236 236
     }
Please login to merge, or discard this patch.
src/app/Console/Commands/Install.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
                     $this->executeProcess('mkdir -p public/uploads');
54 54
                     break;
55 55
                 case '\\': // windows
56
-                    if (! file_exists('public\uploads')) {
56
+                    if (!file_exists('public\uploads')) {
57 57
                         $this->executeProcess('mkdir public\uploads');
58 58
                     }
59 59
                     break;
Please login to merge, or discard this patch.
src/PanelTraits/Fields.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
 
27 27
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
28 28
         // defined in the main model
29
-        if (isset($completeFieldsArray['entity']) && ! isset($completeFieldsArray['model'])) {
29
+        if (isset($completeFieldsArray['entity']) && !isset($completeFieldsArray['model'])) {
30 30
             $completeFieldsArray['model'] = $this->getRelationModel($completeFieldsArray['entity']);
31 31
         }
32 32
 
33 33
         // if the label is missing, we should set it
34
-        if (! isset($completeFieldsArray['label'])) {
34
+        if (!isset($completeFieldsArray['label'])) {
35 35
             $completeFieldsArray['label'] = ucfirst($completeFieldsArray['name']);
36 36
         }
37 37
 
38 38
         // if the field type is missing, we should set it
39
-        if (! isset($completeFieldsArray['type'])) {
39
+        if (!isset($completeFieldsArray['type'])) {
40 40
             $completeFieldsArray['type'] = $this->getFieldTypeFromDbColumnType($completeFieldsArray['name']);
41 41
         }
42 42
 
43 43
         // if a tab was mentioned, we should enable it
44 44
         if (isset($completeFieldsArray['tab'])) {
45
-            if (! $this->tabsEnabled()) {
45
+            if (!$this->tabsEnabled()) {
46 46
                 $this->enableTabs();
47 47
             }
48 48
         }
49 49
 
50
-        $this->transformFields($form, function ($fields) use ($completeFieldsArray) {
50
+        $this->transformFields($form, function($fields) use ($completeFieldsArray) {
51 51
             $fields[$completeFieldsArray['name']] = $completeFieldsArray;
52 52
 
53 53
             return $fields;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function afterField($targetFieldName, $form = 'both')
81 81
     {
82
-        $this->transformFields($form, function ($fields) use ($targetFieldName) {
82
+        $this->transformFields($form, function($fields) use ($targetFieldName) {
83 83
             return $this->moveField($fields, $targetFieldName, false);
84 84
         });
85 85
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function beforeField($targetFieldName, $form = 'both')
94 94
     {
95
-        $this->transformFields($form, function ($fields) use ($targetFieldName) {
95
+        $this->transformFields($form, function($fields) use ($targetFieldName) {
96 96
             return $this->moveField($fields, $targetFieldName, true);
97 97
         });
98 98
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function removeField($name, $form = 'both')
136 136
     {
137
-        $this->transformFields($form, function ($fields) use ($name) {
137
+        $this->transformFields($form, function($fields) use ($name) {
138 138
             array_forget($fields, $name);
139 139
 
140 140
             return $fields;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function removeFields($array_of_names, $form = 'both')
151 151
     {
152
-        if (! empty($array_of_names)) {
152
+        if (!empty($array_of_names)) {
153 153
             foreach ($array_of_names as $name) {
154 154
                 $this->removeField($name, $form);
155 155
             }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     public function removeAllFields($form = 'both')
165 165
     {
166 166
         $current_fields = $this->getCurrentFields();
167
-        if (! empty($current_fields)) {
167
+        if (!empty($current_fields)) {
168 168
             foreach ($current_fields as $field) {
169 169
                 $this->removeField($field['name'], $form);
170 170
             }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                 $jsonCastables = ['array', 'object', 'json'];
228 228
                 $fieldCasting = $casted_attributes[$field['name']];
229 229
 
230
-                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) {
230
+                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) {
231 231
                     try {
232 232
                         $data[$field['name']] = json_decode($data[$field['name']]);
233 233
                     } catch (\Exception $e) {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      */
259 259
     public function orderFields($order, $form = 'both')
260 260
     {
261
-        $this->transformFields($form, function ($fields) use ($order) {
261
+        $this->transformFields($form, function($fields) use ($order) {
262 262
             return $this->applyOrderToFields($fields, $order);
263 263
         });
264 264
     }
Please login to merge, or discard this patch.
src/app/Console/Commands/Publish.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $sourceFile = $this->sourcePath.$file.'.blade.php';
74 74
         $copiedFile = $this->destinationPath.$file.'.blade.php';
75 75
 
76
-        if (! file_exists($sourceFile)) {
76
+        if (!file_exists($sourceFile)) {
77 77
             return $this->error(
78 78
                 'Cannot find source view file at '
79 79
                 .$sourceFile.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             if ($canCopy) {
94 94
                 $path = pathinfo($copiedFile);
95 95
 
96
-                if (! file_exists($path['dirname'])) {
96
+                if (!file_exists($path['dirname'])) {
97 97
                     mkdir($path['dirname'], 0755, true);
98 98
                 }
99 99
 
Please login to merge, or discard this patch.
src/PanelTraits/Search.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function applySearchTerm($searchTerm)
21 21
     {
22
-        return $this->query->where(function ($query) use ($searchTerm) {
22
+        return $this->query->where(function($query) use ($searchTerm) {
23 23
             foreach ($this->getColumns() as $column) {
24
-                if (! isset($column['type'])) {
24
+                if (!isset($column['type'])) {
25 25
                     abort(400, 'Missing column type when trying to apply search term.');
26 26
                 }
27 27
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
                 case 'select':
62 62
                 case 'select_multiple':
63
-                    $query->orWhereHas($column['entity'], function ($q) use ($column, $searchTerm) {
63
+                    $query->orWhereHas($column['entity'], function($q) use ($column, $searchTerm) {
64 64
                         $q->where($column['attribute'], 'like', '%'.$searchTerm.'%');
65 65
                     });
66 66
                     break;
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     private function renderCellView($view, $column, $entry, $rowNumber = false)
179 179
     {
180
-        if (! view()->exists($view)) {
180
+        if (!view()->exists($view)) {
181 181
             $view = 'crud::columns.text'; // fallback to text column
182 182
         }
183 183
 
Please login to merge, or discard this patch.
src/PanelTraits/Columns.php 1 patch
Spacing   +15 added lines, -16 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function addColumn($column)
65 65
     {
66 66
         // if a string was passed, not an array, change it to an array
67
-        if (! is_array($column)) {
67
+        if (!is_array($column)) {
68 68
             $column = ['name' => $column];
69 69
         }
70 70
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $column_with_details = $this->addDefaultLabel($column);
73 73
 
74 74
         // make sure the column has a name
75
-        if (! array_key_exists('name', $column_with_details)) {
75
+        if (!array_key_exists('name', $column_with_details)) {
76 76
             $column_with_details['name'] = 'anonymous_column_'.str_random(5);
77 77
         }
78 78
 
@@ -80,27 +80,27 @@  discard block
 block discarded – undo
80 80
         $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']);
81 81
 
82 82
         // make sure the column has a type
83
-        if (! array_key_exists('type', $column_with_details)) {
83
+        if (!array_key_exists('type', $column_with_details)) {
84 84
             $column_with_details['type'] = 'text';
85 85
         }
86 86
 
87 87
         // make sure the column has a key
88
-        if (! array_key_exists('key', $column_with_details)) {
88
+        if (!array_key_exists('key', $column_with_details)) {
89 89
             $column_with_details['key'] = $column_with_details['name'];
90 90
         }
91 91
 
92 92
         // make sure the column has a tableColumn boolean
93
-        if (! array_key_exists('tableColumn', $column_with_details)) {
93
+        if (!array_key_exists('tableColumn', $column_with_details)) {
94 94
             $column_with_details['tableColumn'] = $columnExistsInDb ? true : false;
95 95
         }
96 96
 
97 97
         // make sure the column has a orderable boolean
98
-        if (! array_key_exists('orderable', $column_with_details)) {
98
+        if (!array_key_exists('orderable', $column_with_details)) {
99 99
             $column_with_details['orderable'] = $columnExistsInDb ? true : false;
100 100
         }
101 101
 
102 102
         // make sure the column has a searchLogic
103
-        if (! array_key_exists('searchLogic', $column_with_details)) {
103
+        if (!array_key_exists('searchLogic', $column_with_details)) {
104 104
             $column_with_details['searchLogic'] = $columnExistsInDb ? true : false;
105 105
         }
106 106
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
110 110
         // defined in the main model
111
-        if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) {
111
+        if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) {
112 112
             $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']);
113 113
         }
114 114
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function makeFirstColumn()
156 156
     {
157
-        if (! $this->columns) {
157
+        if (!$this->columns) {
158 158
             return false;
159 159
         }
160 160
 
@@ -175,8 +175,7 @@  discard block
 block discarded – undo
175 175
         $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn;
176 176
 
177 177
         if (array_key_exists($targetColumnName, $this->columns)) {
178
-            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) :
179
-                array_search($targetColumnName, array_keys($this->columns)) + 1;
178
+            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1;
180 179
 
181 180
             $element = array_pop($this->columns);
182 181
             $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true);
@@ -210,7 +209,7 @@  discard block
 block discarded – undo
210 209
      */
211 210
     public function addDefaultLabel($array)
212 211
     {
213
-        if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
212
+        if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
214 213
             $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array);
215 214
 
216 215
             return $array;
@@ -236,7 +235,7 @@  discard block
 block discarded – undo
236 235
      */
237 236
     public function removeColumns($columns)
238 237
     {
239
-        if (! empty($columns)) {
238
+        if (!empty($columns)) {
240 239
             foreach ($columns as $columnName) {
241 240
                 $this->removeColumn($columnName);
242 241
             }
@@ -257,8 +256,8 @@  discard block
 block discarded – undo
257 256
      */
258 257
     public function remove($entity, $fields)
259 258
     {
260
-        return array_values(array_filter($this->{$entity}, function ($field) use ($fields) {
261
-            return ! in_array($field['name'], (array) $fields);
259
+        return array_values(array_filter($this->{$entity}, function($field) use ($fields) {
260
+            return !in_array($field['name'], (array) $fields);
262 261
         }));
263 262
     }
264 263
 
@@ -303,7 +302,7 @@  discard block
 block discarded – undo
303 302
     {
304 303
         $columns = $this->getColumns();
305 304
 
306
-        return collect($columns)->pluck('entity')->reject(function ($value, $key) {
305
+        return collect($columns)->pluck('entity')->reject(function($value, $key) {
307 306
             return $value == null;
308 307
         })->toArray();
309 308
     }
Please login to merge, or discard this patch.