PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Inline

Last modified: 21 September 2023

PhpStorm provides the following inline refactorings:

  • The Inline Constant refactoring replaces redundant constant usage with its initializer. This refactoring is opposite to Extract constant.

    You can opt to do any of the following:

    • Inline all occurrences of the constant, and delete the constant,

    • Inline all occurrences of the constant, and keep the constant,

    • Inline a single occurrence, and keep the constant.

  • The Inline Variable refactoring replaces redundant variable usage with its initializer. This refactoring is opposite to Extract/Introduce variable.

  • The Inline Method refactoring results in placing the method's or function's body into the body of its caller(s). This refactoring is opposite to Extract method.

    You can opt to do any of the following:

    • Inline all occurrences of the method, and delete the method,

    • Inline all occurrences of the method, and keep the method,

    • Inline a single occurrence, and keep the method.