-
Notifications
You must be signed in to change notification settings - Fork 93
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
Method MyVoter::supports() has parameter $attribute with no type specified #367
Comments
Hi, this is not a bug. Your method should be declared such as: protected function supports(string $attribute, mixed $subject): bool Same as the parent. If you widen the type by omitting the parameter type on purpose, you should say in the PHPDoc what the type is supposed to be, such as |
@ondrejmirtes Symfony 4.4 doesn't have native types set, thus I also can't use native type in But maybe I misinterpret the situation and with |
@luxemate You've left out the information about Symfony 4.4 in your issue. I'd accept a PR that adds |
@ondrejmirtes I've created a new PR and added only |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
After update from 1.1.8 to 1.3.4 all custom voters started producing an error, although Symfony's abstract Voter has type annotation for $attribute:
Consider the following simple Voter implementation:
The funny thing is it only gets upset by the
supports
method, but not thevoteOnAttribute
method.The text was updated successfully, but these errors were encountered: