Skip to content

Commit 01f3813

Browse files
authored
Update voters.rst
I think you're missing an argument here
1 parent 2a8aaae commit 01f3813

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/voters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ would look like this::
186186

187187
return match($attribute) {
188188
self::VIEW => $this->canView($post, $user),
189-
self::EDIT => $this->canEdit($post, $user),
189+
self::EDIT => $this->canEdit($post, $user, $vote),
190190
default => throw new \LogicException('This code should not be reached!')
191191
};
192192
}
@@ -202,7 +202,7 @@ would look like this::
202202
return !$post->isPrivate();
203203
}
204204

205-
private function canEdit(Post $post, User $user): bool
205+
private function canEdit(Post $post, User $user, ?Vote $vote): bool
206206
{
207207
// this assumes that the Post object has a `getAuthor()` method
208208
if ($user === $post->getAuthor()) {

0 commit comments

Comments
 (0)