Documentation

PhpUnitTestAnnotationFixer extends AbstractPhpUnitFixer
in package
implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface uses ConfigurableFixerTrait

FinalYes
Tags
author

Gert de Pagter

implements

ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>

phpstan-type

_AutogeneratedInputConfiguration array{ style?: 'annotation'|'prefix' }

phpstan-type

_AutogeneratedComputedConfiguration array{ style: 'annotation'|'prefix' }

Table of Contents

Interfaces

ConfigurableFixerInterface
WhitespacesAwareFixerInterface

Methods

getDefinition()  : FixerDefinitionInterface
Returns the definition of the fixer.
getPriority()  : int
Returns the priority of the fixer.
isRisky()  : bool
Check if fixer is risky or not.
applyPhpUnitClassFix()  : void
createConfigurationDefinition()  : FixerConfigurationResolverInterface
addTestAnnotation()  : array<int, Line>
addTestPrefix()  : string
addTestPrefixToDependsAnnotation()  : Line
applyTestAnnotation()  : void
applyTestPrefix()  : void
createDocBlock()  : void
doesDocBlockContainTest()  : bool
findWhereDependsFunctionNameStarts()  : int
Helps to find where the function name in the doc block starts.
getSingleLineDocBlockEntry()  : string
hasProperTestAnnotation()  : bool
hasTestPrefix()  : bool
isMethod()  : bool
isTestMethod()  : bool
removeTestPrefix()  : string
removeTestPrefixFromDependsAnnotation()  : Line
splitUpDocBlock()  : array<int, Line>
Take a one line doc block, and turn it into a multi line doc block.
updateDependsAnnotation()  : Line
Updates the depends tag on the current doc block.
updateDocBlock()  : array<int, Line>
updateLines()  : array<int, Line>

Methods

getPriority()

Returns the priority of the fixer.

public getPriority() : int

Must run before NoEmptyPhpdocFixer, PhpUnitMethodCasingFixer, PhpdocTrimFixer.

Return values
int

isRisky()

Check if fixer is risky or not.

public isRisky() : bool

Risky fixer could change code behavior!

Return values
bool

applyPhpUnitClassFix()

protected applyPhpUnitClassFix(Tokens $tokens, int $startIndex, int $endIndex) : void
Parameters
$tokens : Tokens
$startIndex : int
$endIndex : int

addTestPrefix()

private addTestPrefix(string $functionName) : string
Parameters
$functionName : string
Return values
string

findWhereDependsFunctionNameStarts()

Helps to find where the function name in the doc block starts.

private findWhereDependsFunctionNameStarts(array<int, string> $line) : int
Parameters
$line : array<int, string>
Return values
int

getSingleLineDocBlockEntry()

private getSingleLineDocBlockEntry(array<int, Line$lines) : string
Parameters
$lines : array<int, Line>
Tags
todo

check whether it's doable to use \PhpCsFixer\DocBlock\DocBlock::getSingleLineDocBlockEntry instead

Return values
string

hasTestPrefix()

private hasTestPrefix(string $functionName) : bool
Parameters
$functionName : string
Return values
bool

removeTestPrefix()

private removeTestPrefix(string $functionName) : string
Parameters
$functionName : string
Return values
string

splitUpDocBlock()

Take a one line doc block, and turn it into a multi line doc block.

private splitUpDocBlock(array<int, Line$lines, Tokens $tokens, int $docBlockIndex) : array<int, Line>
Parameters
$lines : array<int, Line>
$tokens : Tokens
$docBlockIndex : int
Return values
array<int, Line>

        
On this page

Search results