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

Test Setup Failed
Pull Request — master (#4152)
by Cristian
12:03
created
src/app/Library/CrudPanel/Traits/FakeFields.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                         if (array_key_exists($subfieldName, $requestInput) && $isSubfieldFake) {
49 49
                             $this->addCompactedField($requestInput, $subfieldName, $subFakeFieldKey);
50 50
 
51
-                            if (! in_array($subFakeFieldKey, $compactedFakeFields)) {
51
+                            if (!in_array($subFakeFieldKey, $compactedFakeFields)) {
52 52
                                 $compactedFakeFields[] = $subFakeFieldKey;
53 53
                             }
54 54
                         }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                 if (array_key_exists($fieldName, $requestInput) && $isFakeField) {
60 60
                     $this->addCompactedField($requestInput, $fieldName, $fakeFieldKey);
61 61
 
62
-                    if (! in_array($fakeFieldKey, $compactedFakeFields)) {
62
+                    if (!in_array($fakeFieldKey, $compactedFakeFields)) {
63 63
                         $compactedFakeFields[] = $fakeFieldKey;
64 64
                     }
65 65
                 }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
         // json_encode all fake_value columns if applicable in the database, so they can be properly stored and interpreted
70 70
         foreach ($compactedFakeFields as $value) {
71
-            if (! (property_exists($model, 'translatable') && in_array($value, $model->getTranslatableAttributes(), true)) && $model->shouldEncodeFake($value)) {
71
+            if (!(property_exists($model, 'translatable') && in_array($value, $model->getTranslatableAttributes(), true)) && $model->shouldEncodeFake($value)) {
72 72
                 $requestInput[$value] = json_encode($requestInput[$value]);
73 73
             }
74 74
         }
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('backpack_url')) {
3
+if (!function_exists('backpack_url')) {
4 4
     /**
5 5
      * Appends the configured backpack prefix and returns
6 6
      * the URL using the standard Laravel helpers.
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
      */
11 11
     function backpack_url($path = null, $parameters = [], $secure = null)
12 12
     {
13
-        $path = ! $path || (substr($path, 0, 1) == '/') ? $path : '/'.$path;
13
+        $path = !$path || (substr($path, 0, 1) == '/') ? $path : '/'.$path;
14 14
 
15 15
         return url(config('backpack.base.route_prefix', 'admin').$path, $parameters, $secure);
16 16
     }
17 17
 }
18 18
 
19
-if (! function_exists('backpack_authentication_column')) {
19
+if (!function_exists('backpack_authentication_column')) {
20 20
     /**
21 21
      * Return the username column name.
22 22
      * The Laravel default (and Backpack default) is 'email'.
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     }
30 30
 }
31 31
 
32
-if (! function_exists('backpack_form_input')) {
32
+if (!function_exists('backpack_form_input')) {
33 33
     /**
34 34
      * Parse the submitted input in request('form') to an usable array.
35 35
      * Joins the multiple[] fields in a single key and transform the dot notation fields into arrayed ones.
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             }
59 59
 
60 60
             if (is_null($input_arg)) {
61
-                if (! isset($result[$input_key])) {
61
+                if (!isset($result[$input_key])) {
62 62
                     $result[$input_key] = $start ? [$row['value']] : $row['value'];
63 63
                 } else {
64 64
                     array_push($result[$input_key], $row['value']);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     }
73 73
 }
74 74
 
75
-if (! function_exists('backpack_users_have_email')) {
75
+if (!function_exists('backpack_users_have_email')) {
76 76
     /**
77 77
      * Check if the email column is present on the user table.
78 78
      *
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     }
88 88
 }
89 89
 
90
-if (! function_exists('backpack_avatar_url')) {
90
+if (!function_exists('backpack_avatar_url')) {
91 91
     /**
92 92
      * Returns the avatar URL of a user.
93 93
      *
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     }
120 120
 }
121 121
 
122
-if (! function_exists('backpack_middleware')) {
122
+if (!function_exists('backpack_middleware')) {
123 123
     /**
124 124
      * Return the key of the middleware used across Backpack.
125 125
      * That middleware checks if the visitor is an admin.
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     }
134 134
 }
135 135
 
136
-if (! function_exists('backpack_guard_name')) {
136
+if (!function_exists('backpack_guard_name')) {
137 137
     /*
138 138
      * Returns the name of the guard defined
139 139
      * by the application config
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     }
145 145
 }
146 146
 
147
-if (! function_exists('backpack_auth')) {
147
+if (!function_exists('backpack_auth')) {
148 148
     /*
149 149
      * Returns the user instance if it exists
150 150
      * of the currently authenticated admin
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     }
157 157
 }
158 158
 
159
-if (! function_exists('backpack_user')) {
159
+if (!function_exists('backpack_user')) {
160 160
     /*
161 161
      * Returns back a user instance without
162 162
      * the admin guard, however allows you
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     }
169 169
 }
170 170
 
171
-if (! function_exists('mb_ucfirst')) {
171
+if (!function_exists('mb_ucfirst')) {
172 172
     /**
173 173
      * Capitalize the first letter of a string,
174 174
      * even if that string is multi-byte (non-latin alphabet).
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     }
190 190
 }
191 191
 
192
-if (! function_exists('backpack_view')) {
192
+if (!function_exists('backpack_view')) {
193 193
     /**
194 194
      * Returns a new displayable view based on the configured backpack view namespace.
195 195
      * If that view doesn't exist, it will load the one from the original theme.
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
         $returnView = $theme.$view;
210 210
 
211
-        if (! view()->exists($returnView)) {
211
+        if (!view()->exists($returnView)) {
212 212
             $returnView = $originalTheme.$view;
213 213
         }
214 214
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     }
217 217
 }
218 218
 
219
-if (! function_exists('square_brackets_to_dots')) {
219
+if (!function_exists('square_brackets_to_dots')) {
220 220
     /**
221 221
      * Turns a string from bracket-type array to dot-notation array.
222 222
      * Ex: array[0][property] turns into array.0.property.
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     }
233 233
 }
234 234
 
235
-if (! function_exists('is_countable')) {
235
+if (!function_exists('is_countable')) {
236 236
     /**
237 237
      * We need this because is_countable was only introduced in PHP 7.3,
238 238
      * and in PHP 7.2 you should check if count() argument is really countable.
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
     }
248 248
 }
249 249
 
250
-if (! function_exists('old_empty_or_null')) {
250
+if (!function_exists('old_empty_or_null')) {
251 251
     /**
252 252
      * This method is an alternative to Laravel's old() helper, which mistakenly
253 253
      * returns NULL it two cases:
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     }
280 280
 }
281 281
 
282
-if (! function_exists('is_multidimensional_array')) {
282
+if (!function_exists('is_multidimensional_array')) {
283 283
     /**
284 284
      * If any of the items inside a given array is an array, the array is considered multidimensional.
285 285
      *
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     }
299 299
 }
300 300
 
301
-if (! function_exists('backpack_pro')) {
301
+if (!function_exists('backpack_pro')) {
302 302
     /**
303 303
      * Check if the backpack/pro package is installed.
304 304
      *
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
             return true;
311 311
         }
312 312
 
313
-        if (! \Composer\InstalledVersions::isInstalled('backpack/pro')) {
313
+        if (!\Composer\InstalledVersions::isInstalled('backpack/pro')) {
314 314
             return false;
315 315
         }
316 316
 
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/FieldsProtectedMethods.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function overwriteFieldNameFromDotNotationToArray($field)
71 71
     {
72
-        if (! is_array($field['name']) && strpos($field['name'], '.') !== false) {
72
+        if (!is_array($field['name']) && strpos($field['name'], '.') !== false) {
73 73
             $entity_array = explode('.', $field['name']);
74 74
             $name_string = '';
75 75
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             return ['name' => $field];
112 112
         }
113 113
 
114
-        if (is_array($field) && ! isset($field['name'])) {
114
+        if (is_array($field) && !isset($field['name'])) {
115 115
             abort(500, 'All fields must have their name defined');
116 116
         }
117 117
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     {
177 177
         // if there's a model defined, but no attribute
178 178
         // guess an attribute using the identifiableAttribute functionality in CrudTrait
179
-        if (isset($field['model']) && ! isset($field['attribute']) && method_exists($field['model'], 'identifiableAttribute')) {
179
+        if (isset($field['model']) && !isset($field['attribute']) && method_exists($field['model'], 'identifiableAttribute')) {
180 180
             $field['attribute'] = call_user_func([(new $field['model']()), 'identifiableAttribute']);
181 181
         }
182 182
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     protected function makeSureFieldHasLabel($field)
194 194
     {
195
-        if (! isset($field['label'])) {
195
+        if (!isset($field['label'])) {
196 196
             $name = is_array($field['name']) ? $field['name'][0] : $field['name'];
197 197
             $name = str_replace('_id', '', $name);
198 198
             $field['label'] = mb_ucfirst(str_replace('_', ' ', $name));
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      */
211 211
     protected function makeSureFieldHasType($field)
212 212
     {
213
-        if (! isset($field['type'])) {
213
+        if (!isset($field['type'])) {
214 214
             $field['type'] = isset($field['relation_type']) ? $this->inferFieldTypeFromRelationType($field['relation_type']) : $this->inferFieldTypeFromDbColumnType($field['name']);
215 215
         }
216 216
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     protected function makeSureSubfieldsHaveNecessaryAttributes($field)
249 249
     {
250
-        if (! isset($field['subfields'])) {
250
+        if (!isset($field['subfields'])) {
251 251
             return $field;
252 252
         }
253 253
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 $subfield = ['name' => $subfield];
258 258
             }
259 259
 
260
-            if (! isset($field['model'])) {
260
+            if (!isset($field['model'])) {
261 261
                 // we're inside a simple 'repeatable' with no model/relationship, so
262 262
                 // we assume all subfields are supposed to be text fields
263 263
                 $subfield['type'] = $subfield['type'] ?? 'text';
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     {
309 309
         // if a tab was mentioned, we should enable it
310 310
         if (isset($field['tab'])) {
311
-            if (! $this->tabsEnabled()) {
311
+            if (!$this->tabsEnabled()) {
312 312
                 $this->enableTabs();
313 313
             }
314 314
         }
Please login to merge, or discard this patch.