=============== Rule ``braces`` =============== The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be properly indented. Warning ------- This rule is deprecated and will be removed on next major version ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You should use ``single_space_around_construct``, ``control_structure_braces``, ``control_structure_continuation_position``, ``declare_parentheses``, ``no_multiple_statements_per_line``, ``curly_braces_position``, ``statement_indentation`` and ``no_extra_blank_lines`` instead. Configuration ------------- ``allow_single_line_anonymous_class_with_empty_body`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether single line anonymous class with empty body notation should be allowed. Allowed types: ``bool`` Default value: ``false`` ``allow_single_line_closure`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether single line lambda notation should be allowed. Allowed types: ``bool`` Default value: ``false`` ``position_after_functions_and_oop_constructs`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether the opening brace should be placed on "next" or "same" line after classy constructs (non-anonymous classes, interfaces, traits, methods and non-lambda functions). Allowed values: ``'next'`` and ``'same'`` Default value: ``'next'`` ``position_after_control_structures`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether the opening brace should be placed on "next" or "same" line after control structures. Allowed values: ``'next'`` and ``'same'`` Default value: ``'same'`` ``position_after_anonymous_constructs`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whether the opening brace should be placed on "next" or "same" line after anonymous constructs (anonymous classes and lambda functions). Allowed values: ``'next'`` and ``'same'`` Default value: ``'same'`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New true]``. .. code-block:: diff --- Original +++ New = 0; }; $negative = function ($item) { - return $item < 0; }; + return $item < 0; +}; Example #3 ~~~~~~~~~~ With configuration: ``['position_after_functions_and_oop_constructs' => 'same']``. .. code-block:: diff --- Original +++ New