TernaryToElvisOperatorFixer
extends AbstractFixer
in package
Tags
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- isRisky() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- clearMeaningfulFromRange() : mixed
- getAfterOperator() : array<string|int, mixed>
- getBeforeOperator() : null|array<string|int, mixed>
- rangeEqualsRange() : bool
- Meaningful compare of tokens within ranges.
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NoTrailingWhitespaceFixer, TernaryOperatorSpacesFixer.
Return values
mixed —isCandidate()
{@inheritdoc}
public
isCandidate(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
Return values
mixed —isRisky()
{@inheritdoc}
public
isRisky() : mixed
Return values
mixed —applyFix()
{@inheritdoc}
protected
applyFix(SplFileInfo $file, Tokens $tokens) : mixed
Parameters
- $file : SplFileInfo
- $tokens : Tokens
Return values
mixed —clearMeaningfulFromRange()
private
clearMeaningfulFromRange(Tokens $tokens, array<string|int, mixed> $range) : mixed
Parameters
- $tokens : Tokens
- $range : array<string|int, mixed>
Return values
mixed —getAfterOperator()
private
getAfterOperator(Tokens $tokens, int $index) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $index : int
Return values
array<string|int, mixed> —getBeforeOperator()
private
getBeforeOperator(Tokens $tokens, int $index, array<string|int, mixed> $blockEdgeDefinitions) : null|array<string|int, mixed>
Parameters
- $tokens : Tokens
- $index : int
- $blockEdgeDefinitions : array<string|int, mixed>
Return values
null|array<string|int, mixed> —null if contains ++/-- operator
rangeEqualsRange()
Meaningful compare of tokens within ranges.
private
rangeEqualsRange(Tokens $tokens, array<string|int, mixed> $range1, array<string|int, mixed> $range2) : bool
Parameters
- $tokens : Tokens
- $range1 : array<string|int, mixed>
- $range2 : array<string|int, mixed>