We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | return ['name' => Str::replace(' ', '', $field)]; |
116 | 116 | } |
117 | 117 | |
118 | - if (is_array($field) && ! isset($field['name'])) { |
|
118 | + if (is_array($field) && !isset($field['name'])) { |
|
119 | 119 | abort(500, 'All fields must have their name defined'); |
120 | 120 | } |
121 | 121 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | // if there's a model defined, but no attribute |
191 | 191 | // guess an attribute using the identifiableAttribute functionality in CrudTrait |
192 | - if (isset($field['model']) && ! isset($field['attribute']) && method_exists($field['model'], 'identifiableAttribute')) { |
|
192 | + if (isset($field['model']) && !isset($field['attribute']) && method_exists($field['model'], 'identifiableAttribute')) { |
|
193 | 193 | $field['attribute'] = (new $field['model']())->identifiableAttribute(); |
194 | 194 | } |
195 | 195 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | protected function makeSureFieldHasLabel($field) |
207 | 207 | { |
208 | - if (! isset($field['label'])) { |
|
208 | + if (!isset($field['label'])) { |
|
209 | 209 | $name = str_replace(',', ' ', $field['name']); |
210 | 210 | $name = str_replace('_id', '', $name); |
211 | 211 | $field['label'] = mb_ucfirst(str_replace('_', ' ', $name)); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | protected function makeSureFieldHasType($field) |
225 | 225 | { |
226 | - if (! isset($field['type'])) { |
|
226 | + if (!isset($field['type'])) { |
|
227 | 227 | $field['type'] = isset($field['relation_type']) ? $this->inferFieldTypeFromRelationType($field['relation_type']) : $this->inferFieldTypeFromDbColumnType($field['name']); |
228 | 228 | } |
229 | 229 | |
@@ -256,16 +256,16 @@ discard block |
||
256 | 256 | */ |
257 | 257 | protected function makeSureSubfieldsHaveNecessaryAttributes($field) |
258 | 258 | { |
259 | - if (! isset($field['subfields']) || ! is_array($field['subfields'])) { |
|
259 | + if (!isset($field['subfields']) || !is_array($field['subfields'])) { |
|
260 | 260 | return $field; |
261 | 261 | } |
262 | 262 | |
263 | - if (! is_multidimensional_array($field['subfields'], true)) { |
|
263 | + if (!is_multidimensional_array($field['subfields'], true)) { |
|
264 | 264 | abort(500, 'Subfields of «'.$field['name'].'» are malformed. Make sure you provide an array of subfields.'); |
265 | 265 | } |
266 | 266 | |
267 | 267 | foreach ($field['subfields'] as $key => $subfield) { |
268 | - if (empty($subfield) || ! isset($subfield['name'])) { |
|
268 | + if (empty($subfield) || !isset($subfield['name'])) { |
|
269 | 269 | abort(500, 'A subfield of «'.$field['name'].'» is malformed. Subfield attribute name can\'t be empty.'); |
270 | 270 | } |
271 | 271 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | $subfield['parentFieldName'] = $field['name']; |
280 | 280 | |
281 | - if (! isset($field['model'])) { |
|
281 | + if (!isset($field['model'])) { |
|
282 | 282 | // we're inside a simple 'repeatable' with no model/relationship, so |
283 | 283 | // we assume all subfields are supposed to be text fields |
284 | 284 | $subfield['type'] = $subfield['type'] ?? 'text'; |
@@ -314,11 +314,11 @@ discard block |
||
314 | 314 | ]); |
315 | 315 | $pivotSelectorField = static::getPivotFieldStructure($field); |
316 | 316 | |
317 | - $pivot = Arr::where($field['subfields'], function ($item) use ($pivotSelectorField) { |
|
317 | + $pivot = Arr::where($field['subfields'], function($item) use ($pivotSelectorField) { |
|
318 | 318 | return $item['name'] === $pivotSelectorField['name']; |
319 | 319 | }); |
320 | 320 | |
321 | - if (! empty($pivot)) { |
|
321 | + if (!empty($pivot)) { |
|
322 | 322 | break; |
323 | 323 | } |
324 | 324 | |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | $entity = isset($field['baseEntity']) ? $field['baseEntity'].'.'.$field['entity'] : $field['entity']; |
332 | 332 | $relationInstance = $this->getRelationInstance(['entity' => $entity]); |
333 | 333 | |
334 | - $localKeyField = Arr::where($field['subfields'], function ($item) use ($relationInstance) { |
|
334 | + $localKeyField = Arr::where($field['subfields'], function($item) use ($relationInstance) { |
|
335 | 335 | return $item['name'] === $relationInstance->getRelated()->getKeyName(); |
336 | 336 | }); |
337 | 337 | |
338 | - if (! empty($localKeyField)) { |
|
338 | + if (!empty($localKeyField)) { |
|
339 | 339 | break; |
340 | 340 | } |
341 | 341 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | { |
361 | 361 | // if a tab was mentioned, we should enable it |
362 | 362 | if (isset($field['tab'])) { |
363 | - if (! $this->tabsEnabled()) { |
|
363 | + if (!$this->tabsEnabled()) { |
|
364 | 364 | $this->enableTabs(); |
365 | 365 | } |
366 | 366 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | // - a single dimensional array: [1,2,3] |
123 | 123 | // - an array of arrays: [[1][2][3]] |
124 | 124 | // if is as single dimensional array we can only attach. |
125 | - if ($relationValues === null || ! is_multidimensional_array($relationValues)) { |
|
125 | + if ($relationValues === null || !is_multidimensional_array($relationValues)) { |
|
126 | 126 | $this->attachManyRelation($item, $relation, $relationDetails, $relationValues); |
127 | 127 | } else { |
128 | 128 | $this->createManyEntries($item, $relation, $relationMethod, $relationDetails); |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | // get the key name of the pivot table (usually id, but could be something else if the dev has set it in the model |
159 | 159 | $keyName = $item->{$relationMethod}[0]->pivot->getKeyName(); |
160 | 160 | $items = $item->{$relationMethod}()->withPivot($keyName)->get(); |
161 | - $items->each(function ($item) use (&$relationValues, $keyName) { |
|
161 | + $items->each(function($item) use (&$relationValues, $keyName) { |
|
162 | 162 | if ($item->pivot) { |
163 | 163 | $keys = array_column($relationValues, $keyName); |
164 | 164 | $key = $item->pivot->{$keyName}; |
165 | - if (! in_array((int) $key, $keys)) { |
|
165 | + if (!in_array((int) $key, $keys)) { |
|
166 | 166 | $item->pivot->delete(); |
167 | 167 | } else { |
168 | 168 | $index = array_search($key, $keys); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | // if column is not nullable in database, and there is no column default (null), |
318 | 318 | // we will delete the entry from the database, otherwise it will throw and ugly DB error. |
319 | - if (! $relationColumnIsNullable && $dbColumnDefault === null) { |
|
319 | + if (!$relationColumnIsNullable && $dbColumnDefault === null) { |
|
320 | 320 | return $removedEntries->lazy()->each->delete(); |
321 | 321 | } |
322 | 322 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | } |
362 | 362 | |
363 | 363 | // use the collection of sent ids to match against database ids, delete the ones not found in the submitted ids. |
364 | - if (! empty($relatedItemsSent)) { |
|
364 | + if (!empty($relatedItemsSent)) { |
|
365 | 365 | // we perform the cleanup of removed database items |
366 | 366 | $entry->{$relationMethod}()->whereNotIn($relatedModelLocalKey, $relatedItemsSent)->lazy()->each->delete(); |
367 | 367 | } |