Documentation

HeaderCommentFixer extends AbstractFixer
in package
implements ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface

Tags
author

Antonio J. GarcĂ­a Lagar aj@garcialagar.es

author

SpacePossum

Interfaces, Classes and Traits

ConfigurationDefinitionFixerInterface
WhitespacesAwareFixerInterface

Table of Contents

HEADER_COMMENT  = 'comment'
HEADER_LINE_SEPARATION_BOTH  = 1
HEADER_LINE_SEPARATION_BOTTOM  = 3
HEADER_LINE_SEPARATION_NONE  = 4
HEADER_LINE_SEPARATION_TOP  = 2
HEADER_LOCATION_AFTER_DECLARE_STRICT  = 2
HEADER_LOCATION_AFTER_OPEN  = 1
HEADER_PHPDOC  = 'PHPDoc'
getDefinition()  : mixed
{@inheritdoc}
getPriority()  : mixed
{@inheritdoc}
isCandidate()  : mixed
{@inheritdoc}
applyFix()  : mixed
{@inheritdoc}
createConfigurationDefinition()  : mixed
{@inheritdoc}
findHeaderCommentCurrentIndex()  : null|int
findHeaderCommentInsertionIndex()  : int
Find the index where the header comment must be inserted.
fixWhiteSpaceAroundHeader()  : mixed
getHeaderAsComment()  : string
Enclose the given text in a comment block.
getLineBreakCount()  : int
insertHeader()  : mixed
removeHeader()  : mixed

Constants

HEADER_LINE_SEPARATION_BOTH

public mixed HEADER_LINE_SEPARATION_BOTH = 1
Tags
deprecated

will be removed in 3.0

HEADER_LINE_SEPARATION_BOTTOM

public mixed HEADER_LINE_SEPARATION_BOTTOM = 3
Tags
deprecated

will be removed in 3.0

HEADER_LINE_SEPARATION_NONE

public mixed HEADER_LINE_SEPARATION_NONE = 4
Tags
deprecated

will be removed in 3.0

HEADER_LINE_SEPARATION_TOP

public mixed HEADER_LINE_SEPARATION_TOP = 2
Tags
deprecated

will be removed in 3.0

HEADER_LOCATION_AFTER_DECLARE_STRICT

public mixed HEADER_LOCATION_AFTER_DECLARE_STRICT = 2
Tags
deprecated

will be removed in 3.0

HEADER_LOCATION_AFTER_OPEN

public mixed HEADER_LOCATION_AFTER_OPEN = 1
Tags
deprecated

will be removed in 3.0

Methods

getDefinition()

{@inheritdoc}

public getDefinition() : mixed
Return values
mixed

getPriority()

{@inheritdoc}

public getPriority() : mixed

Must run after DeclareStrictTypesFixer, NoBlankLinesAfterPhpdocFixer.

Return values
mixed

applyFix()

{@inheritdoc}

protected applyFix(SplFileInfo $file, Tokens $tokens) : mixed
Parameters
$file : SplFileInfo
$tokens : Tokens
Return values
mixed

createConfigurationDefinition()

{@inheritdoc}

protected createConfigurationDefinition() : mixed
Return values
mixed

findHeaderCommentCurrentIndex()

private findHeaderCommentCurrentIndex(Tokens $tokens, int $headerNewIndex) : null|int
Parameters
$tokens : Tokens
$headerNewIndex : int
Return values
null|int

findHeaderCommentInsertionIndex()

Find the index where the header comment must be inserted.

private findHeaderCommentInsertionIndex(Tokens $tokens, string $location) : int
Parameters
$tokens : Tokens
$location : string
Return values
int

fixWhiteSpaceAroundHeader()

private fixWhiteSpaceAroundHeader(Tokens $tokens, int $headerIndex) : mixed
Parameters
$tokens : Tokens
$headerIndex : int
Return values
mixed

getHeaderAsComment()

Enclose the given text in a comment block.

private getHeaderAsComment() : string
Return values
string

getLineBreakCount()

private getLineBreakCount(Tokens $tokens, int $index, int $direction) : int
Parameters
$tokens : Tokens
$index : int
$direction : int
Return values
int

removeHeader()

private removeHeader(Tokens $tokens, mixed $index) : mixed
Parameters
$tokens : Tokens
$index : mixed
Return values
mixed

Search results