Increase your productivity with “Inline Variable” refactoring

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!

This blog is permanently closed.

For up-to-date information please follow to corresponding WebStorm blog or PhpStorm blog.

 
This entry was posted in Cool Feature, PhpStorm and tagged , , . Bookmark the permalink.

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

  1. hongbo says:

    very nice for saving code, it works for javascript as well :)

  2. 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:

    Use the tags in the sidebar.

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

Comments are closed.