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
$defaultComparators
private
array<string|int, mixed>
$defaultComparators
= []
Tags
$instance
private
static Factory|null
$instance
= null
Methods
__construct()
public
__construct() : mixed
getComparatorFor()
public
getComparatorFor(mixed $expected, mixed $actual) : Comparator
Parameters
- $expected : mixed
- $actual : mixed
Return values
ComparatorgetInstance()
public
static getInstance() : self
Return values
selfregister()
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
reset()
public
reset() : void
unregister()
Unregisters a comparator.
public
unregister(Comparator $comparator) : void
This comparator will no longer be considered by getComparatorFor().
Parameters
- $comparator : Comparator
registerDefaultComparator()
private
registerDefaultComparator(Comparator $comparator) : void
Parameters
- $comparator : Comparator
registerDefaultComparators()
private
registerDefaultComparators() : void