phptools-docs
phptools-docs copied to clipboard
Using refactor rename on parameter does not rename named arguments
Using the refactor rename feature on a parameter name does renames it in most places, but not for callers using the named argument of that parameter.
Even though I make heavy use inlay hints instead of named arguments, I also make heavy use named arguments for certain code that needs to be somewhat DSL like where I get a lot of value out of choosing which parameters to pass and which to leave as the default value. One of the main drawbacks of using named arguments is having to rename the named arguments everywhere any time you rename a parameter. Therefore if the rename refactor could rename all of them for you, that would be an amazing feature.
Thank you for pointing this out. ~~It should be easy fix.~~
This would be very nice to have. I have stopped using named parameters in php because of this not working, but I would like to be able to use them.
Thank you for reminding me.
We're updating the rename refactoring in general (there are many cases where we don't rename correctly). Then we'll be adding named parameters rename refactoring and namespace rename refactoring.