Documentation

TernaryToNullCoalescingFixer extends AbstractFixer
in package

FinalYes
Tags
author

Filippo Tessarotto zoeslam@gmail.com

Table of Contents

Methods

getDefinition()  : FixerDefinitionInterface
getPriority()  : int
{@inheritdoc}
isCandidate()  : bool
applyFix()  : void
fixIsset()  : void
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

getPriority()

{@inheritdoc}

public getPriority() : int

Must run before AssignNullCoalescingToCoalesceEqualFixer.

Return values
int

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
Return values
bool

        
On this page

Search results