Documentation

CombineConsecutiveUnsetsFixer extends AbstractFixer
in package

Tags
author

SpacePossum

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

getPriority()

{@inheritdoc}

public getPriority() : mixed

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

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

Search results