Using Postfix Templates
Postfix code completion lets you transform an already typed expression to another one based on the postfix you type after a dot, the type of the expression, and its context.
This transformation is performed by expanding the postfix-specific predefined template. For example, the
.if postfix applied to a boolean expression wraps it with an
See more at: http://blog.jetbrains.com/idea/2014/03/postfix-completion/#sthash.mI1AHa17.dpuf.
Activating and de-activating postfix templates
When the postfix template functionality is enabled, PhpStorm transforms expressions with postfixes into other expressions by expanding the corresponding postfix-specific templates.
To activate the postfix templates functionality:
Open the Settings / Preferences Dialog by choosing for Windows and Unix or
for OS X.
Expand the Editor node, and then
click Postfix under General.
The Editor: Postfix Completion page that opens shows a list of postfixes for which PhpStorm can transform expressions according to postfix-specific templates. Transformation templates are shown next to corresponding postfixes. When you select a postfix, the Description pane illustrates the corresponding transformation showing the code snippet before and after the template is expanded.
- Select the Enable postfix templates check box and choose the key to launch template expansion from the Expand template with drop-down list.
- Select the check boxes next to the postfixes for which you want PhpStorm to expand the corresponding templates.
To suppress expanding a template, clear the check box nex to the corresponding postfix. To block the postfix templates functionality, clear the Enable postfix templates check box.
Using postfix templates
To apply a postfix template, type your code followed by a dot, then type the desired postfix, and press the key that is appointed for template expansion on the Postfix Templates page of the editor settings.