We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $item = $this->model->findOrFail($id); |
28 | 28 | |
29 | 29 | [$directInputs, $relationInputs] = $this->splitInputIntoDirectAndRelations($input); |
30 | - if($this->get('update.useDatabaseTransactions')) { |
|
30 | + if ($this->get('update.useDatabaseTransactions')) { |
|
31 | 31 | return DB::transaction(fn() => $this->updateModelAndRelations($item, $directInputs, $relationInputs)); |
32 | 32 | } |
33 | 33 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | // always have a hidden input for the entry id |
59 | - if (! array_key_exists('id', $fields)) { |
|
59 | + if (!array_key_exists('id', $fields)) { |
|
60 | 60 | $fields['id'] = [ |
61 | 61 | 'name' => $entry->getKeyName(), |
62 | 62 | 'value' => $entry->getKey(), |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | $fieldEntity = $field['entity'] ?? false; |
82 | 82 | $fakeField = $field['fake'] ?? false; |
83 | 83 | |
84 | - if ($fieldEntity && ! $fakeField) { |
|
84 | + if ($fieldEntity && !$fakeField) { |
|
85 | 85 | return $this->getModelAttributeValueFromRelationship($model, $field); |
86 | 86 | } |
87 | 87 | |
88 | 88 | if ($this->holdsMultipleInputs($field['name'])) { |
89 | - $result = array_map(function ($item) use ($model) { |
|
89 | + $result = array_map(function($item) use ($model) { |
|
90 | 90 | return $model->{$item}; |
91 | 91 | }, explode(',', $field['name'])); |
92 | 92 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | [$relatedModel, $relationMethod] = $this->getModelAndMethodFromEntity($model, $field); |
110 | 110 | |
111 | - if (! method_exists($relatedModel, $relationMethod)) { |
|
111 | + if (!method_exists($relatedModel, $relationMethod)) { |
|
112 | 112 | return $relatedModel->{$relationMethod}; |
113 | 113 | } |
114 | 114 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $model = $this->setupRelatedModelLocale($model); |
128 | 128 | // when subfields are NOT set we don't need to get any more values |
129 | 129 | // we just return the plain models as we only need the ids |
130 | - if (! isset($field['subfields'])) { |
|
130 | + if (!isset($field['subfields'])) { |
|
131 | 131 | $result->push($model); |
132 | 132 | |
133 | 133 | continue; |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | break; |
156 | 156 | case 'HasOne': |
157 | 157 | case 'MorphOne': |
158 | - if (! method_exists($relatedModel, $relationMethod)) { |
|
158 | + if (!method_exists($relatedModel, $relationMethod)) { |
|
159 | 159 | return; |
160 | 160 | } |
161 | 161 | |
162 | 162 | $model = $relatedModel->{$relationMethod}; |
163 | 163 | |
164 | - if (! $model) { |
|
164 | + if (!$model) { |
|
165 | 165 | return; |
166 | 166 | } |
167 | 167 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | $relationArray = explode('.', $relationEntity); |
244 | 244 | |
245 | - $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) { |
|
245 | + $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function($obj, $method) { |
|
246 | 246 | // if the string ends with `_id` we strip it out |
247 | 247 | $method = Str::endsWith($method, '_id') ? Str::replaceLast('_id', '', $method) : $method; |
248 | 248 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | // if the subfield name does not contain a dot we just need to check |
270 | 270 | // if it has subfields and return the result accordingly. |
271 | 271 | foreach ((array) $subfield['name'] as $name) { |
272 | - if (! Str::contains($name, '.')) { |
|
272 | + if (!Str::contains($name, '.')) { |
|
273 | 273 | // when subfields are present, $relatedModel->{$name} returns a model instance |
274 | 274 | // otherwise returns the model attribute. |
275 | 275 | if ($relatedModel->{$name}) { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | [$directInputs, $relationInputs] = $this->splitInputIntoDirectAndRelations($input); |
26 | 26 | |
27 | - if($this->get('create.useDatabaseTransactions')) { |
|
27 | + if ($this->get('create.useDatabaseTransactions')) { |
|
28 | 28 | return DB::transaction(fn() => $this->createModelAndRelations($directInputs, $relationInputs)); |
29 | 29 | } |
30 | 30 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | // - a single dimensional array: [1,2,3] |
121 | 121 | // - an array of arrays: [[1][2][3]] |
122 | 122 | // if is as single dimensional array we can only attach. |
123 | - if ($relationValues === null || ! is_multidimensional_array($relationValues)) { |
|
123 | + if ($relationValues === null || !is_multidimensional_array($relationValues)) { |
|
124 | 124 | $this->attachManyRelation($item, $relation, $relationDetails, $relationValues); |
125 | 125 | } else { |
126 | 126 | $this->createManyEntries($item, $relation, $relationMethod, $relationDetails); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | |
285 | 285 | // if column is not nullable in database, and there is no column default (null), |
286 | 286 | // we will delete the entry from the database, otherwise it will throw and ugly DB error. |
287 | - if (! $relationColumnIsNullable && $dbColumnDefault === null) { |
|
287 | + if (!$relationColumnIsNullable && $dbColumnDefault === null) { |
|
288 | 288 | return $removedEntries->lazy()->each->delete(); |
289 | 289 | } |
290 | 290 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | } |
330 | 330 | |
331 | 331 | // use the collection of sent ids to match against database ids, delete the ones not found in the submitted ids. |
332 | - if (! empty($relatedItemsSent)) { |
|
332 | + if (!empty($relatedItemsSent)) { |
|
333 | 333 | // we perform the cleanup of removed database items |
334 | 334 | $entry->{$relationMethod}()->whereNotIn($relatedModelLocalKey, $relatedItemsSent)->lazy()->each->delete(); |
335 | 335 | } |