We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function setModel($model_namespace) |
104 | 104 | { |
105 | - if (! class_exists($model_namespace)) { |
|
105 | + if (!class_exists($model_namespace)) { |
|
106 | 106 | throw new \Exception('The model does not exist.', 500); |
107 | 107 | } |
108 | 108 | |
109 | - if (! method_exists($model_namespace, 'hasCrudTrait')) { |
|
109 | + if (!method_exists($model_namespace, 'hasCrudTrait')) { |
|
110 | 110 | throw new \Exception('Please use CrudTrait on the model.', 500); |
111 | 111 | } |
112 | 112 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | { |
196 | 196 | $complete_route = $route.'.index'; |
197 | 197 | |
198 | - if (! \Route::has($complete_route)) { |
|
198 | + if (!\Route::has($complete_route)) { |
|
199 | 199 | throw new \Exception('There are no routes for this route name.', 404); |
200 | 200 | } |
201 | 201 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | */ |
294 | 294 | public function getFirstOfItsTypeInArray($type, $array) |
295 | 295 | { |
296 | - return Arr::first($array, function ($item) use ($type) { |
|
296 | + return Arr::first($array, function($item) use ($type) { |
|
297 | 297 | return $item['type'] == $type; |
298 | 298 | }); |
299 | 299 | } |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | |
311 | 311 | public function sync($type, $fields, $attributes) |
312 | 312 | { |
313 | - if (! empty($this->{$type})) { |
|
314 | - $this->{$type} = array_map(function ($field) use ($fields, $attributes) { |
|
313 | + if (!empty($this->{$type})) { |
|
314 | + $this->{$type} = array_map(function($field) use ($fields, $attributes) { |
|
315 | 315 | if (in_array($field['name'], (array) $fields)) { |
316 | 316 | $field = array_merge($field, $attributes); |
317 | 317 | } |
@@ -341,15 +341,15 @@ discard block |
||
341 | 341 | { |
342 | 342 | $relationArray = explode('.', $relationString); |
343 | 343 | |
344 | - if (! isset($length)) { |
|
344 | + if (!isset($length)) { |
|
345 | 345 | $length = count($relationArray); |
346 | 346 | } |
347 | 347 | |
348 | - if (! isset($model)) { |
|
348 | + if (!isset($model)) { |
|
349 | 349 | $model = $this->model; |
350 | 350 | } |
351 | 351 | |
352 | - $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) { |
|
352 | + $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) { |
|
353 | 353 | try { |
354 | 354 | $result = $obj->$method(); |
355 | 355 | |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | if (is_array($entries)) { |
385 | 385 | //if attribute does not exist in main array we have more than one entry OR the attribute |
386 | 386 | //is an acessor that is not in $appends property of model. |
387 | - if (! isset($entries[$attribute])) { |
|
387 | + if (!isset($entries[$attribute])) { |
|
388 | 388 | //we first check if we don't have the attribute because it's an acessor that is not in appends. |
389 | 389 | if ($model_instance->hasGetMutator($attribute) && isset($entries[$modelKey])) { |
390 | 390 | $entry_in_database = $model_instance->find($entries[$modelKey]); |
@@ -423,21 +423,21 @@ discard block |
||
423 | 423 | */ |
424 | 424 | public function parseTranslatableAttributes($model, $attribute, $value) |
425 | 425 | { |
426 | - if (! method_exists($model, 'isTranslatableAttribute')) { |
|
426 | + if (!method_exists($model, 'isTranslatableAttribute')) { |
|
427 | 427 | return $value; |
428 | 428 | } |
429 | 429 | |
430 | - if (! $model->isTranslatableAttribute($attribute)) { |
|
430 | + if (!$model->isTranslatableAttribute($attribute)) { |
|
431 | 431 | return $value; |
432 | 432 | } |
433 | 433 | |
434 | - if (! is_array($value)) { |
|
434 | + if (!is_array($value)) { |
|
435 | 435 | $decodedAttribute = json_decode($value, true); |
436 | 436 | } else { |
437 | 437 | $decodedAttribute = $value; |
438 | 438 | } |
439 | 439 | |
440 | - if (is_array($decodedAttribute) && ! empty($decodedAttribute)) { |
|
440 | + if (is_array($decodedAttribute) && !empty($decodedAttribute)) { |
|
441 | 441 | if (isset($decodedAttribute[app()->getLocale()])) { |
442 | 442 | return $decodedAttribute[app()->getLocale()]; |
443 | 443 | } else { |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $relation = $model->{$firstRelationName}; |
464 | 464 | |
465 | 465 | $results = []; |
466 | - if (! is_null($relation)) { |
|
466 | + if (!is_null($relation)) { |
|
467 | 467 | if ($relation instanceof Collection) { |
468 | 468 | $currentResults = $relation->all(); |
469 | 469 | } elseif (is_array($relation)) { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | |
477 | 477 | array_shift($relationArray); |
478 | 478 | |
479 | - if (! empty($relationArray)) { |
|
479 | + if (!empty($relationArray)) { |
|
480 | 480 | foreach ($currentResults as $currentResult) { |
481 | 481 | $results = array_merge_recursive($results, $this->getRelatedEntries($currentResult, implode('.', $relationArray))); |
482 | 482 | } |