PHP Class PhpCsFixer\Fixer\Comment\HeaderCommentFixer

Author: Antonio J. García Lagar ([email protected])
Author: SpacePossum
Inheritance: extends PhpCsFixer\AbstractFixer, implements PhpCsFixer\Fixer\ConfigurableFixerInterface, implements PhpCsFixer\Fixer\WhitespacesAwareFixerInterface
Mostra file Open project: friendsofphp/php-cs-fixer

Public Methods

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

Protected Methods

Method Description
getDescription ( )

Private Methods

Method Description
encloseTextInComment ( string $header, integer $type ) : string Enclose the given text in a comment block.
findHeaderCommentCurrentIndex ( Tokens $tokens, integer $headerNewIndex ) : integer | null Find the header comment index.
findHeaderCommentInsertionIndex ( Tokens $tokens ) : integer Find the index where the header comment must be inserted.
fixWhiteSpaceAroundHeader ( Tokens $tokens, integer $headerIndex )
getLineBreakCount ( Tokens $tokens, integer $indexStart, integer $indexEnd ) : integer
insertHeader ( Tokens $tokens, integer $index )
parseConfiguration ( array $configuration = null ) : array

Method Details

configure() public method

The following configuration options are allowed: - commentType PHPDoc|comment* - location after_open|after_declare_strict* - separate top|bottom|none|both* (* is the default when the item is omitted)
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 ( )

isCandidate() public method

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