Skip to content

Commit

Permalink
Change the implicit nullable type declaration to a nullable type decl…
Browse files Browse the repository at this point in the history
  • Loading branch information
idealerror authored Dec 30, 2024
1 parent 30745de commit cea4206
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/HasTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function setTagsAttribute(string | array | ArrayAccess | Tag $tags)
public function scopeWithAllTags(
Builder $query,
string | array | ArrayAccess | Tag $tags,
string $type = null,
?string $type = null,
): Builder {
$tags = static::convertToTags($tags, $type);

Expand All @@ -105,7 +105,7 @@ public function scopeWithAllTags(
public function scopeWithAnyTags(
Builder $query,
string | array | ArrayAccess | Tag $tags,
string $type = null,
?string $type = null,
): Builder {
$tags = static::convertToTags($tags, $type);

Expand All @@ -120,7 +120,7 @@ public function scopeWithAnyTags(
public function scopeWithoutTags(
Builder $query,
string | array | ArrayAccess | Tag $tags,
string $type = null
?string $type = null
): Builder {
$tags = static::convertToTags($tags, $type);

Expand Down Expand Up @@ -159,12 +159,12 @@ public function scopeWithAnyTagsOfAnyType(Builder $query, $tags): Builder
);
}

public function tagsWithType(string $type = null): Collection
public function tagsWithType(?string $type = null): Collection
{
return $this->tags->filter(fn (Tag $tag) => $tag->type === $type);
}

public function attachTags(array | ArrayAccess | Tag $tags, string $type = null): static
public function attachTags(array | ArrayAccess | Tag $tags, ?string $type = null): static
{
$className = static::getTagClassName();

Expand Down Expand Up @@ -300,7 +300,7 @@ protected function syncTagIds($ids, string | null $type = null, $detaching = tru
}
}

public function hasTag($tag, string $type = null): bool
public function hasTag($tag, ?string $type = null): bool
{
return $this->tags
->when($type !== null, fn ($query) => $query->where('type', $type))
Expand Down

0 comments on commit cea4206

Please sign in to comment.