From 6e52663cfd7df2c764fa411c6b8d3103d30397f1 Mon Sep 17 00:00:00 2001 From: IanM Date: Wed, 31 Jan 2024 16:45:33 +0000 Subject: [PATCH] fix: phpstan error --- src/Access/PollPolicy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Access/PollPolicy.php b/src/Access/PollPolicy.php index 58ab45a9..b58e9dfc 100644 --- a/src/Access/PollPolicy.php +++ b/src/Access/PollPolicy.php @@ -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(); } } @@ -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(); } } @@ -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(); }