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 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $relation = $model->{$firstRelationName}; |
376 | 376 | |
377 | 377 | $results = []; |
378 | - if (! empty($relation)) { |
|
378 | + if (!empty($relation)) { |
|
379 | 379 | if ($relation instanceof Collection) { |
380 | 380 | $currentResults = $relation->toArray(); |
381 | 381 | } else { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | |
385 | 385 | array_shift($relationArray); |
386 | 386 | |
387 | - if (! empty($relationArray)) { |
|
387 | + if (!empty($relationArray)) { |
|
388 | 388 | foreach ($currentResults as $currentResult) { |
389 | 389 | $results = array_merge($results, $this->getRelationModelInstances($currentResult, implode('.', $relationArray))); |
390 | 390 | } |