NoExtraBlankLinesFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- $availableTokens : array<string|int, string>
- $tokenEqualsMap : array<string, string>
- $tokenKindCallbackMap : array<int, string>
- $tokens : Tokens
- $tokensAnalyzer : TokensAnalyzer
- configure() : mixed
- {@inheritdoc}
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- containsLinebreak() : bool
- fixAfterThrowToken() : mixed
- fixAfterToken() : mixed
- fixByToken() : mixed
- fixStructureOpenCloseIfMultiLine() : mixed
- Remove white line(s) after the index of a block type, but only if the block is not on one line.
- removeBetweenUse() : mixed
- removeEmptyLinesAfterLineWithTokenAt() : mixed
- removeMultipleBlankLines() : mixed
Properties
$availableTokens
private
static array<string|int, string>
$availableTokens
= ['break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use', 'useTrait', 'use_trait']
$tokenEqualsMap
private
array<string, string>
$tokenEqualsMap
$tokenKindCallbackMap
private
array<int, string>
$tokenKindCallbackMap
$tokens
private
Tokens
$tokens
$tokensAnalyzer
private
TokensAnalyzer
$tokensAnalyzer
Methods
configure()
{@inheritdoc}
public
configure([array<string|int, mixed> $configuration = null ]) : mixed
Parameters
- $configuration : array<string|int, mixed> = null
Return values
mixed —getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before BlankLineBeforeStatementFixer. Must run after CombineConsecutiveUnsetsFixer, FunctionToConstantFixer, NoEmptyCommentFixer, NoEmptyPhpdocFixer, NoEmptyStatementFixer, NoUnusedImportsFixer, NoUselessElseFixer, NoUselessReturnFixer, NoUselessSprintfFixer.
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 —containsLinebreak()
private
containsLinebreak(int $startIndex, int $endIndex) : bool
Parameters
- $startIndex : int
- $endIndex : int
Return values
bool —fixAfterThrowToken()
private
fixAfterThrowToken(mixed $index) : mixed
Parameters
- $index : mixed
Return values
mixed —fixAfterToken()
private
fixAfterToken(mixed $index) : mixed
Parameters
- $index : mixed
Return values
mixed —fixByToken()
private
fixByToken(Token $token, mixed $index) : mixed
Parameters
- $token : Token
- $index : mixed
Return values
mixed —fixStructureOpenCloseIfMultiLine()
Remove white line(s) after the index of a block type, but only if the block is not on one line.
private
fixStructureOpenCloseIfMultiLine(int $index) : mixed
Parameters
- $index : int
-
body start
Return values
mixed —removeBetweenUse()
private
removeBetweenUse(mixed $index) : mixed
Parameters
- $index : mixed
Return values
mixed —removeEmptyLinesAfterLineWithTokenAt()
private
removeEmptyLinesAfterLineWithTokenAt(mixed $index) : mixed
Parameters
- $index : mixed
Return values
mixed —removeMultipleBlankLines()
private
removeMultipleBlankLines(mixed $index) : mixed
Parameters
- $index : mixed