We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | |
819 | 819 | public function testCreateBelongsToFake() |
820 | 820 | { |
821 | - $belongsToField = [ // select_grouped |
|
821 | + $belongsToField = [// select_grouped |
|
822 | 822 | 'label' => 'Select_grouped', |
823 | 823 | 'type' => 'select_grouped', //https://github.com/Laravel-Backpack/CRUD/issues/502 |
824 | 824 | 'name' => 'bang_relation_field', |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | 'nickname' => 'i_have_has_one', |
955 | 955 | 'profile_picture' => 'ohh my picture 1.jpg', |
956 | 956 | 'article' => 1, |
957 | - 'addresses' => [ // HasOne is tested in other test function |
|
957 | + 'addresses' => [// HasOne is tested in other test function |
|
958 | 958 | [ |
959 | 959 | 'city' => 2, |
960 | 960 | 'street' => 'test', |
@@ -1707,23 +1707,23 @@ discard block |
||
1707 | 1707 | $this->crudPanel->addField([ |
1708 | 1708 | 'name' => 'name', |
1709 | 1709 | 'events' => [ |
1710 | - 'created' => function ($entry) { |
|
1710 | + 'created' => function($entry) { |
|
1711 | 1711 | }, |
1712 | - 'creating' => function ($entry) { |
|
1712 | + 'creating' => function($entry) { |
|
1713 | 1713 | $entry->email = '[email protected]'; |
1714 | 1714 | $entry->password = Hash::make('password'); |
1715 | 1715 | }, |
1716 | - 'saving' => function ($entry) { |
|
1716 | + 'saving' => function($entry) { |
|
1717 | 1717 | }, |
1718 | - 'saved' => function ($entry) { |
|
1718 | + 'saved' => function($entry) { |
|
1719 | 1719 | }, |
1720 | - 'updating' => function ($entry) { |
|
1720 | + 'updating' => function($entry) { |
|
1721 | 1721 | }, |
1722 | - 'updated' => function ($entry) { |
|
1722 | + 'updated' => function($entry) { |
|
1723 | 1723 | }, |
1724 | - 'deleting' => function ($entry) { |
|
1724 | + 'deleting' => function($entry) { |
|
1725 | 1725 | }, |
1726 | - 'deleted' => function ($entry) { |
|
1726 | + 'deleted' => function($entry) { |
|
1727 | 1727 | }, |
1728 | 1728 | ], |
1729 | 1729 | ]); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $this->crudPanel->addColumn([ |
91 | 91 | 'name' => 'test', |
92 | 92 | 'type' => 'my_custom_type', |
93 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
93 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
94 | 94 | $query->where($column['name'], 'like', "%{$searchTerm}%"); |
95 | 95 | }, |
96 | 96 | 'tableColumn' => true, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | 'name' => 'name', |
226 | 226 | 'type' => 'text', |
227 | 227 | 'tableColumn' => true, |
228 | - 'orderLogic' => function ($query, $column, $searchTerm) { |
|
228 | + 'orderLogic' => function($query, $column, $searchTerm) { |
|
229 | 229 | $query->orderBy('name', 'asc'); |
230 | 230 | }, |
231 | 231 | ]); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 'name' => 'name', |
245 | 245 | 'type' => 'text', |
246 | 246 | 'tableColumn' => true, |
247 | - 'orderLogic' => function ($query, $column, $searchTerm) { |
|
247 | + 'orderLogic' => function($query, $column, $searchTerm) { |
|
248 | 248 | $query->orderBy('id', 'asc'); |
249 | 249 | }, |
250 | 250 | ]); |
@@ -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 |