FunctionToConstantFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- $availableFunctions : array<string, array<string|int, Token>>
- $functionsFixMap : array<string, array<string|int, Token>>
- __construct() : mixed
- configure() : mixed
- {@inheritdoc}
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- isRisky() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- fixFunctionCallToConstant() : mixed
- fixGetClassCall() : null|array<string|int, mixed>
- getReplaceCandidate() : null|array<string|int, mixed>
- getReplacementTokenClones() : array<string|int, mixed>
Properties
$availableFunctions
private
static array<string, array<string|int, Token>>
$availableFunctions
$functionsFixMap
private
array<string, array<string|int, Token>>
$functionsFixMap
Methods
__construct()
public
__construct() : mixed
Return values
mixed —configure()
{@inheritdoc}
public
configure([array<string|int, mixed> $configuration = null ]) : mixed
Parameters
- $configuration : array<string|int, mixed> = null
Return values
mixed —getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NativeFunctionCasingFixer, NoExtraBlankLinesFixer, NoSinglelineWhitespaceBeforeSemicolonsFixer, NoTrailingWhitespaceFixer, NoWhitespaceInBlankLineFixer, SelfStaticAccessorFixer. Must run after NoSpacesAfterFunctionNameFixer, NoSpacesInsideParenthesisFixer.
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 —createConfigurationDefinition()
{@inheritdoc}
protected
createConfigurationDefinition() : mixed
Return values
mixed —fixFunctionCallToConstant()
private
fixFunctionCallToConstant(Tokens $tokens, int $index, int $braceOpenIndex, int $braceCloseIndex, array<string|int, Token> $replacements) : mixed
Parameters
- $tokens : Tokens
- $index : int
- $braceOpenIndex : int
- $braceCloseIndex : int
- $replacements : array<string|int, Token>
Return values
mixed —fixGetClassCall()
private
fixGetClassCall(Tokens $tokens, FunctionsAnalyzer $functionAnalyzer, int $index) : null|array<string|int, mixed>
Parameters
- $tokens : Tokens
- $functionAnalyzer : FunctionsAnalyzer
- $index : int
Return values
null|array<string|int, mixed> —getReplaceCandidate()
private
getReplaceCandidate(Tokens $tokens, FunctionsAnalyzer $functionAnalyzer, int $index) : null|array<string|int, mixed>
Parameters
- $tokens : Tokens
- $functionAnalyzer : FunctionsAnalyzer
- $index : int
Return values
null|array<string|int, mixed> —getReplacementTokenClones()
private
getReplacementTokenClones(string $lowerContent, int $braceOpenIndex, int $braceCloseIndex) : array<string|int, mixed>
Parameters
- $lowerContent : string
- $braceOpenIndex : int
- $braceCloseIndex : int