Documentation

LambdaNotUsedImportFixer extends AbstractFixer
in package

Tags
author

SpacePossum

Table of Contents

$argumentsAnalyzer  : ArgumentsAnalyzer
$functionAnalyzer  : FunctionsAnalyzer
$tokensAnalyzer  : TokensAnalyzer
getDefinition()  : mixed
{@inheritdoc}
getPriority()  : mixed
{@inheritdoc}
isCandidate()  : mixed
{@inheritdoc}
applyFix()  : mixed
clearImports()  : mixed
clearImportsAndUse()  : mixed
Remove `use` and all imported variables.
countImportsUsedAsArgument()  : array<string|int, mixed>
filterArguments()  : array<string|int, mixed>
findNotUsedLambdaImports()  : array<string|int, mixed>
fixLambda()  : mixed
getLambdaUseIndex()  : false|int

Properties

Methods

getPriority()

{@inheritdoc}

public getPriority() : mixed

Must run before NoSpacesInsideParenthesisFixer.

Return values
mixed

clearImports()

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

clearImportsAndUse()

Remove `use` and all imported variables.

private clearImportsAndUse(Tokens $tokens, int $lambdaUseIndex, int $lambdaUseCloseBraceIndex) : mixed
Parameters
$tokens : Tokens
$lambdaUseIndex : int
$lambdaUseCloseBraceIndex : int
Return values
mixed

countImportsUsedAsArgument()

private countImportsUsedAsArgument(Tokens $tokens, array<string|int, mixed> $imports, array<string|int, mixed> $arguments) : array<string|int, mixed>
Parameters
$tokens : Tokens
$imports : array<string|int, mixed>
$arguments : array<string|int, mixed>
Return values
array<string|int, mixed>

filterArguments()

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

findNotUsedLambdaImports()

private findNotUsedLambdaImports(Tokens $tokens, array<string|int, mixed> $imports, int $lambdaUseCloseBraceIndex) : array<string|int, mixed>
Parameters
$tokens : Tokens
$imports : array<string|int, mixed>
$lambdaUseCloseBraceIndex : int
Return values
array<string|int, mixed>

Search results