PHP Class PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer

Author: SpacePossum
Inheritance: extends PhpCsFixer\AbstractFixer
Show file Open project: friendsofphp/php-cs-fixer

Public Methods

Method Description
fix ( SplFileInfo $file, Tokens $tokens )
getDefinition ( )
getPriority ( )
isCandidate ( Tokens $tokens )

Private Methods

Method Description
clearElse ( Tokens $tokens, integer $index )
fixElse ( Tokens $tokens, integer $index )
fixEmptyElse ( Tokens $tokens, integer $index ) Remove tokens part of an else statement if not empty (i.e. no meaningful tokens inside).
getPreviousBlock ( Tokens $tokens, integer $index ) : int[] Return the first and last token index of the previous block.
isInConditional ( Tokens $tokens, integer $index, integer $lowerLimitIndex ) : boolean

Method Details

fix() public method

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

getDefinition() public method

public getDefinition ( )

getPriority() public method

public getPriority ( )

isCandidate() public method

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