============================= Rule ``no_extra_blank_lines`` ============================= Removes extra blank lines and/or blank lines following configuration. Configuration ------------- ``tokens`` ~~~~~~~~~~ List of tokens to fix. Allowed values: a subset of ``['attribute', 'break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use', 'use_trait']`` Default value: ``['extra']`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New ['break']]``. .. code-block:: diff --- Original +++ New ['continue']]``. .. code-block:: diff --- Original +++ New ['curly_brace_block']]``. .. code-block:: diff --- Original +++ New ['extra']]``. .. code-block:: diff --- Original +++ New ['parenthesis_brace_block']]``. .. code-block:: diff --- Original +++ New ['return']]``. .. code-block:: diff --- Original +++ New ['square_brace_block']]``. .. code-block:: diff --- Original +++ New ['throw']]``. .. code-block:: diff --- Original +++ New ['use']]``. .. code-block:: diff --- Original +++ New ['switch', 'case', 'default']]``. .. code-block:: diff --- Original +++ New `_ with config: ``['tokens' => ['use']]`` - `@PER-CS <./../../ruleSets/PER-CS.rst>`_ with config: ``['tokens' => ['use']]`` - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_ with config: ``['tokens' => ['use']]`` - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_ with config: ``['tokens' => ['use']]`` - `@PSR12 <./../../ruleSets/PSR12.rst>`_ with config: ``['tokens' => ['use']]`` - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ with config: ``['tokens' => ['attribute', 'break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use']]`` - `@Symfony <./../../ruleSets/Symfony.rst>`_ with config: ``['tokens' => ['attribute', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']]`` References ---------- - Fixer class: `PhpCsFixer\\Fixer\\Whitespace\\NoExtraBlankLinesFixer <./../../../src/Fixer/Whitespace/NoExtraBlankLinesFixer.php>`_ - Test class: `PhpCsFixer\\Tests\\Fixer\\Whitespace\\NoExtraBlankLinesFixerTest <./../../../tests/Fixer/Whitespace/NoExtraBlankLinesFixerTest.php>`_ The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.