Skip to content

Commit f382ce9

Browse files
committed
Add "Vote|null $vote" argument on method "PostVoter::voteOnAttribute()".
Fixes: - The "App\Security\PostVoter::voteOnAttribute()" method will require a new "Vote|null $vote" argument in the next major version of its parent class "Symfony\Component\Security\Core\Authorization\Voter\Voter", not defining it is deprecated.
1 parent 4b3ce93 commit f382ce9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Security/PostVoter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use App\Entity\Post;
1515
use App\Entity\User;
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
17+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
1718
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
1819

1920
/**
@@ -43,7 +44,7 @@ protected function supports(string $attribute, mixed $subject): bool
4344
/**
4445
* @param Post $post
4546
*/
46-
protected function voteOnAttribute(string $attribute, $post, TokenInterface $token): bool
47+
protected function voteOnAttribute(string $attribute, $post, TokenInterface $token, ?Vote $vote = null): bool
4748
{
4849
$user = $token->getUser();
4950

0 commit comments

Comments
 (0)