-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle] Class name parameter is not yet resolved in AddSecurityVotersPass #23733
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
Comments
The compiler pass itself isn't an optimization pass though. I'm more curious as of why your service definition's class is a parameter reference and not a class name. |
Actually I got this error in in third party bundle. But still if it's possible to define class name as parameter then Compiler pass should handle that. |
If this feature is supported, it should probably be done as one of the first things, before all the other compiler passes run. |
The right way to solve this would be to resolve the parameter in the pass as we do in symfony/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php Line 47 in 2fed6f3
Same concern as @iltar, not sure if we should add support for this, deprecate it in the passes supporting it already or do nothing at all. |
@iltar I think we can leave AddSecurityVotersPass as it was before and add new compiler pass of type "optimization" for voters validity check. I did PR for that |
Just found a case where the class name is resolved inside the pass: symfony/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php Line 47 in d024d79
|
Yes, it's the same as @chalasr suggests, but if we follow symfony best practices, then I would say that we also should write core to follow it. I mean class name parameters are not recommended and maybe one day it will be deprecated. Having check validity compiler pass doesn't depend on class parameter parsing and it also doesn't change what worked before |
…ddSecurityVotersPass (pjarmalavicius) This PR was squashed before being merged into the 3.4 branch (closes #23862). Discussion ---------- [SecurityBundle] resolve class name parameter inside AddSecurityVotersPass | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23733 | License | MIT Commits ------- a86bf52 [SecurityBundle] resolve class name parameter inside AddSecurityVotersPass
When voter service class is parameter, it is not yet resolved while checking if it implements VoterInterface.
Maybe type of AddSecurityVotersPass should be "optimization"?
The text was updated successfully, but these errors were encountered: