Closed
Description
Hi,
It seems the explanation about the priority for a new custom argument resolver is not valid .(https://symfony.com/doc/current/controller/argument_value_resolver.html#adding-a-custom-value-resolver).
While adding a priority is optional, it's recommended to add one to make sure the expected value is injected. The RequestAttributeValueResolver has a priority of 100. As this one is responsible for fetching attributes from the Request, it's recommended to trigger your custom value resolver with a lower priority. This makes sure the argument resolvers are not triggered when the attribute is present. For instance, when passing the user along a sub-requests.
If a create a new ArgumentResolver which in charge to resolve an argument from a route placeholder, if I define the priority the 50 (like in the example), the argument is resolved by RequestAttributeValueResolver and not by mine.
If a define the priority to 255 on my ArgumentResolver, it is well used to resolve my argument.
Unlike explain in the documentation, it seems higher priority is executed before lower priority (like for event dispatcher)
Metadata
Metadata
Assignees
Labels
A Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.