Documentation

PhpUnitConstructFixer extends AbstractPhpUnitFixer
in package
implements ConfigurableFixerInterface uses ConfigurableFixerTrait

FinalYes
Tags
author

Dariusz Rumiński dariusz.ruminski@gmail.com

implements

ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>

phpstan-type

_AutogeneratedInputConfiguration array{ assertions?: list<'assertEquals'|'assertNotEquals'|'assertNotSame'|'assertSame'> }

phpstan-type

_AutogeneratedComputedConfiguration array{ assertions: list<'assertEquals'|'assertNotEquals'|'assertNotSame'|'assertSame'> }

Table of Contents

Interfaces

ConfigurableFixerInterface

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
fixAssert()  : int|null
fixAssertNegative()  : int|null
fixAssertPositive()  : int|null

Methods

getPriority()

Returns the priority of the fixer.

public getPriority() : int

Must run before PhpUnitDedicateAssertFixer.

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
Tags
uses
fixAssertNegative()
uses
fixAssertPositive()

fixAssert()

private fixAssert(array<string, string> $map, Tokens $tokens, int $index, string $method) : int|null
Parameters
$map : array<string, string>
$tokens : Tokens
$index : int
$method : string
Return values
int|null

fixAssertNegative()

private fixAssertNegative(Tokens $tokens, int $index, string $method) : int|null
Parameters
$tokens : Tokens
$index : int
$method : string
Return values
int|null

fixAssertPositive()

private fixAssertPositive(Tokens $tokens, int $index, string $method) : int|null
Parameters
$tokens : Tokens
$index : int
$method : string
Return values
int|null

        
On this page

Search results