Menu

## CachedDoubler extends Doubler
in package

CachedDoubler.php : 22

Cached class doubler.

Prevents mirroring/creation of the same structure twice.

##### Tags

author

  Konstantin Kudryashov ever.zet@gmail.com

### Table of Contents

$classes : mixed
$creator : mixed
$instantiator : Instantiator
$mirror : mixed
$namer : mixed
$patches : array<string|int, ClassPatchInterface>
__construct() : mixed
  Initializes doubler.
double() : DoubleInterface
  Creates double from specific class or/and list of interfaces.
getClassPatches() : array<string|int, ClassPatchInterface>
  Returns list of registered class patches.
registerClassPatch() : mixed
  Registers new class patch.
resetCache() : mixed
createDoubleClass() : string
  Creates double class and returns its FQN.
generateClassId() : string

### Properties

#### $classes

CachedDoubler.php : 24
`private static mixed $classes = array()`

#### $creator

Doubler.php : 30
`private mixed $creator`

#### $instantiator

Doubler.php : 41
`private Instantiator $instantiator`

#### $mirror

Doubler.php : 29
`private mixed $mirror`

#### $namer

Doubler.php : 31
`private mixed $namer`

#### $patches

Doubler.php : 36
`private array<string|int, ClassPatchInterface> $patches = array()`

### Methods

#### __construct()

Doubler.php : 50

Initializes doubler.

`public __construct([ClassMirror $mirror = null ][, ClassCreator $creator = null ][, NameGenerator $namer = null ]) : mixed`

##### Parameters

$mirror : ClassMirror = null
$creator : ClassCreator = null
$namer : NameGenerator = null

##### Return values

mixed —

#### double()

Doubler.php : 93

Creates double from specific class or/and list of interfaces.

`public double([ReflectionClass $class = null ], array<string|int, ReflectionClass> $interfaces[, array<string|int, mixed> $args = null ]) : DoubleInterface`

##### Parameters

$class : ReflectionClass = null
$interfaces : array<string|int, ReflectionClass>

  Array of ReflectionClass instances

$args : array<string|int, mixed> = null

  Constructor arguments

##### Tags

throws
  InvalidArgumentException

##### Return values

DoubleInterface —

#### getClassPatches()

Doubler.php : 63

Returns list of registered class patches.

`public getClassPatches() : array<string|int, ClassPatchInterface>`

##### Return values

array<string|int, ClassPatchInterface> —

#### registerClassPatch()

Doubler.php : 73

Registers new class patch.

`public registerClassPatch(ClassPatchInterface $patch) : mixed`

##### Parameters

$patch : ClassPatchInterface

##### Return values

mixed —

#### resetCache()

CachedDoubler.php : 62
`public resetCache() : mixed`

##### Return values

mixed —

#### createDoubleClass()

CachedDoubler.php : 29

Creates double class and returns its FQN.

`protected createDoubleClass([ReflectionClass $class = null ], array<string|int, mixed> $interfaces) : string`

##### Parameters

$class : ReflectionClass = null
$interfaces : array<string|int, mixed>

##### Return values

string —

#### generateClassId()

CachedDoubler.php : 45
`private generateClassId([ReflectionClass $class = null ], array<string|int, ReflectionClass> $interfaces) : string`

##### Parameters

$class : ReflectionClass = null
$interfaces : array<string|int, ReflectionClass>

##### Return values

string —

## Search results