LongToShorthandOperatorFixer
extends AbstractShortOperatorFixer
in package
FinalYes
Table of Contents
Properties
- $operators : array<string, array{: int, : string}>
- $operatorTypes : array<int, string>
- $tokensAnalyzer : TokensAnalyzer
Methods
- getDefinition() : FixerDefinitionInterface
- getPriority() : int
- {@inheritdoc}
- isCandidate() : bool
- isRisky() : bool
- applyFix() : void
- getReplacementToken() : Token
- isOperatorTokenCandidate() : bool
Properties
$operators
private
static array<string, array{: int, : string}>
$operators
= ['+' => [T_PLUS_EQUAL, '+='], '-' => [T_MINUS_EQUAL, '-='], '*' => [T_MUL_EQUAL, '*='], '/' => [T_DIV_EQUAL, '/='], '&' => [T_AND_EQUAL, '&='], '.' => [T_CONCAT_EQUAL, '.='], '%' => [T_MOD_EQUAL, '%='], '|' => [T_OR_EQUAL, '|='], '^' => [T_XOR_EQUAL, '^=']]
$operatorTypes
private
array<int, string>
$operatorTypes
$tokensAnalyzer
private
TokensAnalyzer
$tokensAnalyzer
Methods
getDefinition()
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfacegetPriority()
{@inheritdoc}
public
getPriority() : int
Must run before BinaryOperatorSpacesFixer, NoExtraBlankLinesFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, StandardizeIncrementFixer.
Return values
intisCandidate()
public
isCandidate(Tokens $tokens) : bool
Parameters
- $tokens : Tokens
Return values
boolisRisky()
public
isRisky() : bool
Return values
boolapplyFix()
protected
applyFix(SplFileInfo $file, Tokens $tokens) : void
Parameters
- $file : SplFileInfo
- $tokens : Tokens
getReplacementToken()
protected
getReplacementToken(Token $token) : Token
Parameters
- $token : Token
Return values
TokenisOperatorTokenCandidate()
protected
isOperatorTokenCandidate(Tokens $tokens, int $index) : bool
Parameters
- $tokens : Tokens
- $index : int