HeaderCommentFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Tags
Interfaces, Classes and Traits
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_COMMENT
public
mixed
HEADER_COMMENT
= 'comment'
HEADER_LINE_SEPARATION_BOTH
public
mixed
HEADER_LINE_SEPARATION_BOTH
= 1
Tags
HEADER_LINE_SEPARATION_BOTTOM
public
mixed
HEADER_LINE_SEPARATION_BOTTOM
= 3
Tags
HEADER_LINE_SEPARATION_NONE
public
mixed
HEADER_LINE_SEPARATION_NONE
= 4
Tags
HEADER_LINE_SEPARATION_TOP
public
mixed
HEADER_LINE_SEPARATION_TOP
= 2
Tags
HEADER_LOCATION_AFTER_DECLARE_STRICT
public
mixed
HEADER_LOCATION_AFTER_DECLARE_STRICT
= 2
Tags
HEADER_LOCATION_AFTER_OPEN
public
mixed
HEADER_LOCATION_AFTER_OPEN
= 1
Tags
HEADER_PHPDOC
public
mixed
HEADER_PHPDOC
= 'PHPDoc'
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run after DeclareStrictTypesFixer, NoBlankLinesAfterPhpdocFixer.
Return values
mixed —isCandidate()
{@inheritdoc}
public
isCandidate(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
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 —insertHeader()
private
insertHeader(Tokens $tokens, int $index) : mixed
Parameters
- $tokens : Tokens
- $index : int
Return values
mixed —removeHeader()
private
removeHeader(Tokens $tokens, mixed $index) : mixed
Parameters
- $tokens : Tokens
- $index : mixed