Restrict Renaming a Variable to only a the current file

Sometimes PHPStorm will look throughout my project for a variable name and try to change it everywhere (using F2 to rename a variable). I'd like to only change it locally within the current file. Is there an easyway to do this without opting out of all files presented when prompted?

1
2 comments
Avatar
Liubov Melnikova

Please try Refactor > Rename with "Search for references" disabled: https://www.jetbrains.com/phpstorm/help/rename-dialogs.html

0
Avatar
Permanently deleted user

Hi Liubov,

Thanks for the reply.

The docs you link to state this doesn't work for variables, but I tried it anyway with no luck.

"                                 This check box is only available for Rename File and Rename Directory refactoring."

0

Please sign in to leave a comment.