OrderedImportsFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Tags
Interfaces, Classes and Traits
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
IMPORT_TYPE_CLASS
public
mixed
IMPORT_TYPE_CLASS
= 'class'
IMPORT_TYPE_CONST
public
mixed
IMPORT_TYPE_CONST
= 'const'
IMPORT_TYPE_FUNCTION
public
mixed
IMPORT_TYPE_FUNCTION
= 'function'
SORT_ALPHA
public
mixed
SORT_ALPHA
= 'alpha'
SORT_LENGTH
public
mixed
SORT_LENGTH
= 'length'
SORT_NONE
public
mixed
SORT_NONE
= 'none'
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 —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()
{@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>>