FinalInternalClassFixer
extends AbstractFixer
in package
implements
ConfigurableFixerInterface
uses
ConfigurableFixerTrait
FinalYes
Tags
Table of Contents
Interfaces
Constants
- DEFAULTS = ['include' => ['internal'], 'exclude' => ['final', 'Entity', 'ORM\Entity', 'ORM\Mapping\Entity', 'Mapping\Entity', 'Document', 'ODM\Document']]
Properties
- $checkAttributes : bool
Methods
- __construct() : mixed
- getDefinition() : FixerDefinitionInterface
- Returns the definition of the fixer.
- getPriority() : int
- Returns the priority of the fixer.
- isCandidate() : bool
- Check if the fixer is a candidate for given Tokens collection.
- isRisky() : bool
- Check if fixer is risky or not.
- applyFix() : void
- configurePostNormalisation() : void
- createConfigurationDefinition() : FixerConfigurationResolverInterface
- assertConfigHasNoConflicts() : void
- isClassCandidate() : bool
- isClassCandidateBasedOnAttribute() : bool|null
- isClassCandidateBasedOnPhpDoc() : bool|null
- isConfiguredAsInclude() : bool
Constants
DEFAULTS
private
mixed
DEFAULTS
= ['include' => ['internal'], 'exclude' => ['final', 'Entity', 'ORM\Entity', 'ORM\Mapping\Entity', 'Mapping\Entity', 'Document', 'ODM\Document']]
Properties
$checkAttributes
private
bool
$checkAttributes
Methods
__construct()
public
__construct() : mixed
getDefinition()
Returns the definition of the fixer.
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfacegetPriority()
Returns the priority of the fixer.
public
getPriority() : int
Must run before ProtectedToPrivateFixer, SelfStaticAccessorFixer. Must run after PhpUnitInternalClassFixer.
Return values
intisCandidate()
Check if the fixer is a candidate for given Tokens collection.
public
isCandidate(Tokens $tokens) : bool
Fixer is a candidate when the collection contains tokens that may be fixed during fixer work. This could be considered as some kind of bloom filter. When this method returns true then to the Tokens collection may or may not need a fixing, but when this method returns false then the Tokens collection need no fixing for sure.
Parameters
- $tokens : Tokens
Return values
boolisRisky()
Check if fixer is risky or not.
public
isRisky() : bool
Risky fixer could change code behavior!
Return values
boolapplyFix()
protected
applyFix(SplFileInfo $file, Tokens $tokens) : void
Parameters
- $file : SplFileInfo
- $tokens : Tokens
configurePostNormalisation()
protected
configurePostNormalisation() : void
createConfigurationDefinition()
protected
createConfigurationDefinition() : FixerConfigurationResolverInterface
Return values
FixerConfigurationResolverInterfaceassertConfigHasNoConflicts()
private
assertConfigHasNoConflicts() : void
isClassCandidate()
private
isClassCandidate(TokensAnalyzer $tokensAnalyzer, Tokens $tokens, int $index) : bool
Parameters
- $tokensAnalyzer : TokensAnalyzer
- $tokens : Tokens
- $index : int
-
T_CLASS index
Return values
boolisClassCandidateBasedOnAttribute()
private
isClassCandidateBasedOnAttribute(Tokens $tokens, int $startIndex, int $endIndex) : bool|null
Parameters
- $tokens : Tokens
- $startIndex : int
- $endIndex : int
Return values
bool|nullisClassCandidateBasedOnPhpDoc()
private
isClassCandidateBasedOnPhpDoc(Tokens $tokens, int $index) : bool|null
Parameters
- $tokens : Tokens
- $index : int
Return values
bool|nullisConfiguredAsInclude()
private
isConfiguredAsInclude(array<string, bool> $attributes) : bool
Parameters
- $attributes : array<string, bool>