NoUnusedImportsFixer
extends AbstractFixer
in package
Tags
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- supports() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- isImportUsed() : bool
- removeUseDeclaration() : mixed
- removeUsesInSameNamespace() : mixed
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before BlankLineAfterNamespaceFixer, NoExtraBlankLinesFixer, NoLeadingImportSlashFixer, SingleLineAfterImportsFixer. Must run after ClassKeywordRemoveFixer, GlobalNamespaceImportFixer, PhpUnitFqcnAnnotationFixer, SingleImportPerStatementFixer.
Return values
mixed —isCandidate()
{@inheritdoc}
public
isCandidate(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
Return values
mixed —supports()
{@inheritdoc}
public
supports(SplFileInfo $file) : mixed
Parameters
- $file : SplFileInfo
Return values
mixed —applyFix()
{@inheritdoc}
protected
applyFix(SplFileInfo $file, Tokens $tokens) : mixed
Parameters
- $file : SplFileInfo
- $tokens : Tokens
Return values
mixed —isImportUsed()
private
isImportUsed(Tokens $tokens, NamespaceAnalysis $namespace, array<int, int> $ignoredIndexes, string $shortName) : bool
Parameters
- $tokens : Tokens
- $namespace : NamespaceAnalysis
- $ignoredIndexes : array<int, int>
- $shortName : string
Return values
bool —removeUseDeclaration()
private
removeUseDeclaration(Tokens $tokens, NamespaceUseAnalysis $useDeclaration) : mixed
Parameters
- $tokens : Tokens
- $useDeclaration : NamespaceUseAnalysis
Return values
mixed —removeUsesInSameNamespace()
private
removeUsesInSameNamespace(Tokens $tokens, array<string|int, mixed> $useDeclarations, NamespaceAnalysis $namespaceDeclaration) : mixed
Parameters
- $tokens : Tokens
- $useDeclarations : array<string|int, mixed>
- $namespaceDeclaration : NamespaceAnalysis