Documentation

OrderedImportsFixer extends AbstractFixer
in package
implements ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface

Tags
author

Sebastiaan Stok s.stok@rollerscapes.net

author

Dariusz RumiƄski dariusz.ruminski@gmail.com

author

SpacePossum

author

Darius Matulionis darius@matulionis.lt

author

Adriano Pilger adriano.pilger@gmail.com

Interfaces, Classes and Traits

ConfigurationDefinitionFixerInterface
WhitespacesAwareFixerInterface

Table of Contents

IMPORT_TYPE_CLASS  = 'class'
IMPORT_TYPE_CONST  = 'const'
IMPORT_TYPE_FUNCTION  = 'function'
SORT_ALPHA  = 'alpha'
SORT_LENGTH  = 'length'
SORT_NONE  = 'none'
$supportedSortAlgorithms  : array<string|int, string>
Array of supported sort algorithms in configuration.
$supportedSortTypes  : array<string|int, string>
Array of supported sort types in configuration.
getDefinition()  : mixed
{@inheritdoc}
getPriority()  : mixed
{@inheritdoc}
isCandidate()  : mixed
{@inheritdoc}
applyFix()  : mixed
{@inheritdoc}
createConfigurationDefinition()  : mixed
{@inheritdoc}
getNewOrder()  : array<string|int, mixed>
prepareNamespace()  : string
sortByAlgorithm()  : array<string|int, mixed>

Constants

Properties

$supportedSortAlgorithms

Array of supported sort algorithms in configuration.

private array<string|int, string> $supportedSortAlgorithms = [self::SORT_ALPHA, self::SORT_LENGTH, self::SORT_NONE]

$supportedSortTypes

Array of supported sort types in configuration.

private array<string|int, string> $supportedSortTypes = [self::IMPORT_TYPE_CLASS, self::IMPORT_TYPE_CONST, self::IMPORT_TYPE_FUNCTION]

Methods

getDefinition()

{@inheritdoc}

public getDefinition() : mixed
Return values
mixed

getPriority()

{@inheritdoc}

public getPriority() : mixed

Must run after GlobalNamespaceImportFixer, NoLeadingImportSlashFixer.

Return values
mixed

applyFix()

{@inheritdoc}

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

createConfigurationDefinition()

{@inheritdoc}

protected createConfigurationDefinition() : mixed
Return values
mixed

getNewOrder()

private getNewOrder(array<string|int, int> $uses, Tokens $tokens) : array<string|int, mixed>
Parameters
$uses : array<string|int, int>
$tokens : Tokens
Return values
array<string|int, mixed>

prepareNamespace()

private prepareNamespace(string $namespace) : string
Parameters
$namespace : string
Return values
string

sortByAlgorithm()

private sortByAlgorithm(array<string|int, array<string|int, mixed>> $indexes) : array<string|int, mixed>
Parameters
$indexes : array<string|int, array<string|int, mixed>>
Return values
array<string|int, mixed>

Search results