Documentation

TernaryToElvisOperatorFixer extends AbstractFixer
in package

Tags
author

SpacePossum

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

getPriority()

{@inheritdoc}

public getPriority() : mixed

Must run before NoTrailingWhitespaceFixer, TernaryOperatorSpacesFixer.

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

Search results