security-acl icon indicating copy to clipboard operation
security-acl copied to clipboard

declaration incompatibility error in SF7

Open hgabka opened this issue 1 year ago • 1 comments

In the Symfony 7 security bundle the VoterInterface::vote method signature has changed and this causes the following incompatibility error in AclVoter class:

Declaration of Symfony\Component\Security\Acl\Voter\AclVoter::vote(Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, $subject, array $attributes) must be compatible with Symfony\Component\Security\Core\Authorization\Voter\VoterInterface::vote(Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, mixed $subject, array $attributes): int in /var/www/html/vendor/symfony/security-acl/Voter/AclVoter.php on line 54

The signature should be changed in AclVoter, too: public function vote(TokenInterface $token, mixed $subject, array $attributes): int

hgabka avatar Jan 11 '24 20:01 hgabka

Created a PR with the fix: https://github.com/symfony/security-acl/pull/115

hgabka avatar Jan 12 '24 09:01 hgabka