BlankLineBeforeStatementFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- $fixTokenMap : array<string|int, mixed>
- $tokenMap : array<string|int, mixed>
- __construct() : mixed
- Dynamic yield from option set on constructor.
- configure() : mixed
- {@inheritdoc}
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- insertBlankLine() : mixed
- shouldAddBlankLine() : bool
Properties
$fixTokenMap
private
array<string|int, mixed>
$fixTokenMap
= []
$tokenMap
private
static array<string|int, mixed>
$tokenMap
= [
'break' => T_BREAK,
'case' => T_CASE,
'continue' => T_CONTINUE,
'declare' => T_DECLARE,
'default' => T_DEFAULT,
'die' => T_EXIT,
// TODO remove this alias 3.0, use `exit`
'do' => T_DO,
'exit' => T_EXIT,
'for' => T_FOR,
'foreach' => T_FOREACH,
'goto' => T_GOTO,
'if' => T_IF,
'include' => T_INCLUDE,
'include_once' => T_INCLUDE_ONCE,
'require' => T_REQUIRE,
'require_once' => T_REQUIRE_ONCE,
'return' => T_RETURN,
'switch' => T_SWITCH,
'throw' => T_THROW,
'try' => T_TRY,
'while' => T_WHILE,
'yield' => T_YIELD,
]
Methods
__construct()
Dynamic yield from option set on constructor.
public
__construct() : mixed
Return values
mixed —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 after NoExtraBlankLinesFixer, NoUselessReturnFixer, ReturnAssignmentFixer.
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 —insertBlankLine()
private
insertBlankLine(Tokens $tokens, int $index) : mixed
Parameters
- $tokens : Tokens
- $index : int
Return values
mixed —shouldAddBlankLine()
private
shouldAddBlankLine(Tokens $tokens, int $prevNonWhitespace) : bool
Parameters
- $tokens : Tokens
- $prevNonWhitespace : int