Features

New Rename refactoring features in PhpStorm 2.0

Rename refactoring is one of the basic types of refactoring, and PhpStorm supports it since the early builds. This post will let you know about the new rename refactoring features available in PhpStorm 2.0!

Advanced options for renaming named entities

Rename refactoring is extended through different rename options. When you try to rename an element using rename refactoring, the element-specific options are shown in the Rename dialog.

  1. Search for references
    Available for: File
    Sometimes we need just to rename a file without renaming references to it. Disable the “Search for references” option to have only the file renamed.
  2. Rename accessors
    Available for: Field
    Enable this option and getters/setters will be renamed automatically.
  3. Rename containing file
    Available for: Class, Interface
    Usually the name of a class corresponds with the name of the containing file. Keep this option enabled to preserve this naming convention.
  4. Rename parameters in hierarchy
    Available for: Method parameter
    Enable this option to preserve the names of parameters in hierarchy.
  5. Rename inheritors
    Available for: Class, Interface
    The name of an inheritor often contains the name of its parent. This makes the code more clear. Enable this option to keep your code сlear and easy to understand.

Rename Heredoc/Nowdoc delimiters

Heredoc/Nowdoc delimiters are not kind of named entities and haven’t any references, but rename refactoring can help you quickly change label text according to PHP syntax rules.

Get PhpStorm 2.0 EAP and make your code better!