PHP Formatting Options

This page describes the options in both Options: Editor: Formatting and Project Properties: Formatting if you select the PHP language. Options: Editor: Formatting sets global options whereas Project Properties: Formatting sets project-specific options.

The Preview Window

The Preview window contains sample code that reflects changes you make in Formatting.

Categories

Tabs and Indents

Alignment

Specify which elements should be aligned after a line break.

Braces

Select where to place the braces for each type of statement listed in this dialog. Use the Format function (Alt+Shift+F) to apply the Braces settings to a PHP document. The possible brace locations are:

Blank Lines

Improves readability by setting off sections of code that are logically related according to the specified options. Select the number of blank lines to place in the listed positions. For example, "After Fields: 1" places 1 blank line after every field.

You also have the option to Group Fields Without PHP Doc. This is selected by default. When you select this option, there are no blank lines between fields that do not have PHPDoc documentation.

Spaces

In this panel, set where the IDE automatically puts whitespaces. Due to the large number of possible places to put whitespaces, the places to put whitespaces are displayed in a tree of categories. Expand a tree node to see the places under a category, or collapse a node to hide the places under a category. The categories are:

Wrapping

In this panel set the rules for the IDE to wrap lines automatically. The panel lists the possible elements before which the IDE wraps lines. For each element you can have the IDE never wrap lines, always wrap lines, or wrap lines if the statement is long (wider than the Editor window).

You can also have the IDE automatically wrap lines after opening and before closing block braces, and between statements that are typed on the same line. Both of these options are enabled by default.


Legal Notices