Skip to content

Commit

Permalink
fix: phpstan error
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Jan 31, 2024
1 parent a322750 commit 6e52663
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Access/PollPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function seeVoteCount(User $actor, Poll $poll)
return $this->deny();
}

if ($poll->myVotes($actor)->count() || $actor->can('polls.viewResultsWithoutVoting', $poll->post ? $poll->post->discussion : null)) {
if ($poll->myVotes($actor)->count() || $actor->can('polls.viewResultsWithoutVoting', $poll->post !== null ? $poll->post->discussion : null)) {
return $this->allow();
}
}
Expand All @@ -48,7 +48,7 @@ public function view(User $actor, Poll $poll)

public function vote(User $actor, Poll $poll)
{
if ($actor->can('polls.vote', $poll->post ? $poll->post->discussion : null) && !$poll->hasEnded()) {
if ($actor->can('polls.vote', $poll->post !== null ? $poll->post->discussion : null) && !$poll->hasEnded()) {
return $this->allow();
}
}
Expand All @@ -62,7 +62,7 @@ public function changeVote(User $actor, Poll $poll)

public function edit(User $actor, Poll $poll)
{
if ($actor->can('polls.moderate', $poll->post ? $poll->post->discussion : null)) {
if ($actor->can('polls.moderate', $poll->post !== null ? $poll->post->discussion : null)) {
return $this->allow();
}

Expand Down

0 comments on commit 6e52663

Please sign in to comment.