Customize Formatting#
Code formatter respects currently selected code style setting. The settings bellow override the single code style parameters.
Indentation#
IndentBraces: Gets value indicating whether to indent braces
- .editorconfig directive:
php_format_indent_braces
| |
| true | false |
Spacing#
Space after cast: Insert a space after a cast operator.
- .editorconfig directive:
php_format_space_after_cast - .editorconfig alternative directive:
ij_php_space_after_type_cast
| |
| true | false |
Space after unary not !: Insert a space after a unary not operator.
- .editorconfig directive:
php_format_space_after_unary_not - .editorconfig alternative directive:
ij_php_space_after_unary_not
| |
| true | false |
Space around concatenation .: Insert a space around concatenation operator.
- .editorconfig directive:
php_format_space_around_concatenation - .editorconfig alternative directive:
ij_php_concat_spaces
| |
| true | false |
Space before colon : in control flow statements: Insert a space before colon in control flow blocks.
- .editorconfig directive:
php_format_space_before_colon_in_control_statements
| |
| true | false |
Space before colon : in return type: Insert a space before colon in a return type
- .editorconfig directive:
php_format_space_before_colon_in_return_type - .editorconfig alternative directive:
ij_php_space_before_colon_in_return_type
| |
| true | false |
Space before parentheses in arrow functions: Insert a space before arrow function parentheses.
- .editorconfig directive:
php_format_space_before_parentheses_in_arrow_functions - .editorconfig alternative directive:
ij_php_space_before_short_closure_left_parenthesis
| |
| true | false |
Space before parentheses in function calls: Insert a space before parentheses in method, function and constructor call parentheses.
- .editorconfig directive:
php_format_space_before_parentheses_in_calls - .editorconfig alternative directive:
ij_php_space_before_method_call_parentheses
| |
| true | false |
Space before parentheses in control statements: Insert a space before parentheses in control statements.
- .editorconfig directive:
php_format_space_before_parentheses_in_control_statements - .editorconfig alternative directive:
ij_php_space_before_catch_parentheses
| |
| true | false |
Space before parentheses in declarations: Insert a space before parentheses in method, function and constructor declaration parentheses.
- .editorconfig directive:
php_format_space_before_parentheses_in_declarations - .editorconfig alternative directive:
ij_php_space_before_method_parentheses
| |
| true | false |
Space before unary not !: Insert a space before a unary not operator.
- .editorconfig directive:
php_format_space_before_unary_not - .editorconfig alternative directive:
ij_php_space_before_unary_not
| |
| true | false |
Space within array initializer parentheses: Insert a space within array initializer parentheses.
- .editorconfig directive:
php_format_space_within_array_initilizers_parens - .editorconfig alternative directive:
ij_php_spaces_within_array_initializer_braces
| |
| true | false |
Space within brackets []: Insert a space within brackets.
- .editorconfig directive:
php_format_space_within_brackets - .editorconfig alternative directive:
ij_php_spaces_within_brackets
| |
| true | false |
Space within brackets [] around expression: Insert a space within brackets around expression.
- .editorconfig directive:
php_format_space_within_brackets_around_expression - .editorconfig alternative directive:
ij_php_spaces_around_var_within_brackets
| |
| true | false |
Space within call parentheses: Insert a space within method, function and constructor call parentheses.
- .editorconfig directive:
php_format_space_within_call_parens - .editorconfig alternative directive:
ij_php_spaces_within_method_call_parentheses
| |
| true | false |
Space within catch parentheses: Insert a space within catch statement header parentheses.
- .editorconfig directive:
php_format_space_within_catch_parens - .editorconfig alternative directive:
ij_php_spaces_within_catch_parentheses
| |
| true | false |
Space within declaration parentheses: Insert a space within method, function and constructor declaration parentheses.
- .editorconfig directive:
php_format_space_within_decl_parens - .editorconfig alternative directive:
ij_php_spaces_within_method_parentheses
| |
| true | false |
Space within parentheses around expression: Insert a space within parentheses around expression.
- .editorconfig directive:
php_format_space_within_expression_parens - .editorconfig alternative directive:
ij_php_spaces_within_parentheses
| |
| true | false |
Space within for parentheses: Insert a space within for statement header parentheses.
- .editorconfig directive:
php_format_space_within_for_parens - .editorconfig alternative directive:
ij_php_spaces_within_for_parentheses
| |
| true | false |
Space within foreach parentheses: Insert a space within foreach statement header parentheses.
- .editorconfig directive:
php_format_space_within_foreach_parens
| |
| true | false |
Space within if parentheses: Insert a space within if statement header parentheses.
- .editorconfig directive:
php_format_space_within_if_parens - .editorconfig alternative directive:
ij_php_spaces_within_if_parentheses
| |
| true | false |
Space within switch parentheses: Insert a space within switch statement header parentheses.
- .editorconfig directive:
php_format_space_within_switch_parens
| |
| true | false |
Space within while parentheses: Insert a space within while statement header parentheses.
- .editorconfig directive:
php_format_space_within_while_parens - .editorconfig alternative directive:
ij_php_spaces_within_while_parentheses
| |
| true | false |
NewLines#
catch on a new line: Place catch on a new line.
- .editorconfig directive:
php_format_catch_on_new_line - .editorconfig alternative directive:
ij_php_catch_on_new_line
| |
| true | false |
else on a new line: Place else on a new line.
- .editorconfig directive:
php_format_else_on_new_line - .editorconfig alternative directive:
ij_php_else_on_new_line
| |
| true | false |
Insert final newline: Inserts final newline at the end of a file.
- .editorconfig directive:
php_format_end_with_new_line
finally on a new line: Place finally on a new line.
- .editorconfig directive:
php_format_finally_on_new_line - .editorconfig alternative directive:
ij_php_finally_on_new_line
| |
| true | false |
Open brace on a new line for anonymous classes: Place open brace { on a new line for anonymous classes.
- .editorconfig directive:
php_format_open_brace_on_new_line_for_anonymous_classes - .editorconfig alternative directive:
ij_php_anonymous_brace_style
| |
| true | false |
Open brace on a new line for blocks: Place open brace { on a new line for all types of code blocks, except for those controlled by other formatting rules.
- .editorconfig directive:
php_format_open_brace_on_new_line_for_blocks - .editorconfig alternative directive:
ij_php_block_brace_style(values as in IntelliJ)
| |
| true | false |
Open brace on a new line for functions: Place open brace { on a new line for methods, functions and constructors.
- .editorconfig directive:
php_format_open_brace_on_new_line_for_functions - .editorconfig alternative directive:
ij_php_method_brace_style(values as in IntelliJ)
| |
| true | false |
Open brace on a new line for lambda functions: Place open brace { on a new line for lambda functions.
- .editorconfig directive:
php_format_open_brace_on_new_line_for_lambdas - .editorconfig alternative directive:
ij_php_lambda_brace_style(values as in IntelliJ)
| |
| true | false |
Open brace on a new line for namespaces: Place open brace { on a new line for namespace declarations.
- .editorconfig directive:
php_format_open_brace_on_new_line_for_namespaces - .editorconfig alternative directive:
ij_php_namespace_brace_style(values as in IntelliJ)
| |
| true | false |
Open brace on a new line for types: Place open brace { on a new line for types.
- .editorconfig directive:
php_format_open_brace_on_new_line_for_types - .editorconfig alternative directive:
ij_php_class_brace_style(values as in IntelliJ)
| |
| true | false |
Wrapping#
Align consecutive = assignments.: Automatically align consecutive = assignments.
- .editorconfig directive:
php_format_align_consecutive_assignments - .editorconfig alternative directive:
ij_php_align_assignments
| |
| true | false |
Align constants: Automatically align constant declarations
- .editorconfig directive:
php_format_align_constants - .editorconfig alternative directive:
ij_php_align_class_constants
| |
| true | false |
Align enum cases: Automatically align assigned values in backed enumerations
- .editorconfig directive:
php_format_align_enum_cases - .editorconfig alternative directive:
ij_php_align_enum_cases
| |
| true | false |
Align match arm bodies: Automatically align the bodies (results) within match expression arms
- .editorconfig directive:
php_format_align_match_arm_bodies - .editorconfig alternative directive:
ij_php_align_match_arm_bodies
| |
| true | false |
Align properties: Automatically align properties declarations
- .editorconfig directive:
php_format_align_properties
| |
| true | false |
Align key-value pairs: Automatically align => operators.
- .editorconfig directive:
php_format_array_initializers_align_key_value_pairs - .editorconfig alternative directive:
ij_php_align_key_value_pairs
| |
| true | false |
New line after last element: Place a new line after the last element when wrapping.
- .editorconfig directive:
php_format_array_initializers_new_line_after_last_element - .editorconfig alternative directive:
ij_php_array_initializer_right_brace_on_new_line
| |
| true | false |
New line before first element: Place a new line before the first array element when wrapping.
- .editorconfig directive:
php_format_array_initializers_new_line_before_first_element - .editorconfig alternative directive:
ij_php_array_initializer_new_line_after_left_brace
| |
| true | false |
Wrap: _Defines wrapping behavior for array initializers. * Off - No wrapping is applied * On every item - When this option is selected each item is placed on a new line and properly indented if the array initializer is split across multiple lines. _
- .editorconfig directive:
php_format_array_initializers_wrap - .editorconfig alternative directive:
ij_php_array_initializer_wrap(values as in IntelliJ)
New line after (: Place a new line after the left opening parenthesis ( when wrapping.
- .editorconfig directive:
php_format_call_parameters_new_line_after_left_paren - .editorconfig alternative directive:
ij_php_call_parameters_new_line_after_left_paren
| |
| true | false |
New line before ): Place a new line before the right closing parenthesis ) when wrapping.
- .editorconfig directive:
php_format_call_parameters_new_line_before_right_paren - .editorconfig alternative directive:
ij_php_call_parameters_right_paren_on_new_line
| |
| true | false |
Wrap: _Defines wrapping behavior for method, function and constructor call parameters. * Off - No wrapping is applied * On every item - When this option is selected each item is placed on a new line and properly indented if the call arguments are split across multiple lines. _
- .editorconfig directive:
php_format_call_parameters_wrap - .editorconfig alternative directive:
ij_php_call_parameters_wrap(values as in IntelliJ)
; on a new line: Place ; on a new line after the last element in the chained method call when wrapping.
- .editorconfig directive:
php_format_chained_method_calls_semicolon_on_new_line - .editorconfig alternative directive:
ij_php_multiline_chained_calls_semicolon_on_new_line
| |
| true | false |
Wrap: _Defines wrapping behavior for chained method calls. * Off - No wrapping is applied * Always - When this option is selected each method call is placed on a new line and properly indented. _
- .editorconfig directive:
php_format_chained_method_calls_wrap - .editorconfig alternative directive:
ij_php_method_call_chain_wrap(values as in IntelliJ)
Compact empty body into {}: Transform empty body into {} and keep it at the same line as a previous symbol, separated by single space.
- .editorconfig directive:
php_format_decl_compact_empty_body
| |
| true | false |
Keep ) and { on one line: Keep the right closing parenthesis ) of a function or method declaration header on the one line as opening brace of the body {.
- .editorconfig directive:
php_format_decl_keep_right_paren_and_open_brace_on_one_line - .editorconfig alternative directive:
ij_php_keep_rparen_and_lbrace_on_one_line
| |
| true | false |
New line after (: Place a new line after the left opening parenthesis ( of function or method declaration header when wrapping.
- .editorconfig directive:
php_format_decl_parameters_new_line_after_left_paren - .editorconfig alternative directive:
ij_php_method_parameters_new_line_after_left_paren
| |
| true | false |
New line before ): Place a new line before the right closing parenthesis ) of a function or method declaration header when wrapping.
- .editorconfig directive:
php_format_decl_parameters_new_line_before_right_paren - .editorconfig alternative directive:
ij_php_method_parameters_right_paren_on_new_line
| |
| true | false |
Wrap: _Defines wrapping behavior for method or function declaration parameters. * Off - No wrapping is applied * On every item - When this option is selected each declaration parameter is placed on a new line and properly indented if the arguments are split across multiple lines. _
- .editorconfig directive:
php_format_decl_parameters_wrap - .editorconfig alternative directive:
ij_php_method_parameters_wrap(values as in IntelliJ)
New line after (: Place a new line after the left opening parenthesis ( in a for statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_for_statement_new_line_after_left_paren - .editorconfig alternative directive:
ij_php_for_statement_new_line_after_left_paren
| |
| true | false |
New line before ): Place a new line after the right closing parenthesis ) in a for statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_for_statement_new_line_before_right_paren - .editorconfig alternative directive:
ij_php_for_statement_right_paren_on_new_line
| |
| true | false |
Wrap: _Defines wrapping behavior for for statement. * Off - No wrapping is applied * On every item - When this option is selected each item in for statement is placed on a new line and properly indented if they are split across multiple lines. _
- .editorconfig directive:
php_format_for_statement_wrap - .editorconfig alternative directive:
ij_php_for_statement_wrap(values as in IntelliJ)
New line before first group use declaration: Place a new line before first group use declaration if the list of declarations is split across multiple lines.
- .editorconfig directive:
php_format_group_use_new_line_before_first_declaration
| |
| true | false |
Wrap: _Defines wrapping behavior for group use list in type declarations. * Off - No wrapping is applied * On every item - When this option is selected each declaration in group use list is placed on a new line and properly indented if they are split across multiple lines. _
- .editorconfig directive:
php_format_group_use_wrap - .editorconfig alternative directive:
ij_php_group_use_wrap(values as in IntelliJ)
New line after (: Place a new line after the left opening parenthesis ( in a if or elseif statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_if_statement_new_line_after_left_paren - .editorconfig alternative directive:
ij_php_if_lparen_on_next_line
| |
| true | false |
New line before ): Place a new line after the right closing parenthesis ) in a if or elseif statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_if_statement_new_line_before_right_paren - .editorconfig alternative directive:
ij_php_if_rparen_on_next_line
| |
| true | false |
Wrap: _Defines wrapping behavior for implements list in type declarations. * Off - No wrapping is applied * On every item - When this option is selected each interface in implements list is placed on a new line and properly indented if they are split across multiple lines. _
- .editorconfig directive:
php_format_implements_list_wrap - .editorconfig alternative directive:
ij_php_extends_list_wrap(values as in IntelliJ)
Heredoc/Nowdoc Content Indentation: Ensures heredoc and nowdoc content lines are indented one level past the declaration's scope.
- .editorconfig directive:
php_format_indent_heredoc
| |
| true | false |
Inline Heredoc/Nowdoc Declaration: Place heredoc and nowdoc on the same line as declaring variable
- .editorconfig directive:
php_format_inline_heredoc
| |
| true | false |
Keep classes on one line: Clasess are kept on one line.
- .editorconfig directive:
php_format_keep_classes_on_one_line - .editorconfig alternative directive:
ij_php_keep_simple_classes_in_one_line
| |
| true | false |
Keep control statements on one line: Control statements are kept on one line.
- .editorconfig directive:
php_format_keep_control_statements_on_one_line - .editorconfig alternative directive:
ij_php_keep_control_statement_in_one_line
| |
| true | false |
Keep functions on one line: Functions and methods are kept on one line.
- .editorconfig directive:
php_format_keep_functions_on_one_line - .editorconfig alternative directive:
ij_php_keep_simple_methods_in_one_line
| |
| true | false |
New line after implements: Place a new line after implements in type declaration if the list of interfaces is split across multiple lines.
- .editorconfig directive:
php_format_new_line_after_implements
| |
| true | false |
New line after (: Place a new line after the left opening parenthesis ( in a switch statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_switch_statement_new_line_after_left_paren
| |
| true | false |
New line before ): Place a new line after the right closing parenthesis ) in a switch statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_switch_statement_new_line_before_right_paren
| |
| true | false |
New line after (: Place a new line after the left opening parenthesis ( in a while statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_while_statement_new_line_after_left_paren
| |
| true | false |
New line before ): Place a new line after the right closing parenthesis ) in a while statement header if it's split across multiple lines.
- .editorconfig directive:
php_format_while_statement_new_line_before_right_paren
| |
| true | false |
Conversions#
Add a comma after the last array element: Automatically adds a comma after the last array element if it's not on a single line.
- .editorconfig directive:
php_format_add_comma_after_last_array_element - .editorconfig alternative directive:
ij_php_comma_after_last_array_element
Add a comma after the last function call parameters: Automatically adds a comma after the last function call parameter if it's not on a single line.
- .editorconfig directive:
php_format_add_comma_after_last_call_parameter - .editorconfig alternative directive:
ij_php_comma_after_last_argument
Add a comma after the last function declaration parameters: Automatically adds a comma after the last function or method declaration parameter if it's not on a single line.
- .editorconfig directive:
php_format_add_comma_after_last_decl_parameter - .editorconfig alternative directive:
ij_php_comma_after_last_parameter
Boolean constant casing: _Defines casing for true and false constants. * uppercase - Changes the casing to upper case * lowercase - Changes the casing to lower case * keep - Keeps the original casing _
- .editorconfig directive:
php_format_boolean_constant_casing - .editorconfig alternative directive:
ij_php_upper_case_boolean_const
| |
| lowercase | uppercase |
ImportSorting: Sort 'use' statements order. This setting affects how 'Organize imports' code action will sort 'use' statements.
- .editorconfig directive:
php_format_import_sorting - .editorconfig alternative directive:
ij_php_import_sorting(values as in IntelliJ)
ImportSortingCaseSensitive: Case-sensitive alphabetic sort of 'use' statements. Case sensitive sorting puts upper case letters on top.
- .editorconfig directive:
php_format_import_sorting_case_sensitive
| |
| false | true |
Null constant casing: _Defines casing for null constant. * uppercase - Changes the casing to upper case * lowercase - Changes the casing to lower case * keep - Keeps the original casing _
- .editorconfig directive:
php_format_null_constant_casing - .editorconfig alternative directive:
ij_php_upper_case_null_const
| |
| lowercase | uppercase |
BlankLines#
Blank lines after class: Defines the number of blank lines after a class declaration.
- .editorconfig directive:
php_format_blank_lines_after_class - .editorconfig alternative directive:
ij_php_blank_lines_around_class
Blank lines after class body: Defines the number of blank lines after a class body.
- .editorconfig directive:
php_format_blank_lines_after_class_body - .editorconfig alternative directive:
ij_php_blank_lines_before_class_end
Blank lines after function: Defines the number of blank lines after a function declaration.
- .editorconfig directive:
php_format_blank_lines_after_function - .editorconfig alternative directive:
ij_php_blank_lines_after_function
Blank lines after method: Defines the number of blank lines after a method declaration.
- .editorconfig directive:
php_format_blank_lines_after_method - .editorconfig alternative directive:
ij_php_blank_lines_around_method
Blank lines after namespace: Defines the number of blank lines after a namespace declaration.
- .editorconfig directive:
php_format_blank_lines_after_namespace - .editorconfig alternative directive:
ij_php_blank_lines_after_package
Blank lines after open tag: Defines the number of blank lines after a open tag, except when the close tag is on the same line.
- .editorconfig directive:
php_format_blank_lines_after_open_tag
Blank lines after use statements: Defines the number of blank lines after 'use' statements.
- .editorconfig directive:
php_format_blank_lines_after_use_statements - .editorconfig alternative directive:
ij_php_blank_lines_after_imports
Blank lines around class constant: Defines the number of blank lines around a class constant.
- .editorconfig directive:
php_format_blank_lines_around_class_constant
Blank lines around enum case: Defines the number of blank lines around an enum case.
- .editorconfig directive:
php_format_blank_lines_around_enum_case
Blank lines around property: Defines the number of blank lines around a property.
- .editorconfig directive:
php_format_blank_lines_around_property
Blank lines before class: Defines the number of blank lines before a class declaration.
- .editorconfig directive:
php_format_blank_lines_before_class - .editorconfig alternative directive:
ij_php_blank_lines_around_class
Blank lines before class body: Defines the number of blank lines before a class body.
- .editorconfig directive:
php_format_blank_lines_before_class_body - .editorconfig alternative directive:
ij_php_blank_lines_after_class_header
Blank lines before function: Defines the number of blank lines before a function declaration.
- .editorconfig directive:
php_format_blank_lines_before_function
Blank lines before function body: Defines the number of blank lines before a function body.
- .editorconfig directive:
php_format_blank_lines_before_function_body
Blank lines before method: Defines the number of blank lines before a method declaration.
- .editorconfig directive:
php_format_blank_lines_before_method - .editorconfig alternative directive:
ij_php_blank_lines_around_method
Blank lines before method body: Defines the number of blank lines before a method body.
- .editorconfig directive:
php_format_blank_lines_before_method_body - .editorconfig alternative directive:
ij_php_blank_lines_before_method_body
Blank lines before namespace: Defines the number of blank lines before a namespace declaration.
- .editorconfig directive:
php_format_blank_lines_before_namespace - .editorconfig alternative directive:
ij_php_blank_lines_before_package
Blank lines before return statement: Defines the number of blank lines before a return statement.
- .editorconfig directive:
php_format_blank_lines_before_return_statement
Blank lines before use statements: Defines the number of blank lines before 'use' statements.
- .editorconfig directive:
php_format_blank_lines_before_use_statements - .editorconfig alternative directive:
ij_php_blank_lines_before_imports
Blank lines between different use types: Defines the number of blank lines between different types of use statements (e.g., classes, functions, constants), but not between the same type.
- .editorconfig directive:
php_format_blank_lines_between_use_types
Maximum blank lines in code: Defines the maximum number of consecutive blank lines allowed in the code.
- .editorconfig directive:
php_format_max_blank_lines - .editorconfig alternative directive:
ij_php_keep_blank_lines_in_code