LazyDouble
in package
Lazy double.
Gives simple interface to describe double before creating it.
Tags
Table of Contents
- $arguments : mixed
- $class : mixed
- $double : mixed
- $doubler : mixed
- $interfaces : mixed
- __construct() : mixed
- Initializes lazy double.
- addInterface() : mixed
- Tells doubler to implement specific interface with double.
- getInstance() : DoubleInterface
- Creates double instance or returns already created one.
- setArguments() : mixed
- Sets constructor arguments.
- setParentClass() : mixed
- Tells doubler to use specific class as parent one for double.
Properties
$arguments
private
mixed
$arguments
= null
$class
private
mixed
$class
$double
private
mixed
$double
$doubler
private
mixed
$doubler
$interfaces
private
mixed
$interfaces
= array()
Methods
__construct()
Initializes lazy double.
public
__construct(Doubler $doubler) : mixed
Parameters
- $doubler : Doubler
Return values
mixed —addInterface()
Tells doubler to implement specific interface with double.
public
addInterface(string|ReflectionClass $interface) : mixed
Parameters
- $interface : string|ReflectionClass
Tags
Return values
mixed —getInstance()
Creates double instance or returns already created one.
public
getInstance() : DoubleInterface
Return values
DoubleInterface —setArguments()
Sets constructor arguments.
public
setArguments([array<string|int, mixed> $arguments = null ]) : mixed
Parameters
- $arguments : array<string|int, mixed> = null
Return values
mixed —setParentClass()
Tells doubler to use specific class as parent one for double.
public
setParentClass(string|ReflectionClass $class) : mixed
Parameters
- $class : string|ReflectionClass