Documentation

Factory
in package

FinalYes

Table of Contents

Properties

$customComparators  : array<string|int, mixed>
$defaultComparators  : array<string|int, mixed>
$instance  : Factory|null

Methods

__construct()  : mixed
getComparatorFor()  : Comparator
getInstance()  : self
register()  : void
Registers a new comparator.
reset()  : void
unregister()  : void
Unregisters a comparator.
registerDefaultComparator()  : void
registerDefaultComparators()  : void

Properties

$customComparators

private array<string|int, mixed> $customComparators = []
Tags
psalm-var

list<Comparator>

$defaultComparators

private array<string|int, mixed> $defaultComparators = []
Tags
psalm-var

list<Comparator>

Methods

__construct()

public __construct() : mixed

getComparatorFor()

public getComparatorFor(mixed $expected, mixed $actual) : Comparator
Parameters
$expected : mixed
$actual : mixed
Return values
Comparator

getInstance()

public static getInstance() : self
Return values
self

register()

Registers a new comparator.

public register(Comparator $comparator) : void

This comparator will be returned by getComparatorFor() if its accept() method returns TRUE for the compared values. It has higher priority than the existing comparators, meaning that its accept() method will be invoked before those of the other comparators.

Parameters
$comparator : Comparator

unregister()

Unregisters a comparator.

public unregister(Comparator $comparator) : void

This comparator will no longer be considered by getComparatorFor().

Parameters
$comparator : Comparator

registerDefaultComparators()

private registerDefaultComparators() : void

        
On this page

Search results