From 78e0f91e3de6daab3a8e94b2ccf4a583b55bbe20 Mon Sep 17 00:00:00 2001 From: Ronald Marfoldi Date: Fri, 13 Feb 2026 11:20:26 +0100 Subject: [PATCH] Fix symfony/security-voter compatibility with Symfony 8 --- composer.json | 2 +- src/Security/Voter/AbstractVoter.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c561f62..245a864 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "ext-redis": "*", "ext-zend-opcache": "*", "anzusystems/contracts": "^4.0", - "anzusystems/serializer-bundle": "^5.0", + "anzusystems/serializer-bundle": "^6.0", "doctrine/dbal": "^4.0", "doctrine/lexer": "^3.0", "doctrine/orm": "^3.1", diff --git a/src/Security/Voter/AbstractVoter.php b/src/Security/Voter/AbstractVoter.php index 2cfe048..5c4753a 100644 --- a/src/Security/Voter/AbstractVoter.php +++ b/src/Security/Voter/AbstractVoter.php @@ -11,6 +11,7 @@ use AnzuSystems\Contracts\Security\Grant; use RuntimeException; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; +use Symfony\Component\Security\Core\Authorization\Voter\Vote; use Symfony\Component\Security\Core\Authorization\Voter\Voter; /** @@ -28,7 +29,7 @@ protected function supports(string $attribute, mixed $subject): bool return in_array($attribute, $this->getSupportedPermissions(), true); } - protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool + protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool { /** @var AnzuUser $user */ $user = $token->getUser();