@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | protected function assumeForeignKey($related): string |
240 | 240 | { |
241 | - return Str::snake((new $related())->getResponseKey()).'_id'; |
|
241 | + return Str::snake((new $related())->getResponseKey()) . '_id'; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | public function getOrderByDirectionParameter(): string |
381 | 381 | { |
382 | - return $this->orderByDirectionParameter ?? $this->getOrderByParameter().'desc'; |
|
382 | + return $this->orderByDirectionParameter ?? $this->getOrderByParameter() . 'desc'; |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
@@ -406,20 +406,20 @@ discard block |
||
406 | 406 | |
407 | 407 | // If have an id, then put it on the end |
408 | 408 | if ($this->getKey()) { |
409 | - $path .= '/'.$this->getKey(); |
|
409 | + $path .= '/' . $this->getKey(); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | // Stick any extra things on the end |
413 | - if (! is_null($extra)) { |
|
414 | - $path .= '/'.ltrim($extra, '/'); |
|
413 | + if (!is_null($extra)) { |
|
414 | + $path .= '/' . ltrim($extra, '/'); |
|
415 | 415 | } |
416 | 416 | |
417 | - if (! empty($query = $this->getDefaultWheres($query))) { |
|
418 | - $path .= '?'.http_build_query($this->convertBoolToString($query)); |
|
417 | + if (!empty($query = $this->getDefaultWheres($query))) { |
|
418 | + $path .= '?' . http_build_query($this->convertBoolToString($query)); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | // If there is a parentModel & not have an id (unless for nested), then prepend parentModel |
422 | - if (! is_null($this->parentModel) && (! $this->getKey() || $this->isNested())) { |
|
422 | + if (!is_null($this->parentModel) && (!$this->getKey() || $this->isNested())) { |
|
423 | 423 | return $this->parentModel->getPath($path); |
424 | 424 | } |
425 | 425 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | { |
438 | 438 | $relation = $this->{$method}(); |
439 | 439 | |
440 | - if (! $relation instanceof Relation) { |
|
440 | + if (!$relation instanceof Relation) { |
|
441 | 441 | $exception_message = is_null($relation) |
442 | 442 | ? '%s::%s must return a relationship instance, but "null" was returned. Was the "return" keyword used?' |
443 | 443 | : '%s::%s must return a relationship instance.'; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | |
450 | 450 | return tap( |
451 | 451 | $relation->getResults(), |
452 | - function ($results) use ($method) { |
|
452 | + function($results) use ($method) { |
|
453 | 453 | $this->setRelation($method, $results); |
454 | 454 | } |
455 | 455 | ); |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | $model = (new $related([], $this->parentModel))->setClient($this->getClient()); |
491 | 491 | |
492 | 492 | return (new Collection($given))->map( |
493 | - function ($attributes) use ($model, $reset) { |
|
493 | + function($attributes) use ($model, $reset) { |
|
494 | 494 | return $model->newFromBuilder($reset ? reset($attributes) : $attributes); |
495 | 495 | } |
496 | 496 | ); |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public function offsetExists($offset): bool |
597 | 597 | { |
598 | - return ! is_null($this->getAttribute($offset)); |
|
598 | + return !is_null($this->getAttribute($offset)); |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | /** |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | } |
676 | 676 | |
677 | 677 | try { |
678 | - if (! $this->isDirty()) { |
|
678 | + if (!$this->isDirty()) { |
|
679 | 679 | return true; |
680 | 680 | } |
681 | 681 | |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | */ |
721 | 721 | public function saveOrFail(): bool |
722 | 722 | { |
723 | - if (! $this->save()) { |
|
723 | + if (!$this->save()) { |
|
724 | 724 | throw new UnableToSaveException(); |
725 | 725 | } |
726 | 726 |