TernaryToNullCoalescingFixer
extends AbstractFixer
in package
Tags
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- fixIsset() : mixed
- getMeaningfulSequence() : Tokens
- Get the sequence of meaningful tokens and returns a new Tokens instance.
- hasChangingContent() : bool
- Check if the `isset()` content may change if called multiple times.
- isHigherPrecedenceAssociativityOperator() : bool
- Check if the requested token is an operator computed before the ternary operator along with the `isset()`.
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
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 —fixIsset()
private
fixIsset(Tokens $tokens, int $index) : mixed
Parameters
- $tokens : Tokens
- $index : int
-
of
T_ISSET
token
Return values
mixed —getMeaningfulSequence()
Get the sequence of meaningful tokens and returns a new Tokens instance.
private
getMeaningfulSequence(Tokens $tokens, int $start, int $end) : Tokens
Parameters
- $tokens : Tokens
- $start : int
-
start index
- $end : int
-
end index
Return values
Tokens —hasChangingContent()
Check if the `isset()` content may change if called multiple times.
private
hasChangingContent(Tokens $tokens) : bool
Parameters
- $tokens : Tokens
-
The original token list
Return values
bool —isHigherPrecedenceAssociativityOperator()
Check if the requested token is an operator computed before the ternary operator along with the `isset()`.
private
isHigherPrecedenceAssociativityOperator(Token $token) : bool
Parameters
- $token : Token