Description
Symfony version(s) affected: 5.1
Description
Previously in 5.0 there were no services tagged with routing.expression_language_provider
so the issue did not arise. There is in 5.1 so the issue can occur.
addExpressionLanguageProvider
is not part of the router interface. As such AddExpressionLanguageProvidersPass
should not use it if the router does not support it as the router could be replaced with a custom router that does not support the function.
How to reproduce
Example ezplatform replaces the router.default with its own router which does not implement addExpressionLanguageProvider
nor should it have to if it is not part of the interface.
Possible Solution
Check it router supports addExpressionLanguageProvider
first.
Make addExpressionLanguageProvider
part of the router interface.
Apply to router.default
instead of router
and stipulate route.default
has to be the symfony router or extended class.