Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

declaration incompatibility error in SF7 #114

Open
hgabka opened this issue Jan 11, 2024 · 1 comment · May be fixed by #116
Open

declaration incompatibility error in SF7 #114

hgabka opened this issue Jan 11, 2024 · 1 comment · May be fixed by #116

Comments

@hgabka
Copy link

hgabka commented Jan 11, 2024

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
Copy link
Author

hgabka commented Jan 12, 2024

Created a PR with the fix:
#115

@core23 core23 linked a pull request Feb 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant