abstract class AbstractCloner implements ClonerInterface
AbstractCloner implements a generic caster mechanism for objects and resources.
static | $defaultCasters | ||
protected | $maxItems | ||
protected | $maxString | ||
protected | $minDepth |
__construct(array $casters = null) | ||
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. | ||
Data | cloneVar(mixed $var, int $filter = 0) Clones a PHP variable. | |
array | doClone(mixed $var) Effectively clones the PHP variable. | |
array | castObject(Stub $stub, bool $isNested) Casts an object to an array representation. | |
array | castResource(Stub $stub, bool $isNested) Casts a resource to an array representation. |
array | $casters | A map of casters |
addCasters |
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.
array | $casters | A map of casters |
Sets the maximum number of items to clone past the minimum depth in nested structures.
int | $maxItems |
Sets the maximum cloned length for strings.
int | $maxString |
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.
int | $minDepth |
Clones a PHP variable.
mixed | $var | Any PHP variable |
int | $filter | A bit field of Caster::EXCLUDE_* constants |
Data | The cloned variable represented by a Data object |
Effectively clones the PHP variable.
mixed | $var | Any PHP variable |
array | The cloned variable represented in an array |
Casts an object to an array representation.
Stub | $stub | The Stub for the casted object |
bool | $isNested | True if the object is nested in the dumped structure |
array | The object casted as array |
Casts a resource to an array representation.
Stub | $stub | The Stub for the casted resource |
bool | $isNested | True if the object is nested in the dumped structure |
array | The resource casted as array |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/VarDumper/Cloner/AbstractCloner.html