Open michnovka opened 1 year ago
Probably for the same reason as detected in https://github.com/Elao/PhpEnums/pull/205, since since the controller arg resolvers are added to the annotations.map file from the FrameworkExtension.
So we might need a solution like in https://github.com/Elao/PhpEnums/blob/2.x/src/Bridge/Symfony/HttpKernel/Controller/ArgumentResolver/QueryBodyBackedEnumValueResolver.php to support both interfaces depending on the version…
Ugh... thats so ugly solution with the code repetition. Cant we think of some better approach? Lets see how others handle this
That's particularly annoying to do this for the BackedEnumValueResolver
since it would not even to be used, but to trigger a deprecation for the end user to switch to the Symfony one directly…
Lets see how others handle this
AFAIK, this is the most common, efficient way 😄
Specifically for our case with BackedEnumValueResolver
, perhaps a class alias to the Symfony 6.2 resolver would be enough when available, but that would not allow to trigger our own deprecation to ask the developper to switch to the Symfony FQCN.
The thing is, I clearly doubt this was expected in https://github.com/symfony/symfony/pull/23776. The resolvers are only added to this map because they are in a **\Controller\**
ns, but there is no benefit to it and it becomes annoying now that the resolver interface changes and triggers a deprecation.
I am using 2.1.2