ReturnAssignmentFixer
extends AbstractFixer
in package
Tags
Table of Contents
- $tokensAnalyzer : TokensAnalyzer
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- clearIfSave() : mixed
- fixFunction() : int
- simplifyReturnStatement() : int
Properties
$tokensAnalyzer
private
TokensAnalyzer
$tokensAnalyzer
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before BlankLineBeforeStatementFixer. Must run after NoEmptyStatementFixer, NoUnneededCurlyBracesFixer.
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 —clearIfSave()
private
clearIfSave(Tokens $tokens, mixed $index) : mixed
Parameters
- $tokens : Tokens
- $index : mixed
Return values
mixed —fixFunction()
private
fixFunction(Tokens $tokens, int $functionIndex, int $functionOpenIndex, int $functionCloseIndex) : int
Parameters
- $tokens : Tokens
- $functionIndex : int
-
token index of T_FUNCTION
- $functionOpenIndex : int
-
token index of the opening brace token of the function
- $functionCloseIndex : int
-
token index of the closing brace token of the function
Return values
int —= 0 number of tokens inserted into the Tokens collection
simplifyReturnStatement()
private
simplifyReturnStatement(Tokens $tokens, int $assignVarIndex, int $assignVarOperatorIndex, int $returnIndex, int $returnVarEndIndex) : int
Parameters
- $tokens : Tokens
- $assignVarIndex : int
- $assignVarOperatorIndex : int
- $returnIndex : int
- $returnVarEndIndex : int
Return values
int —= 0 number of tokens inserted into the Tokens collection