class VarCloner extends AbstractCloner

Properties

static $defaultCasters from AbstractCloner

Methods

__construct(array $casters = null)

No description

addCasters(array $casters)

Adds casters for resources and objects.

setMaxItems(int $maxItems)

Sets the maximum number of items to clone past the minimum depth in nested structures.

setMaxString(int $maxString)

Sets the maximum cloned length for strings.

setMinDepth(int $minDepth)

Sets the minimum tree depth where we are guaranteed to clone all the items. After this depth is reached, only setMaxItems items will be cloned.

cloneVar(mixed $var, int $filter)

Clones a PHP variable.

Details

in AbstractCloner at line line 145
__construct(array $casters = null)

Parameters

array $casters A map of casters

See also

addCasters

in AbstractCloner at line line 163
addCasters(array $casters)

Adds casters for resources and objects.

Maps resources or objects types to a callback. Types are in the key, with a callable caster for value. Resource types are to be prefixed with a :, see e.g. static::$defaultCasters.

Parameters

array $casters A map of casters

in AbstractCloner at line line 175
setMaxItems(int $maxItems)

Sets the maximum number of items to clone past the minimum depth in nested structures.

Parameters

int $maxItems

in AbstractCloner at line line 185
setMaxString(int $maxString)

Sets the maximum cloned length for strings.

Parameters

int $maxString

in AbstractCloner at line line 196
setMinDepth(int $minDepth)

Sets the minimum tree depth where we are guaranteed to clone all the items. After this depth is reached, only setMaxItems items will be cloned.

Parameters

int $minDepth

in AbstractCloner at line line 209
Data cloneVar(mixed $var, int $filter)

Clones a PHP variable.

Parameters

mixed $var Any PHP variable
int $filter A bit field of Caster::EXCLUDE_* constants

Return Value

Data The cloned variable represented by a Data object