![]() ![]() If you have not selected anything, then you will see a drop-down list with suggestions to extract. If you select some code, PhpStorm will replace it with a new variable. ![]() Press Ctrl+Alt+V ( ⌘⌥V) on any expression and create a new variable from it. If you have an expression that’s hard to understand, it makes sense to replace the result of the expression or its parts with separate variables that are self-explanatory. To see more examples of different refactorings in PhpStorm, check out the Refactoring with PhpStorm video series by Matthew Setter. Fixed bug with ternary expression WI-55004.Fixes for inlining concatenated strings WI-49266.Proper escape variable if NOWDOC is inlined into HEREDOC WI-60084.Support inlining NOWDOC/HEREDOC variables WI-60083.Don’t allow inlining unary operations (++, –) WI-62666.Here is what else has been improved for Inline Variable: If a variable has only been used once, then you can inline it with a quick-fix by pressing Alt+Enter: If you don’t remember the refactoring name or shortcut, you can also use Ctrl+T ( ⌃T) and choose one from the list. To use this refactoring, position the caret at the redundant variable and press Ctrl+Alt+N ( ⌘⌥N on macOS). In this case, it makes sense to replace the references to the variable with the expression itself. Sometimes you may have redundant variables in the code that just add clutter and can be removed.Ī temporary variable that’s assigned as the result of a simple expression and nothing more is a good example. If there is a private method that is only used once in the code, you can press Alt+Enter on it and choose Inline method: Support arrow function/anonymous function as parameters WI-60755.Fixes for parent/self/static::f() calls WI-60752. ![]() Replace duplicate variable names inside the match arm WI-60756.Add additional parenthesis around the “new” expression WI-60753.Fix exception when attempting to inline _invoke methods WI-60745.Forbid inlining magic methods like _get/_sleep/_construct WI-60746.Don’t allow inlining methods which implements the interface abstract class method WI-60744. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |