Documentation

FinalInternalClassFixer extends AbstractFixer
in package
implements ConfigurableFixerInterface uses ConfigurableFixerTrait

FinalYes
Tags
author

Dariusz Rumiński dariusz.ruminski@gmail.com

implements

ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>

phpstan-type

_AutogeneratedInputConfiguration array{ annotation_exclude?: list, annotation_include?: list, consider_absent_docblock_as_internal_class?: bool, exclude?: list, include?: list }

phpstan-type

_AutogeneratedComputedConfiguration array{ annotation_exclude: array<string, string>, annotation_include: array<string, string>, consider_absent_docblock_as_internal_class: bool, exclude: array<string, string>, include: array<string, string> }

Table of Contents

Interfaces

ConfigurableFixerInterface

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

Methods

getPriority()

Returns the priority of the fixer.

public getPriority() : int

Must run before ProtectedToPrivateFixer, SelfStaticAccessorFixer. Must run after PhpUnitInternalClassFixer.

Return values
int

isCandidate()

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
bool

isRisky()

Check if fixer is risky or not.

public isRisky() : bool

Risky fixer could change code behavior!

Return values
bool

isClassCandidate()

private isClassCandidate(TokensAnalyzer $tokensAnalyzer, Tokens $tokens, int $index) : bool
Parameters
$tokensAnalyzer : TokensAnalyzer
$tokens : Tokens
$index : int

T_CLASS index

Return values
bool

isClassCandidateBasedOnAttribute()

private isClassCandidateBasedOnAttribute(Tokens $tokens, int $startIndex, int $endIndex) : bool|null
Parameters
$tokens : Tokens
$startIndex : int
$endIndex : int
Return values
bool|null

isClassCandidateBasedOnPhpDoc()

private isClassCandidateBasedOnPhpDoc(Tokens $tokens, int $index) : bool|null
Parameters
$tokens : Tokens
$index : int
Return values
bool|null

isConfiguredAsInclude()

private isConfiguredAsInclude(array<string, bool> $attributes) : bool
Parameters
$attributes : array<string, bool>
Return values
bool

        
On this page

Search results