SelfAccessorFixer
extends AbstractFixer
in package
FinalYes
Tags
Table of Contents
Methods
- getDefinition() : FixerDefinitionInterface
- getPriority() : int
- {@inheritdoc}
- isCandidate() : bool
- isRisky() : bool
- applyFix() : void
- getClassStart() : int|null
- replaceNameOccurrences() : void
- Replace occurrences of the name of the classy element by "self" (if possible).
Methods
getDefinition()
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfacegetPriority()
{@inheritdoc}
public
getPriority() : int
Must run after PsrAutoloadingFixer.
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
getClassStart()
private
getClassStart(Tokens $tokens, int $index, string $namespace) : int|null
Parameters
- $tokens : Tokens
- $index : int
- $namespace : string
Return values
int|nullreplaceNameOccurrences()
Replace occurrences of the name of the classy element by "self" (if possible).
private
replaceNameOccurrences(Tokens $tokens, string $namespace, string $name, int $startIndex, int $endIndex) : void
Parameters
- $tokens : Tokens
- $namespace : string
- $name : string
- $startIndex : int
- $endIndex : int