Increase your productivity with “Inline Variable” refactoring

nnmatveev

Hello guys,

PhpStorm 2.0 brings you several new refactorings including “Inline Variable”. This is the first refactoring from the ‘Inline…’ refactorings family.

“Inline Variable” replaces a variable with its previously assigned value and could be considered as reverse to the “Introduce Variable” refactoring which is bundled since PhpStorm 1.0.

In order to invoke the refactoring, move the cursor over the local variable to apply the refactoring to and press Ctrl+Alt+N(for Windows) or Cmd+Opt+N(for Mac).

Before

After

You can also inline variables embedded in string literals:

Before

After

Develop with pleasure!

Comments below can no longer be edited.

5 Responses to Increase your productivity with “Inline Variable” refactoring

  1. hongbo says:

    February 21, 2011

    very nice for saving code, it works for javascript as well 🙂

  2. Axel Rauschmayer says:

    February 21, 2011

    Could we have separate blogs (or at least feeds) for WebStorm and PhpStorm? I love JavaScript and WebStorm, but could not care less about PHP news.

  3. goyote says:

    February 21, 2011

    Use the tags in the sidebar.

  4. Alexey Korsun says:

    February 22, 2011

    @Axel Rauschmayer:
    Yes, we are going to separate blogs, but not right now.

  5. Axel Rauschmayer says:

    February 23, 2011

    Cool!