Documentation

OrderedTypesFixer extends AbstractFixer
in package
implements ConfigurableFixerInterface uses ConfigurableFixerTrait

FinalYes
Tags
author

John Paul E. Balandan, CPA paulbalandan@gmail.com

implements

ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>

phpstan-type

_AutogeneratedInputConfiguration array{ case_sensitive?: bool, null_adjustment?: 'always_first'|'always_last'|'none', sort_algorithm?: 'alpha'|'none' }

phpstan-type

_AutogeneratedComputedConfiguration array{ case_sensitive: bool, null_adjustment: 'always_first'|'always_last'|'none', sort_algorithm: 'alpha'|'none' }

Table of Contents

Interfaces

ConfigurableFixerInterface

Methods

getDefinition()  : FixerDefinitionInterface
Returns the definition of the fixer.
getPriority()  : int
Returns the priority of the fixer.
isCandidate()  : bool
Check if the fixer is a candidate for given Tokens collection.
applyFix()  : void
createConfigurationDefinition()  : FixerConfigurationResolverInterface
collectDisjunctiveNormalFormTypes()  : array{0: list|string>, 1: string}
collectTypeAnalysis()  : TypeAnalysis|null
collectUnionOrIntersectionTypes()  : array{0: list, 1: string}
createTypeDeclarationTokens()  : array<int, Token>
fixCatchArgumentType()  : void
fixMethodArgumentType()  : void
fixMethodReturnType()  : void
fixPropertyType()  : void
getElements()  : array<int, string>
isTypeSortable()  : bool
runTypesThroughSortingAlgorithm()  : mixed
sortTypes()  : void

Methods

getPriority()

Returns the priority of the fixer.

public getPriority() : int

Must run before TypesSpacesFixer. Must run after NullableTypeDeclarationFixer, NullableTypeDeclarationForDefaultNullValueFixer.

Return values
int

isCandidate()

Check if the fixer is a candidate for given Tokens collection.

public isCandidate(Tokens $tokens) : bool

Fixer is a candidate when the collection contains tokens that may be fixed during fixer work. This could be considered as some kind of bloom filter. When this method returns true then to the Tokens collection may or may not need a fixing, but when this method returns false then the Tokens collection need no fixing for sure.

Parameters
$tokens : Tokens
Return values
bool

collectDisjunctiveNormalFormTypes()

private collectDisjunctiveNormalFormTypes(string $type) : array{0: list|string>, 1: string}
Parameters
$type : string
Return values
array{0: list|string>, 1: string}

collectTypeAnalysis()

private collectTypeAnalysis(Tokens $tokens, int $startIndex, int $endIndex) : TypeAnalysis|null
Parameters
$tokens : Tokens
$startIndex : int
$endIndex : int
Return values
TypeAnalysis|null

collectUnionOrIntersectionTypes()

private collectUnionOrIntersectionTypes(string $type) : array{0: list, 1: string}
Parameters
$type : string
Return values
array{0: list, 1: string}

createTypeDeclarationTokens()

private createTypeDeclarationTokens(array<int, array<int, string>|string> $types, string $glue[, bool $isDisjunctive = false ]) : array<int, Token>
Parameters
$types : array<int, array<int, string>|string>
$glue : string
$isDisjunctive : bool = false
Return values
array<int, Token>

fixMethodArgumentType()

private fixMethodArgumentType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index) : void
Parameters
$functionsAnalyzer : FunctionsAnalyzer
$tokens : Tokens
$index : int

fixMethodReturnType()

private fixMethodReturnType(FunctionsAnalyzer $functionsAnalyzer, Tokens $tokens, int $index) : void
Parameters
$functionsAnalyzer : FunctionsAnalyzer
$tokens : Tokens
$index : int

getElements()

private getElements(Tokens $tokens) : array<int, string>
Parameters
$tokens : Tokens
Tags
phpstan-return

array<int, 'catch'|'method'|'property'>

Return values
array<int, string>

isTypeSortable()

private isTypeSortable(TypeAnalysis $type) : bool
Parameters
$type : TypeAnalysis
Return values
bool

runTypesThroughSortingAlgorithm()

private runTypesThroughSortingAlgorithm(array<int, array<int, string>|string> $types) : mixed
Parameters
$types : array<int, array<int, string>|string>

sortTypes()

private sortTypes(TypeAnalysis $typeAnalysis, Tokens $tokens) : void
Parameters
$typeAnalysis : TypeAnalysis
$tokens : Tokens

        
On this page

Search results