PHP Class PhpCsFixer\Fixer\Whitespace\NoExtraConsecutiveBlankLinesFixer

Author: Dariusz Rumiński ([email protected])
Author: SpacePossum
Inheritance: extends PhpCsFixer\AbstractFixer, implements PhpCsFixer\Fixer\ConfigurableFixerInterface, implements PhpCsFixer\Fixer\WhitespacesAwareFixerInterface
显示文件 Open project: friendsofphp/php-cs-fixer

Public Methods

Method Description
configure ( array $configuration = null ) Set configuration.
fix ( SplFileInfo $file, Tokens $tokens )
getPriority ( )
isCandidate ( Tokens $tokens )

Protected Methods

Method Description
getDescription ( )

Private Methods

Method Description
fixAfterToken ( $index )
fixByToken ( PhpCsFixer\Tokenizer\Token $token, $index )
fixStructureOpenCloseIfMultiLine ( integer $index ) Remove white line(s) after the index of a block type, but only if the block is not on one line.
removeBetweenUse ( $index )
removeEmptyLinesAfterLineWithTokenAt ( $index )
removeMultipleBlankLines ( $index )

Method Details

configure() public method

Valid configuration options are: - 'break' remove blank lines after a line with a 'break' statement - 'continue' remove blank lines after a line with a 'continue' statement - 'extra' [default] consecutive blank lines are squashed into one - 'return' remove blank lines after a line with a 'return' statement - 'throw' remove blank lines after a line with a 'throw' statement - 'use' remove blank lines between 'use' import statements - 'useTrait' remove blank lines between 'use' trait statements - 'curly_brace_block' remove blank lines after a curly opening block brace ('{') and/or end block brace ('}') - 'parenthesis_brace_block' remove blank lines after a parenthesis opening block brace ('(') and/or end block brace (')') - 'square_brace_block' remove blank lines after a square opening block brace ('[') and/or end block brace (']')
public configure ( array $configuration = null )
$configuration array

fix() public method

public fix ( SplFileInfo $file, Tokens $tokens )
$file SplFileInfo
$tokens PhpCsFixer\Tokenizer\Tokens

getDescription() protected method

protected getDescription ( )

getPriority() public method

public getPriority ( )

isCandidate() public method

public isCandidate ( Tokens $tokens )
$tokens PhpCsFixer\Tokenizer\Tokens