PhpStorm 8.0.2 Help

Inline

PhpStorm provides the following inline refactorings:

  • The Inline Variable refactoring replaces redundant variable usage with its initializer. This refactoring is opposite to Extract Variable.
  • The Inline Function/Method refactoring results in placing the method's or function's body into the body of its caller(s); the method or function is deleted. This refactoring is opposite Extract Method.

Inline variable

Php example

Before After
d836417e90_2389524794209743
d836417e330_5536168198063816

JavaScript example

Before After
d836420e90_32040724507507057
d836420e420_9055617161571407

Inline method or function

Before After
d836423e90_3554666706779217
d836423e1180_7087553040399442

To perform the inline refactoring

  1. Place the caret in the editor at the desired symbol to be inlined.
  2. Do one of the following:
    • On the main menu or on the context menu of the selection, choose Refactor | Inline .
    • Press Ctrl+Alt+N.
  3. In the Inline dialog box that corresponds to the selected symbol, confirm the inline refactoring.

See Also

Last modified: 29 January 2015