NoEmptyCommentFixer
extends AbstractFixer
in package
FinalYes
Table of Contents
Constants
- TYPE_DOUBLE_SLASH = 2
- TYPE_HASH = 1
- TYPE_SLASH_ASTERISK = 3
Methods
- getDefinition() : FixerDefinitionInterface
- getPriority() : int
- {@inheritdoc}
- isCandidate() : bool
- applyFix() : void
- getCommentBlock() : array{blockStart: int, blockEnd: int, isEmpty: bool}
- Return the start index, end index and a flag stating if the comment block is empty.
- getCommentType() : int
- getLineBreakCount() : int
- isEmptyComment() : bool
Constants
TYPE_DOUBLE_SLASH
private
mixed
TYPE_DOUBLE_SLASH
= 2
TYPE_HASH
private
mixed
TYPE_HASH
= 1
TYPE_SLASH_ASTERISK
private
mixed
TYPE_SLASH_ASTERISK
= 3
Methods
getDefinition()
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfacegetPriority()
{@inheritdoc}
public
getPriority() : int
Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer. Must run after PhpdocToCommentFixer.
Return values
intisCandidate()
public
isCandidate(Tokens $tokens) : bool
Parameters
- $tokens : Tokens
Return values
boolapplyFix()
protected
applyFix(SplFileInfo $file, Tokens $tokens) : void
Parameters
- $file : SplFileInfo
- $tokens : Tokens
getCommentBlock()
Return the start index, end index and a flag stating if the comment block is empty.
private
getCommentBlock(Tokens $tokens, int $index) : array{blockStart: int, blockEnd: int, isEmpty: bool}
Parameters
- $tokens : Tokens
- $index : int
-
T_COMMENT index
Return values
array{blockStart: int, blockEnd: int, isEmpty: bool}getCommentType()
private
getCommentType(string $content) : int
Parameters
- $content : string
Return values
intgetLineBreakCount()
private
getLineBreakCount(Tokens $tokens, int $whiteStart, int $whiteEnd) : int
Parameters
- $tokens : Tokens
- $whiteStart : int
- $whiteEnd : int
Return values
intisEmptyComment()
private
isEmptyComment(string $content) : bool
Parameters
- $content : string