Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Feb 15, 2023
1 parent 215a866 commit c5dceab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Http/JsonApiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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());

Expand Down Expand Up @@ -116,7 +116,7 @@ protected function buildPipeline()
/**
* Get single resource from response.
*/
public function gettingOne(): static
public function gettingOne(): self
{
$this->singleResourceResponse = true;

Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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();
Expand All @@ -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]);

Expand Down

0 comments on commit c5dceab

Please sign in to comment.