[WIP] Create a controller argument resolver to replace the param converter #2398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to get the ball rolling at deprecating the param converter integration in favor of the framework's native argument resolvers. It's untested, it does not have 100% feature parity with the existing implementation (some of that being by design since the two systems are different), and it's kind of a Frankenbeast trying to deal with Symfony 5.4 support, but here we are.
Note, this will only support PHP 8. Considering the Sensio bundle works fine on Symfony 5.4 and Symfony 6 requires PHP 8, as well as argument resolvers having only ever supported PHP 8 attributes (
#[CurrentUser]
exists in Symfony 5.4 but has no@Annotation
declaration), I personally don't see that as an issue.The attribute and resolver design try to take inspiration from the framework's
#[MapRequestPayload]
attribute andRequestPayloadValueResolver
while only re-implementing the functionality in the existingRequestBodyParamConverter
. So the validator integration is still opt-in (whereas in the framework if the validator's injected it is always used), and this bundle's serializer bridge continues to be used.Things that have changed in the workflow:
Things that still need to be done if this is usable: