Documentation

CombineConsecutiveUnsetsFixer extends AbstractFixer
in package

FinalYes

Table of Contents

Methods

getDefinition()  : FixerDefinitionInterface
getPriority()  : int
{@inheritdoc}
isCandidate()  : bool
applyFix()  : void
clearOffsetTokens()  : void
getPreviousUnsetCall()  : array{: int, : int, : int, : int}|int
Find a previous call to unset directly before the index.
moveTokens()  : int

Methods

getPriority()

{@inheritdoc}

public getPriority() : int

Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, SpaceAfterSemicolonFixer. Must run after NoEmptyStatementFixer, NoUnsetOnPropertyFixer, NoUselessElseFixer.

Return values
int

getPreviousUnsetCall()

Find a previous call to unset directly before the index.

private getPreviousUnsetCall(Tokens $tokens, int $index) : array{: int, : int, : int, : 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 a call.

Parameters
$tokens : Tokens
$index : int
Return values
array{: int, : int, : int, : 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


        
On this page

Search results