NoEmptyStatementFixer
extends AbstractFixer
in package
Tags
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- fixSemicolonAfterCurlyBraceClose() : mixed
- Fix semicolon after closing curly brace if needed.
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before BracesFixer, CombineConsecutiveUnsetsFixer, MultilineWhitespaceBeforeSemicolonsFixer, NoExtraBlankLinesFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoTrailingWhitespaceFixer, NoUselessElseFixer, NoUselessReturnFixer, NoWhitespaceInBlankLineFixer, ReturnAssignmentFixer, SpaceAfterSemicolonFixer, SwitchCaseSemicolonToColonFixer. Must run after NoUselessSprintfFixer.
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 —fixSemicolonAfterCurlyBraceClose()
Fix semicolon after closing curly brace if needed.
private
fixSemicolonAfterCurlyBraceClose(Tokens $tokens, int $index, int $curlyCloseIndex) : mixed
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