We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -115,11 +115,11 @@ 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 | |
| 122 | - if(is_array($field['name'])) { |
|
| 122 | + if (is_array($field['name'])) { |
|
| 123 | 123 | $field['name'] = implode(',', $field['name']); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | // if there's a model defined, but no attribute |
| 195 | 195 | // guess an attribute using the identifiableAttribute functionality in CrudTrait |
| 196 | - if (isset($field['model']) && ! isset($field['attribute']) && method_exists($field['model'], 'identifiableAttribute')) { |
|
| 196 | + if (isset($field['model']) && !isset($field['attribute']) && method_exists($field['model'], 'identifiableAttribute')) { |
|
| 197 | 197 | $field['attribute'] = (new $field['model']())->identifiableAttribute(); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | protected function makeSureFieldHasLabel($field) |
| 211 | 211 | { |
| 212 | - if (! isset($field['label'])) { |
|
| 212 | + if (!isset($field['label'])) { |
|
| 213 | 213 | $name = str_replace(',', ' ', $field['name']); |
| 214 | 214 | $name = str_replace('_id', '', $name); |
| 215 | 215 | $field['label'] = mb_ucfirst(str_replace('_', ' ', $name)); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | protected function makeSureFieldHasType($field) |
| 229 | 229 | { |
| 230 | - if (! isset($field['type'])) { |
|
| 230 | + if (!isset($field['type'])) { |
|
| 231 | 231 | $field['type'] = isset($field['relation_type']) ? $this->inferFieldTypeFromRelationType($field['relation_type']) : $this->inferFieldTypeFromDbColumnType($field['name']); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -260,16 +260,16 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | protected function makeSureSubfieldsHaveNecessaryAttributes($field) |
| 262 | 262 | { |
| 263 | - if (! isset($field['subfields']) || ! is_array($field['subfields'])) { |
|
| 263 | + if (!isset($field['subfields']) || !is_array($field['subfields'])) { |
|
| 264 | 264 | return $field; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - if (! is_multidimensional_array($field['subfields'], true)) { |
|
| 267 | + if (!is_multidimensional_array($field['subfields'], true)) { |
|
| 268 | 268 | abort(500, 'Subfields of «'.$field['name'].'» are malformed. Make sure you provide an array of subfields.'); |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | foreach ($field['subfields'] as $key => $subfield) { |
| 272 | - if (empty($subfield) || ! isset($subfield['name'])) { |
|
| 272 | + if (empty($subfield) || !isset($subfield['name'])) { |
|
| 273 | 273 | abort(500, 'A subfield of «'.$field['name'].'» is malformed. Subfield attribute name can\'t be empty.'); |
| 274 | 274 | } |
| 275 | 275 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | $subfield['parentFieldName'] = $field['name']; |
| 284 | 284 | |
| 285 | - if (! isset($field['model'])) { |
|
| 285 | + if (!isset($field['model'])) { |
|
| 286 | 286 | // we're inside a simple 'repeatable' with no model/relationship, so |
| 287 | 287 | // we assume all subfields are supposed to be text fields |
| 288 | 288 | $subfield['type'] = $subfield['type'] ?? 'text'; |
@@ -309,11 +309,11 @@ discard block |
||
| 309 | 309 | case 'BelongsToMany': |
| 310 | 310 | $pivotSelectorField = static::getPivotFieldStructure($field); |
| 311 | 311 | |
| 312 | - $pivot = Arr::where($field['subfields'], function ($item) use ($pivotSelectorField) { |
|
| 312 | + $pivot = Arr::where($field['subfields'], function($item) use ($pivotSelectorField) { |
|
| 313 | 313 | return $item['name'] === $pivotSelectorField['name']; |
| 314 | 314 | }); |
| 315 | 315 | |
| 316 | - if (! empty($pivot)) { |
|
| 316 | + if (!empty($pivot)) { |
|
| 317 | 317 | break; |
| 318 | 318 | } |
| 319 | 319 | |
@@ -337,11 +337,11 @@ discard block |
||
| 337 | 337 | $entity = isset($field['baseEntity']) ? $field['baseEntity'].'.'.$field['entity'] : $field['entity']; |
| 338 | 338 | $relationInstance = $this->getRelationInstance(['entity' => $entity]); |
| 339 | 339 | |
| 340 | - $localKeyField = Arr::where($field['subfields'], function ($item) use ($relationInstance) { |
|
| 340 | + $localKeyField = Arr::where($field['subfields'], function($item) use ($relationInstance) { |
|
| 341 | 341 | return $item['name'] === $relationInstance->getRelated()->getKeyName(); |
| 342 | 342 | }); |
| 343 | 343 | |
| 344 | - if (! empty($localKeyField)) { |
|
| 344 | + if (!empty($localKeyField)) { |
|
| 345 | 345 | break; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | { |
| 367 | 367 | // if a tab was mentioned, we should enable it |
| 368 | 368 | if (isset($field['tab'])) { |
| 369 | - if (! $this->tabsEnabled()) { |
|
| 369 | + if (!$this->tabsEnabled()) { |
|
| 370 | 370 | $this->enableTabs(); |
| 371 | 371 | } |
| 372 | 372 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $name = $nameOrDefinitionArray; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if(is_array($name)) { |
|
| 59 | + if (is_array($name)) { |
|
| 60 | 60 | $name = implode(',', $name); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | public function subfields($subfields) |
| 232 | 232 | { |
| 233 | - $callAttributeMacro = ! isset($this->attributes['subfields']); |
|
| 233 | + $callAttributeMacro = !isset($this->attributes['subfields']); |
|
| 234 | 234 | $this->attributes['subfields'] = $subfields; |
| 235 | 235 | $this->attributes = $this->crud()->makeSureFieldHasNecessaryAttributes($this->attributes); |
| 236 | 236 | if ($callAttributeMacro) { |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | // append the field name to the rule name of validationMessages array. |
| 281 | 281 | // eg: ['required => 'This field is required'] |
| 282 | 282 | // will be transformed into: ['field_name.required' => 'This field is required] |
| 283 | - $this->crud()->setValidationFromArray([], array_merge(...array_map(function ($rule, $message) { |
|
| 283 | + $this->crud()->setValidationFromArray([], array_merge(...array_map(function($rule, $message) { |
|
| 284 | 284 | return [$this->attributes['name'].'.'.$rule => $message]; |
| 285 | 285 | }, array_keys($messages), $messages))); |
| 286 | 286 | |