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

Closed
hgabka opened this issue Jan 11, 2024 · 1 comment
Closed

declaration incompatibility error in SF7 #114

hgabka opened this issue Jan 11, 2024 · 1 comment

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

fabpot added a commit that referenced this issue Oct 18, 2024
This PR was merged into the 3.x-dev branch.

Discussion
----------

Fix Symfony 7 compatibility

Continuation of #116

I want to see what is failing to fix it.

Might close: #112 #115 #114 #121

Commits
-------

17f2255 Actualizar AclVoter.php
29379e6 fix cs issues
c4c7ca0 suppress psalm since it is not fixable
1247ccb Fix tests
8647e14 Fix symfony 7 compatibility
@fabpot fabpot closed this as completed Oct 18, 2024
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.

2 participants