GlobalNamespaceImportFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- filterUseDeclarations() : array<string|int, mixed>
- findFunctionDeclarations() : mixed
- fullyQualifyClasses() : mixed
- fullyQualifyConstants() : mixed
- fullyQualifyFunctions() : mixed
- importClasses() : array<string|int, mixed>
- importConstants() : array<string|int, mixed>
- importFunctions() : array<string|int, mixed>
- insertImports() : mixed
- prepareImports() : array<string|int, mixed>
- Removes the leading slash at the given indexes (when the name is not already used).
- traverseDocBlockTypes() : mixed
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NoUnusedImportsFixer, OrderedImportsFixer. Must run after NativeConstantInvocationFixer, NativeFunctionInvocationFixer.
Return values
mixed —isCandidate()
{@inheritdoc}
public
isCandidate(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
Return values
mixed —applyFix()
{@inheritdoc}
protected
applyFix(SplFileInfo $file, Tokens $tokens) : mixed
Parameters
- $file : SplFileInfo
- $tokens : Tokens
Return values
mixed —createConfigurationDefinition()
protected
createConfigurationDefinition() : mixed
Return values
mixed —filterUseDeclarations()
private
filterUseDeclarations(array<string|int, NamespaceUseAnalysis> $declarations, callable $callback, bool $caseSensitive) : array<string|int, mixed>
Parameters
- $declarations : array<string|int, NamespaceUseAnalysis>
- $callback : callable
- $caseSensitive : bool
Return values
array<string|int, mixed> —findFunctionDeclarations()
private
findFunctionDeclarations(Tokens $tokens, mixed $start, mixed $end) : mixed
Parameters
- $tokens : Tokens
- $start : mixed
- $end : mixed
Return values
mixed —fullyQualifyClasses()
private
fullyQualifyClasses(Tokens $tokens, array<string|int, NamespaceUseAnalysis> $useDeclarations) : mixed
Parameters
- $tokens : Tokens
- $useDeclarations : array<string|int, NamespaceUseAnalysis>
Return values
mixed —fullyQualifyConstants()
private
fullyQualifyConstants(Tokens $tokens, array<string|int, NamespaceUseAnalysis> $useDeclarations) : mixed
Parameters
- $tokens : Tokens
- $useDeclarations : array<string|int, NamespaceUseAnalysis>
Return values
mixed —fullyQualifyFunctions()
private
fullyQualifyFunctions(Tokens $tokens, array<string|int, NamespaceUseAnalysis> $useDeclarations) : mixed
Parameters
- $tokens : Tokens
- $useDeclarations : array<string|int, NamespaceUseAnalysis>
Return values
mixed —importClasses()
private
importClasses(Tokens $tokens, array<string|int, NamespaceUseAnalysis> $useDeclarations) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $useDeclarations : array<string|int, NamespaceUseAnalysis>
Return values
array<string|int, mixed> —importConstants()
private
importConstants(Tokens $tokens, array<string|int, NamespaceUseAnalysis> $useDeclarations) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $useDeclarations : array<string|int, NamespaceUseAnalysis>
Return values
array<string|int, mixed> —importFunctions()
private
importFunctions(Tokens $tokens, array<string|int, NamespaceUseAnalysis> $useDeclarations) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $useDeclarations : array<string|int, NamespaceUseAnalysis>
Return values
array<string|int, mixed> —insertImports()
private
insertImports(Tokens $tokens, array<string|int, mixed> $imports, array<string|int, NamespaceUseAnalysis> $useDeclarations) : mixed
Parameters
- $tokens : Tokens
- $imports : array<string|int, mixed>
- $useDeclarations : array<string|int, NamespaceUseAnalysis>
Return values
mixed —prepareImports()
Removes the leading slash at the given indexes (when the name is not already used).
private
prepareImports(Tokens $tokens, array<string|int, int> $indexes, array<string|int, mixed> $global, array<string|int, mixed> $other, bool $caseSensitive) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $indexes : array<string|int, int>
- $global : array<string|int, mixed>
- $other : array<string|int, mixed>
- $caseSensitive : bool
Return values
array<string|int, mixed> —array keys contain the names that must be imported
traverseDocBlockTypes()
private
traverseDocBlockTypes(DocBlock $doc, callable $callback) : mixed
Parameters
- $doc : DocBlock
- $callback : callable