Documentation

ReturnAssignmentFixer extends AbstractFixer
in package

Tags
author

SpacePossum

Table of Contents

$tokensAnalyzer  : TokensAnalyzer
getDefinition()  : mixed
{@inheritdoc}
getPriority()  : mixed
{@inheritdoc}
isCandidate()  : mixed
{@inheritdoc}
applyFix()  : mixed
{@inheritdoc}
clearIfSave()  : mixed
fixFunction()  : int
simplifyReturnStatement()  : int

Properties

Methods

getPriority()

{@inheritdoc}

public getPriority() : mixed

Must run before BlankLineBeforeStatementFixer. Must run after NoEmptyStatementFixer, NoUnneededCurlyBracesFixer.

Return values
mixed

applyFix()

{@inheritdoc}

protected applyFix(SplFileInfo $file, Tokens $tokens) : mixed
Parameters
$file : SplFileInfo
$tokens : Tokens
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

Search results