Skip to content

Commit c25d2ca

Browse files
committed
Added new ?Vote $vote = null parameter to IsUserHimselfVoter service to fix future deprecation
1 parent f1d1bb4 commit c25d2ca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Security/Voter/IsUserHimselfVoter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use App\Security\SecurityUser;
1313
use Override;
1414
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
15+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
1516
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
1617

1718
/**
@@ -40,8 +41,12 @@ protected function supports(string $attribute, mixed $subject): bool
4041
* {@inheritdoc}
4142
*/
4243
#[Override]
43-
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
44-
{
44+
protected function voteOnAttribute(
45+
string $attribute,
46+
mixed $subject,
47+
TokenInterface $token,
48+
?Vote $vote = null,
49+
): bool {
4550
$user = $token->getUser();
4651

4752
return $user instanceof SecurityUser && $subject instanceof User && $user->getUuid() === $subject->getId();

0 commit comments

Comments
 (0)