StringLengthToEmptyFixer
extends AbstractFunctionReferenceFixer
in package
FinalYes
Table of Contents
Methods
- getDefinition() : FixerDefinitionInterface
- getPriority() : int
- {@inheritdoc}
- applyFix() : void
- findStrLengthCalls() : Generator
- getReplacementNotYoda() : int|null
- getReplacementYoda() : int|null
- isOfHigherPrecedence() : bool
- isOperandOfInterest() : bool
- isOperatorOfInterest() : bool
- keepParentheses() : bool
Methods
getDefinition()
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfacegetPriority()
{@inheritdoc}
public
getPriority() : int
Must run before NoExtraBlankLinesFixer, NoTrailingWhitespaceFixer. Must run after NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer.
Return values
intapplyFix()
protected
applyFix(SplFileInfo $file, Tokens $tokens) : void
Parameters
- $file : SplFileInfo
- $tokens : Tokens
findStrLengthCalls()
private
findStrLengthCalls(Tokens $tokens) : Generator
Parameters
- $tokens : Tokens
Return values
GeneratorgetReplacementNotYoda()
private
getReplacementNotYoda(Token $operator, Token $operand) : int|null
Parameters
Return values
int|nullgetReplacementYoda()
private
getReplacementYoda(Token $operator, Token $operand) : int|null
Parameters
Return values
int|nullisOfHigherPrecedence()
private
isOfHigherPrecedence(Token $token) : bool
Parameters
- $token : Token
Return values
boolisOperandOfInterest()
private
isOperandOfInterest(Token $token) : bool
Parameters
- $token : Token
Return values
boolisOperatorOfInterest()
private
isOperatorOfInterest(Token $token) : bool
Parameters
- $token : Token
Return values
boolkeepParentheses()
private
keepParentheses(Tokens $tokens, int $openParenthesisIndex, int $closeParenthesisIndex) : bool
Parameters
- $tokens : Tokens
- $openParenthesisIndex : int
- $closeParenthesisIndex : int