SimplifiedIfReturnFixer
extends AbstractFixer
in package
FinalYes
Tags
Table of Contents
Properties
-
$sequences
: array<int, array{isNegative: bool, sequence: non-empty-list
}>
Methods
- getDefinition() : FixerDefinitionInterface
- getPriority() : int
- {@inheritdoc}
- isCandidate() : bool
- applyFix() : void
Properties
$sequences
private
array<int, array{isNegative: bool, sequence: non-empty-list}>
$sequences
= [['isNegative' => false, 'sequence' => ['{', [T_RETURN], [T_STRING, 'true'], ';', '}', [T_RETURN], [T_STRING, 'false'], ';']], ['isNegative' => true, 'sequence' => ['{', [T_RETURN], [T_STRING, 'false'], ';', '}', [T_RETURN], [T_STRING, 'true'], ';']], ['isNegative' => false, 'sequence' => [[T_RETURN], [T_STRING, 'true'], ';', [T_RETURN], [T_STRING, 'false'], ';']], ['isNegative' => true, 'sequence' => [[T_RETURN], [T_STRING, 'false'], ';', [T_RETURN], [T_STRING, 'true'], ';']]]
Methods
getDefinition()
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfacegetPriority()
{@inheritdoc}
public
getPriority() : int
Must run before MultilineWhitespaceBeforeSemicolonsFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer. Must run after NoSuperfluousElseifFixer, NoUnneededBracesFixer, NoUnneededCurlyBracesFixer, NoUselessElseFixer, SemicolonAfterInstructionFixer.
Return values
intisCandidate()
public
isCandidate(Tokens $tokens) : bool
Parameters
- $tokens : Tokens
Return values
boolapplyFix()
protected
applyFix(SplFileInfo $file, Tokens $tokens) : void
Parameters
- $file : SplFileInfo
- $tokens : Tokens