Skip to content

Commit

Permalink
Ignore phpstan is_null error
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Jul 13, 2024
1 parent e2266cb commit 186b695
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/AddTagSubscriptionAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function getStateFor(Tag $tag, User $actor): TagState
// If $tag->state is loaded *and* null, this might be because the actor doesn't have tag-specific state
// OR because the wrong actor has been used for loading it. `$tag->stateFor()` will return the correct state.
// If it doesn't exist, it returns a dummy state with the correct actor & tag IDs.
// @phpstan-ignore-next-line ($tag->state may indeed be null)
if (!$tag->relationLoaded('state') || is_null($tag->state) || $tag->state->user_id !== $actor->id) {
$tag->setRelation('state', $tag->stateFor($actor));
}
Expand Down

0 comments on commit 186b695

Please sign in to comment.