Documentation

GroupImportFixer extends AbstractFixer
in package

Tags
author

Volodymyr Kupriienko vldmr.kuprienko@gmail.com

Table of Contents

getDefinition()  : mixed
{@inheritdoc}
isCandidate()  : mixed
{@inheritdoc}
applyFix()  : mixed
{@inheritdoc}
addGroupUseStatements()  : mixed
areDeclarationsDifferent()  : bool
Check if namespace use analyses are different.
createNewGroup()  : int
Creates new use statement group.
getNamespaceNameWithSlash()  : string
getSameNamespaces()  : array<string|int, NamespaceUseAnalysis>
Gets namespace use analyzers with same namespaces.
insertToGroupUseWithAlias()  : int
Insert use with alias to the group.
removeSingleUseStatements()  : mixed

Methods

getDefinition()

{@inheritdoc}

public getDefinition() : mixed
Return values
mixed

applyFix()

{@inheritdoc}

protected applyFix(SplFileInfo $file, Tokens $tokens) : mixed
Parameters
$file : SplFileInfo
$tokens : Tokens
Return values
mixed

addGroupUseStatements()

private addGroupUseStatements(array<string|int, NamespaceUseAnalysis$statements, Tokens $tokens) : mixed
Parameters
$statements : array<string|int, NamespaceUseAnalysis>
$tokens : Tokens
Return values
mixed

areDeclarationsDifferent()

Check if namespace use analyses are different.

private areDeclarationsDifferent(null|NamespaceUseAnalysis $analysis1, null|NamespaceUseAnalysis $analysis2) : bool
Parameters
$analysis1 : null|NamespaceUseAnalysis
$analysis2 : null|NamespaceUseAnalysis
Return values
bool

createNewGroup()

Creates new use statement group.

private createNewGroup(Tokens $tokens, int $insertIndex, NamespaceUseAnalysis $useDeclaration, string $currentNamespace) : int
Parameters
$tokens : Tokens
$insertIndex : int
$useDeclaration : NamespaceUseAnalysis
$currentNamespace : string
Return values
int

getNamespaceNameWithSlash()

private getNamespaceNameWithSlash(NamespaceUseAnalysis $useDeclaration) : string
Parameters
$useDeclaration : NamespaceUseAnalysis
Return values
string

getSameNamespaces()

Gets namespace use analyzers with same namespaces.

private getSameNamespaces(Tokens $tokens) : array<string|int, NamespaceUseAnalysis>
Parameters
$tokens : Tokens
Return values
array<string|int, NamespaceUseAnalysis>

insertToGroupUseWithAlias()

Insert use with alias to the group.

private insertToGroupUseWithAlias(Tokens $tokens, int $insertIndex, NamespaceUseAnalysis $useDeclaration) : int
Parameters
$tokens : Tokens
$insertIndex : int
$useDeclaration : NamespaceUseAnalysis
Return values
int

removeSingleUseStatements()

private removeSingleUseStatements(array<string|int, NamespaceUseAnalysis$statements, Tokens $tokens) : mixed
Parameters
$statements : array<string|int, NamespaceUseAnalysis>
$tokens : Tokens
Return values
mixed

Search results