RouteCollectionBuilderToRoutingConfiguratorRector should not rename `confifgureRoutes` to `configureRouting` · Issue #500 · rectorphp/rector-symfony · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
renames the kernel's configureRoutes() method to configureRouting(). However, it looks like Symfony didn't rename the method they are looking for, so after the fixer fixes the code, this method is no longer being used.
The text was updated successfully, but these errors were encountered:
Also, the fixer doesn't fix any other usages of the RouteCollectionBuilder class. For example, if the configureRoutes() method passes its $routes argument to another method, that other method remains unfixed and still requires an instance of RouteCollectionBuilder and not a RoutingConfigurator.
Hi, could you send a faling test fixture for RouteCollectionBuilderToRoutingConfiguratorRector? That way we'll have it covered and can fix the behavior
I'm looking into this and this change comes only in Symfony 5.1: symfony/symfony#32937
It should not be used in previous version and could have changed in future versions. If that happened and Rector missed this change, it will require a new rule in particular Rector version
To reopen, please send a failing before/after test fixture to RouteCollectionBuilderToRoutingConfiguratorRectorTest so we know exactly what is being changed :)
I'm looking into this and this change comes only in Symfony 5.1: symfony/symfony#32937
It should not be used in previous version and could have changed in future versions. If that happened and Rector missed this change, it will require a new rule in particular Rector version
Maybe this PR was later reversed? Because even when looking at this file in 5.1 branch, I don't see any references to configureRouting(), but I definitely see some to configureRoutes(). Or am I confusing something?
In fact, if you look at the history of this file, you'll find that the change you referenced (Nov. 25, 2019) was overwritten a couple weeks later (Dec 13, 2019) and the method name was changed back.
I'm not sure how you decide to write these fixers, but I suppose it would be safer to work on them only when the relevant target branch tags a stable release, and to look at the relevant UPGRADE-x.y.md file first.
The following fixer:
rector-symfony/rules/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector.php
Lines 78 to 132 in a0af12a
renames the kernel's
configureRoutes()
method toconfigureRouting()
. However, it looks like Symfony didn't rename the method they are looking for, so after the fixer fixes the code, this method is no longer being used.The text was updated successfully, but these errors were encountered:
Also, the fixer doesn't fix any other usages of the
RouteCollectionBuilder
class. For example, if theconfigureRoutes()
method passes its$routes
argument to another method, that other method remains unfixed and still requires an instance ofRouteCollectionBuilder
and not aRoutingConfigurator
.Here's an example of such kernel: https://github.com/BitBagCommerce/OpenMarketplace/blob/master/src/Kernel.php.
Hi, could you send a faling test fixture for RouteCollectionBuilderToRoutingConfiguratorRector? That way we'll have it covered and can fix the behavior
I'm looking into this and this change comes only in Symfony 5.1:
symfony/symfony#32937
It should not be used in previous version and could have changed in future versions. If that happened and Rector missed this change, it will require a new rule in particular Rector version
To reopen, please send a failing before/after test fixture to RouteCollectionBuilderToRoutingConfiguratorRectorTest so we know exactly what is being changed :)
Thanks 🙏
Maybe this PR was later reversed? Because even when looking at this file in 5.1 branch, I don't see any references to
configureRouting()
, but I definitely see some toconfigureRoutes()
. Or am I confusing something?In fact, if you look at the history of this file, you'll find that the change you referenced (Nov. 25, 2019) was overwritten a couple weeks later (Dec 13, 2019) and the method name was changed back.
I'm not sure how you decide to write these fixers, but I suppose it would be safer to work on them only when the relevant target branch tags a stable release, and to look at the relevant
UPGRADE-x.y.md
file first.I see. It's possible this rule was created in that window. Thanks for investigation 👍
Could you send a PR to remove this rule then?
Please take care of this if you can. 🙏 I'm not sure when I would get to this myself.
No worries, I'll check it when I find some time