From c5dceabf4b6d1d446e533ab8a5b00a7d7ce93fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Robles?= Date: Wed, 15 Feb 2023 17:21:08 +0100 Subject: [PATCH] fix types --- src/Http/JsonApiResponse.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Http/JsonApiResponse.php b/src/Http/JsonApiResponse.php index 2e01d6b..abebd33 100644 --- a/src/Http/JsonApiResponse.php +++ b/src/Http/JsonApiResponse.php @@ -60,7 +60,7 @@ public function __construct(?Request $request = null) * * @param class-string<\Illuminate\Database\Eloquent\Model>|\Illuminate\Database\Eloquent\Builder $modelOrQuery */ - public static function from($modelOrQuery): static + public static function from($modelOrQuery): self { return (new static())->using($modelOrQuery); } @@ -70,7 +70,7 @@ public static function from($modelOrQuery): static * * @param class-string<\Illuminate\Database\Eloquent\Model>|\Illuminate\Database\Eloquent\Builder $modelOrQuery */ - public function using($modelOrQuery): static + public function using($modelOrQuery): self { $this->model = is_string($modelOrQuery) ? $modelOrQuery : get_class($modelOrQuery->getModel()); @@ -116,7 +116,7 @@ protected function buildPipeline() /** * Get single resource from response. */ - public function gettingOne(): static + public function gettingOne(): self { $this->singleResourceResponse = true; @@ -126,7 +126,7 @@ public function gettingOne(): static /** * Add allowed filters and sorts to the response meta. */ - public function includeAllowedToResponse(bool|null $value = true): static + public function includeAllowedToResponse(bool|null $value = true): self { $this->includeAllowedToResponse = $value; @@ -184,7 +184,7 @@ public function toArray(): array * * @param string|array|class-string<\Illuminate\Database\Eloquent\Model> $type */ - public function forceAppend(string|array $type, array $attributes = []): static + public function forceAppend(string|array $type, array $attributes = []): self { if (is_array($type)) { $attributes = $type; @@ -204,7 +204,7 @@ public function forceAppend(string|array $type, array $attributes = []): static * * @param string|array|class-string<\Illuminate\Database\Eloquent\Model> $type */ - public function forceAppendWhen(Closure|bool $condition, string|array $type, array $attributes = []): static + public function forceAppendWhen(Closure|bool $condition, string|array $type, array $attributes = []): self { if (is_callable($condition)) { $condition = $condition(); @@ -220,7 +220,7 @@ public function forceAppendWhen(Closure|bool $condition, string|array $type, arr /** * Set response to include IDs on resource attributes. */ - public function includingIdAttributes(bool $value = true): static + public function includingIdAttributes(bool $value = true): self { config(['apiable.responses.include_ids_on_attributes' => $value]);