CombineConsecutiveUnsetsFixer
extends AbstractFixer
in package
Tags
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- clearOffsetTokens() : mixed
- getPreviousUnsetCall() : int|array<string|int, int>
- Find a previous call to unset directly before the index.
- moveTokens() : int
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, SpaceAfterSemicolonFixer. Must run after NoEmptyStatementFixer, NoUnsetOnPropertyFixer, NoUselessElseFixer.
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 —clearOffsetTokens()
private
clearOffsetTokens(Tokens $tokens, int $offset, array<string|int, int> $indices) : mixed
Parameters
- $tokens : Tokens
- $offset : int
- $indices : array<string|int, int>
Return values
mixed —getPreviousUnsetCall()
Find a previous call to unset directly before the index.
private
getPreviousUnsetCall(Tokens $tokens, int $index) : int|array<string|int, int>
Returns an array with
- unset index
- opening brace index
- closing brace index
- end semicolon index
Or the index to where the method looked for an call.
Parameters
- $tokens : Tokens
- $index : int
Return values
int|array<string|int, int> —moveTokens()
private
moveTokens(Tokens $tokens, int $start, int $end, int $to) : int
Parameters
- $tokens : Tokens
- $start : int
-
Index previous of the first token to move
- $end : int
-
Index of the last token to move
- $to : int
-
Upper boundary index
Return values
int —Number of tokens inserted