We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function setModel($model_namespace) |
102 | 102 | { |
103 | - if (! class_exists($model_namespace)) { |
|
103 | + if (!class_exists($model_namespace)) { |
|
104 | 104 | throw new \Exception('The model does not exist.', 500); |
105 | 105 | } |
106 | 106 | |
107 | - if (! method_exists($model_namespace, 'hasCrudTrait')) { |
|
107 | + if (!method_exists($model_namespace, 'hasCrudTrait')) { |
|
108 | 108 | throw new \Exception('Please use CrudTrait on the model.', 500); |
109 | 109 | } |
110 | 110 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | { |
168 | 168 | $complete_route = $route.'.index'; |
169 | 169 | |
170 | - if (! \Route::has($complete_route)) { |
|
170 | + if (!\Route::has($complete_route)) { |
|
171 | 171 | throw new \Exception('There are no routes for this route name.', 404); |
172 | 172 | } |
173 | 173 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function getFirstOfItsTypeInArray($type, $array) |
270 | 270 | { |
271 | - return Arr::first($array, function ($item) use ($type) { |
|
271 | + return Arr::first($array, function($item) use ($type) { |
|
272 | 272 | return $item['type'] == $type; |
273 | 273 | }); |
274 | 274 | } |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | |
286 | 286 | public function sync($type, $fields, $attributes) |
287 | 287 | { |
288 | - if (! empty($this->{$type})) { |
|
289 | - $this->{$type} = array_map(function ($field) use ($fields, $attributes) { |
|
288 | + if (!empty($this->{$type})) { |
|
289 | + $this->{$type} = array_map(function($field) use ($fields, $attributes) { |
|
290 | 290 | if (in_array($field['name'], (array) $fields)) { |
291 | 291 | $field = array_merge($field, $attributes); |
292 | 292 | } |
@@ -317,15 +317,15 @@ discard block |
||
317 | 317 | { |
318 | 318 | $relationArray = explode('.', $relationString); |
319 | 319 | |
320 | - if (! isset($length)) { |
|
320 | + if (!isset($length)) { |
|
321 | 321 | $length = count($relationArray); |
322 | 322 | } |
323 | 323 | |
324 | - if (! isset($model)) { |
|
324 | + if (!isset($model)) { |
|
325 | 325 | $model = $this->model; |
326 | 326 | } |
327 | 327 | |
328 | - $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) { |
|
328 | + $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) { |
|
329 | 329 | return $obj->$method()->getRelated(); |
330 | 330 | }, $model); |
331 | 331 | |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $attributes = []; |
351 | 351 | foreach ($endModels as $model => $entries) { |
352 | 352 | $modelKey = (new $model())->getKeyName(); |
353 | - if (is_array($entries) && ! isset($entries[$attribute])) { |
|
353 | + if (is_array($entries) && !isset($entries[$attribute])) { |
|
354 | 354 | foreach ($entries as $entry) { |
355 | 355 | $attributes[$entry[$modelKey]] = $entry[$attribute]; |
356 | 356 | } |
@@ -381,21 +381,21 @@ discard block |
||
381 | 381 | $currentResults = []; |
382 | 382 | |
383 | 383 | $results = []; |
384 | - if (! is_null($relation)) { |
|
385 | - if ($relation instanceof Collection && ! $relation->isEmpty()) { |
|
384 | + if (!is_null($relation)) { |
|
385 | + if ($relation instanceof Collection && !$relation->isEmpty()) { |
|
386 | 386 | $currentResults[get_class($relation->first())] = $relation->toArray(); |
387 | - } elseif (is_array($relation) && ! empty($relation)) { |
|
387 | + } elseif (is_array($relation) && !empty($relation)) { |
|
388 | 388 | $currentResults[get_class($relation->first())] = $relation; |
389 | 389 | } else { |
390 | 390 | //relation must be App\Models\Article or App\Models\Category |
391 | - if (! $relation instanceof Collection && ! empty($relation)) { |
|
391 | + if (!$relation instanceof Collection && !empty($relation)) { |
|
392 | 392 | $currentResults[get_class($relation)] = $relation->toArray(); |
393 | 393 | } |
394 | 394 | } |
395 | 395 | |
396 | 396 | array_shift($relationArray); |
397 | 397 | |
398 | - if (! empty($relationArray)) { |
|
398 | + if (!empty($relationArray)) { |
|
399 | 399 | foreach ($currentResults as $model => $currentResult) { |
400 | 400 | $results[$model] = array_merge($results[$model], $this->getRelatedEntries($currentResult, implode('.', $relationArray))); |
401 | 401 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | } |
19 | 19 | $lastKey = array_key_last($list[$column['visible_key']]); |
20 | 20 | } |
21 | -if (! empty($column['wrapper'])) { |
|
21 | +if (!empty($column['wrapper'])) { |
|
22 | 22 | $column['wrapper']['element'] = $column['wrapper']['element'] ?? 'a'; |
23 | 23 | } |
24 | 24 |