CombineNestedDirnameFixer
extends AbstractFixer
in package
FinalYes
Tags
Table of Contents
Methods
- getDefinition() : FixerDefinitionInterface
- getPriority() : int
- {@inheritdoc}
- isCandidate() : bool
- isRisky() : bool
- applyFix() : void
- combineDirnames() : void
-
getDirnameInfo()
: array{indices: list
, secondArgument?: int, levels: int, end: int}|false
Methods
getDefinition()
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfacegetPriority()
{@inheritdoc}
public
getPriority() : int
Must run before MethodArgumentSpaceFixer, NoSpacesInsideParenthesisFixer, SpacesInsideParenthesesFixer. Must run after DirConstantFixer.
Return values
intisCandidate()
public
isCandidate(Tokens $tokens) : bool
Parameters
- $tokens : Tokens
Return values
boolisRisky()
public
isRisky() : bool
Return values
boolapplyFix()
protected
applyFix(SplFileInfo $file, Tokens $tokens) : void
Parameters
- $file : SplFileInfo
- $tokens : Tokens
combineDirnames()
private
combineDirnames(Tokens $tokens, array<int, array{indices: list, secondArgument?: int, levels: int, end: int}> $dirnameInfoArray) : void
Parameters
- $tokens : Tokens
-
$dirnameInfoArray
: array<int, array{indices: list
, secondArgument?: int, levels: int, end: int}>
getDirnameInfo()
private
getDirnameInfo(Tokens $tokens, int $index[, null|int $firstArgumentEndIndex = null ]) : array{indices: list, secondArgument?: int, levels: int, end: int}|false
Parameters
- $tokens : Tokens
- $index : int
-
Index of
dirname
- $firstArgumentEndIndex : null|int = null
-
Index of last token of first argument of
dirname
call
Return values
array{indices: listfalse
when it is not a (supported) dirname
call, an array with info about the dirname call otherwise