We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | */ |
97 | 97 | private function createRelationsForItem($item, $formattedRelations) |
98 | 98 | { |
99 | - if (! isset($formattedRelations['relations'])) { |
|
99 | + if (!isset($formattedRelations['relations'])) { |
|
100 | 100 | return false; |
101 | 101 | } |
102 | 102 | foreach ($formattedRelations['relations'] as $relationMethod => $relationDetails) { |
103 | - if (! isset($relationDetails['model'])) { |
|
103 | + if (!isset($relationDetails['model'])) { |
|
104 | 104 | continue; |
105 | 105 | } |
106 | 106 | $relation = $item->{$relationMethod}(); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // - a single dimensional array: [1,2,3] |
127 | 127 | // - an array of arrays: [[1][2][3]] |
128 | 128 | // if is as single dimensional array we can only attach. |
129 | - if ($relationValues === null || ! is_multidimensional_array($relationValues)) { |
|
129 | + if ($relationValues === null || !is_multidimensional_array($relationValues)) { |
|
130 | 130 | $this->attachManyRelation($item, $relation, $relationDetails, $relationValues); |
131 | 131 | } else { |
132 | 132 | $this->createManyEntries($item, $relation, $relationMethod, $relationDetails); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | return $removed_entries->delete(); |
265 | 265 | } |
266 | 266 | |
267 | - if (! $relation_column_is_nullable && $model_instance->dbColumnHasDefault($relation_foreign_key)) { |
|
267 | + if (!$relation_column_is_nullable && $model_instance->dbColumnHasDefault($relation_foreign_key)) { |
|
268 | 268 | return $removed_entries->update([$relation_foreign_key => $model_instance->getDbColumnDefault($relation_foreign_key)]); |
269 | 269 | } |
270 | 270 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $created_ids = []; |
288 | 288 | |
289 | 289 | foreach ($items as $item) { |
290 | - if (isset($item[$relation_local_key]) && ! empty($item[$relation_local_key])) { |
|
290 | + if (isset($item[$relation_local_key]) && !empty($item[$relation_local_key])) { |
|
291 | 291 | $entry->{$relationMethod}()->where($relation_local_key, $item[$relation_local_key])->update(Arr::except($item, $relation_local_key)); |
292 | 292 | } else { |
293 | 293 | $created_ids[] = $entry->{$relationMethod}()->create($item)->{$relation_local_key}; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | // get from $items the sent ids, and merge the ones created. |
298 | 298 | $relatedItemsSent = array_merge(array_filter(Arr::pluck($items, $relation_local_key)), $created_ids); |
299 | 299 | |
300 | - if (! empty($relatedItemsSent)) { |
|
300 | + if (!empty($relatedItemsSent)) { |
|
301 | 301 | // we perform the cleanup of removed database items |
302 | 302 | $entry->{$relationMethod}()->whereNotIn($relation_local_key, $relatedItemsSent)->delete(); |
303 | 303 | } |
@@ -327,12 +327,12 @@ discard block |
||
327 | 327 | $relationFields = $this->getRelationFields(); |
328 | 328 | |
329 | 329 | // exclude the already attached belongs to relations in the main entry but include nested belongs to. |
330 | - $relationFields = Arr::where($relationFields, function ($field, $key) { |
|
330 | + $relationFields = Arr::where($relationFields, function($field, $key) { |
|
331 | 331 | return $field['relation_type'] !== 'BelongsTo' || ($field['relation_type'] === 'BelongsTo' && Str::contains($field['name'], '.')); |
332 | 332 | }); |
333 | 333 | |
334 | 334 | //remove fields that are not in the submitted form input |
335 | - $relationFields = array_filter($relationFields, function ($field) use ($input) { |
|
335 | + $relationFields = array_filter($relationFields, function($field) use ($input) { |
|
336 | 336 | return Arr::has($input, $field['name']); |
337 | 337 | }); |
338 | 338 |
@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | * |
@@ -297,7 +297,7 @@ |
||
297 | 297 | |
298 | 298 | // otherwise, loop through all the possible view namespaces |
299 | 299 | // until you find a view that exists |
300 | - $paths = array_map(function ($item) use ($viewPath) { |
|
300 | + $paths = array_map(function($item) use ($viewPath) { |
|
301 | 301 | return $item.'.'.$viewPath; |
302 | 302 | }, config('backpack.crud.view_namespaces.fields')); |
303 | 303 |