
#PHPSTORM FORMAT CODE PSR CODE#
In this area, configure the code style to be applied within generated PHP documentation blocks, see PHPDoc comments. In this area, set the number of spaces for separating the tag elements. Select this checkbox to have the description elements aligned. Select this checkbox to have the $ elements aligned. Select this checkbox to have the text that exceeds the right margin wrapped to the next line. Select this checkbox to have a blank line inserted above and below the section with tags.

Select this checkbox to have a blank line inserted above the first PHPDoc tag. Select this checkbox to suppress removing blank lines automatically. If selected, each called method, which after wrapping is positioned on a new line, is aligned by the first one, which remains unwrapped. If selected, each argument in a function call which after wrapping starts on a new line, is aligned by the first argument, which remains unwrapped.

If selected, each parameter in a parameters list which after wrapping starts on a new line, is aligned by the first parameter, which remains unwrapped. The status of the checkbox affects the formatting only if you have chosen to wrap lists, if the Do not wrap option is chosen, selecting or clearing the checkbox has no effect. When the checkbox is cleared, the position of each item in a wrapped list is determined by the chosen indentation level. If selected, each item in an extends or an implements list, which after wrapping starts on a new line, is aligned by the first item, which remains unwrapped. Wrap always: select this option to have all elements in lists wrapped, so that there is one element per line with proper indentation.Ĭhop down if long: select this option to have elements in lists that go beyond the right margin wrapped, so that there is one element per line with proper indentation. Wrap if long: select this option to have lines going beyond the right margin wrapped with proper indentation. With this option selected, the nested alignment and braces settings are ignored. Before parenthesesĭo not wrap: when this option is selected, no special wrapping style is applied. Select or clear the checkboxes to have spaces inserted, not inserted, or removed in various PHP contexts. Select this checkbox to have the code enclosed in tags indented against the opening
In this field, specify the number of spaces to be inserted between the elements of an array, in expressions, method declarations and method calls. In this field, specify the number of spaces to be inserted for each indent level. In this field, specify the number of spaces included in a tab. The Smart tabs checkbox is available if the Use tab character checkbox is selected. This means that a group of spaces that fits the specified tab size is automatically replaced with a tab, which may result in breaking fine alignment. If this checkbox is cleared, only tabs are used. If this checkbox is selected, the part of indentation defined by the nesting of code blocks, is made of the tabs and (if necessary) spaces, while the part of indentation defined by the alignment is made only of spaces. When the checkbox is cleared, PhpStorm uses spaces instead of tabs. If this checkbox is selected, tab characters are used: This link appears in the upper-right corner of the language-specific code style page, when applicable.Ĭlick Reset to discard changes and return to the initial set of code style settings. If the PSR-12 code style is set, PhpStorm will prompt you to automatically enable the PSR-12-related code inspections.

PhpStorm supports the official Symfony2 code style for Twig and automatically inserts one space after an opening pair of curvy braces and before a closing pair of curvy braces in Twig templates. Select one of the following frameworks from the list: Predefined code style: choose this option to use the coding standards defined for a specific framework. Only the settings that are applicable to the current language are taken. Select the source language from the list, that opens. Language: choose this option to inherit the coding style settings from another language. Set from.Ĭlick this link to choose the base for the current language default code style from the list, that appears. When you change these settings, the Preview pane shows how this will affect your code. Use this page to configure formatting options for PHP files.
