Documentation

NoEmptyStatementFixer extends AbstractFixer
in package

FinalYes
Tags
author

Dariusz Rumiński dariusz.ruminski@gmail.com

Table of Contents

Methods

getDefinition()  : FixerDefinitionInterface
getPriority()  : int
{@inheritdoc}
isCandidate()  : bool
applyFix()  : void
fixSemicolonAfterCurlyBraceClose()  : void
Fix semicolon after closing curly brace if needed.

Methods

getPriority()

{@inheritdoc}

public getPriority() : int

Must run before BracesFixer, CombineConsecutiveUnsetsFixer, EmptyLoopBodyFixer, MultilineWhitespaceBeforeSemicolonsFixer, NoExtraBlankLinesFixer, NoMultipleStatementsPerLineFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoTrailingWhitespaceFixer, NoUselessElseFixer, NoUselessReturnFixer, NoWhitespaceInBlankLineFixer, ReturnAssignmentFixer, SpaceAfterSemicolonFixer, SwitchCaseSemicolonToColonFixer. Must run after NoUselessSprintfFixer.

Return values
int

fixSemicolonAfterCurlyBraceClose()

Fix semicolon after closing curly brace if needed.

private fixSemicolonAfterCurlyBraceClose(Tokens $tokens, int $index, int $curlyCloseIndex) : void

Test for the following cases

  • just '{' '}' block (following open tag or ';')
  • if, else, elseif
  • interface, trait, class (but not anonymous)
  • catch, finally (but not try)
  • for, foreach, while (but not 'do - while')
  • switch
  • function (declaration, but not lambda)
  • declare (with '{' '}')
  • namespace (with '{' '}')
Parameters
$tokens : Tokens
$index : int

Semicolon index

$curlyCloseIndex : int

        
On this page

Search results