Copied!
  • final
CloneableInstantiable
Methods
public __construct( $useCloneMethod = false)
 
  • param bool $useCloneMethod If set to true, when an object implements the __clone() function, it will be used
    instead of the regular deep cloning.
public addFilter(DeepCopy\Filter\Filter $filter, DeepCopy\Matcher\Matcher $matcher)
public addTypeFilter(DeepCopy\TypeFilter\TypeFilter $filter, DeepCopy\TypeMatcher\TypeMatcher $matcher)
public copy( $object)
 

Deep copies the given object.

  • param mixed $object
  • return mixed
public prependFilter(DeepCopy\Filter\Filter $filter, DeepCopy\Matcher\Matcher $matcher)
public skipUncloneable( $skipUncloneable = true)
 

If enabled, will not throw an exception when coming across an uncloneable property.

  • return $this
Properties
private $filters
 

Filters to apply.

  • var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs.
private $hashMap
 
  • var object[] List of objects copied.
private $skipUncloneable
 
  • var bool
private $typeFilters
 

Type Filters to apply.

  • var array Array of ['filter' => Filter, 'matcher' => Matcher] pairs.
private $useCloneMethod
 
  • var bool
Methods
private copyArray(array $array)
 

Copy an array

  • param array $array
  • return array
private copyObject( $object)
 

Copies an object.

  • param object $object
  • throws CloneException
  • return object
private copyObjectProperty( $object, ReflectionProperty $property)
private first(array $elements, callable $predicate)
 

Returns first element that matches predicate, null if no such element found.

  • param array $elements Array of ['filter' => Filter, 'matcher' => Matcher] pairs.
  • param callable $predicate Predicate arguments are: element.
  • return array|null Associative array with 2 members: 'filter' with value of type {@see \TypeFilter} and 'matcher'
    with value of type {@see \TypeMatcher} or null.
private getFirstMatchedTypeFilter(array $filterRecords, $var)
 

Returns first filter that matches variable, null if no such filter found.

  • param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see \TypeFilter} and
    'matcher' with value of type {@see \TypeMatcher}
  • param mixed $var
  • return TypeFilter|null
private recursiveCopy( $var)
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration