<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace ReloadifyScoped\Symfony\Component\VarDumper\Cloner;

use ReloadifyScoped\Symfony\Component\VarDumper\Caster\Caster;
use ReloadifyScoped\Symfony\Component\VarDumper\Exception\ThrowingCasterException;
/**
 * AbstractCloner implements a generic caster mechanism for objects and resources.
 *
 * @author Nicolas Grekas <p@tchwork.com>
 */
abstract class AbstractCloner implements ClonerInterface
{
    public static $defaultCasters = ['__PHP_Incomplete_Class' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\Caster', 'castPhpIncompleteClass'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\CutStub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castStub'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\CutArrayStub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castCutArray'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ConstStub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castStub'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\EnumStub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'castEnum'], 'Fiber' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\FiberCaster', 'castFiber'], 'Closure' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castClosure'], 'Generator' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castGenerator'], 'ReflectionType' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castType'], 'ReflectionAttribute' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castAttribute'], 'ReflectionGenerator' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castReflectionGenerator'], 'ReflectionClass' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castClass'], 'ReflectionClassConstant' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castClassConstant'], 'ReflectionFunctionAbstract' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castFunctionAbstract'], 'ReflectionMethod' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castMethod'], 'ReflectionParameter' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castParameter'], 'ReflectionProperty' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castProperty'], 'ReflectionReference' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castReference'], 'ReflectionExtension' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castExtension'], 'ReflectionZendExtension' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster', 'castZendExtension'], 'ReloadifyScoped\\Doctrine\\Common\\Persistence\\ObjectManager' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\Doctrine\\Common\\Proxy\\Proxy' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster', 'castCommonProxy'], 'ReloadifyScoped\\Doctrine\\ORM\\Proxy\\Proxy' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster', 'castOrmProxy'], 'ReloadifyScoped\\Doctrine\\ORM\\PersistentCollection' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster', 'castPersistentCollection'], 'ReloadifyScoped\\Doctrine\\Persistence\\ObjectManager' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'DOMException' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castException'], 'DOMStringList' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMNameList' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMImplementation' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castImplementation'], 'DOMImplementationList' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMNode' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castNode'], 'DOMNameSpaceNode' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castNameSpaceNode'], 'DOMDocument' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castDocument'], 'DOMNodeList' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMNamedNodeMap' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLength'], 'DOMCharacterData' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castCharacterData'], 'DOMAttr' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castAttr'], 'DOMElement' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castElement'], 'DOMText' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castText'], 'DOMTypeinfo' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castTypeinfo'], 'DOMDomError' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castDomError'], 'DOMLocator' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castLocator'], 'DOMDocumentType' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castDocumentType'], 'DOMNotation' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castNotation'], 'DOMEntity' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castEntity'], 'DOMProcessingInstruction' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castProcessingInstruction'], 'DOMXPath' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DOMCaster', 'castXPath'], 'XMLReader' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\XmlReaderCaster', 'castXmlReader'], 'ErrorException' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castErrorException'], 'Exception' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castException'], 'Error' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castError'], 'ReloadifyScoped\\Symfony\\Bridge\\Monolog\\Logger' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\Symfony\\Component\\DependencyInjection\\ContainerInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\Symfony\\Component\\HttpClient\\AmpHttpClient' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClient'], 'ReloadifyScoped\\Symfony\\Component\\HttpClient\\CurlHttpClient' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClient'], 'ReloadifyScoped\\Symfony\\Component\\HttpClient\\NativeHttpClient' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClient'], 'ReloadifyScoped\\Symfony\\Component\\HttpClient\\Response\\AmpResponse' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClientResponse'], 'ReloadifyScoped\\Symfony\\Component\\HttpClient\\Response\\CurlResponse' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClientResponse'], 'ReloadifyScoped\\Symfony\\Component\\HttpClient\\Response\\NativeResponse' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castHttpClientResponse'], 'ReloadifyScoped\\Symfony\\Component\\HttpFoundation\\Request' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castRequest'], 'ReloadifyScoped\\Symfony\\Component\\Uid\\Ulid' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castUlid'], 'ReloadifyScoped\\Symfony\\Component\\Uid\\Uuid' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SymfonyCaster', 'castUuid'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castThrowingCasterException'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\TraceStub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castTraceStub'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\FrameStub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castFrameStub'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\Symfony\\Component\\ErrorHandler\\Exception\\SilencedErrorContext' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster', 'castSilencedErrorContext'], 'ReloadifyScoped\\Imagine\\Image\\ImageInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ImagineCaster', 'castImage'], 'ReloadifyScoped\\Ramsey\\Uuid\\UuidInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\UuidCaster', 'castRamseyUuid'], 'ReloadifyScoped\\ProxyManager\\Proxy\\ProxyInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ProxyManagerCaster', 'castProxy'], 'PHPUnit_Framework_MockObject_MockObject' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\PHPUnit\\Framework\\MockObject\\MockObject' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\PHPUnit\\Framework\\MockObject\\Stub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\Prophecy\\Prophecy\\ProphecySubjectInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'ReloadifyScoped\\Mockery\\MockInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\StubCaster', 'cutInternals'], 'PDO' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\PdoCaster', 'castPdo'], 'PDOStatement' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\PdoCaster', 'castPdoStatement'], 'AMQPConnection' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castConnection'], 'AMQPChannel' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castChannel'], 'AMQPQueue' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castQueue'], 'AMQPExchange' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castExchange'], 'AMQPEnvelope' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\AmqpCaster', 'castEnvelope'], 'ArrayObject' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castArrayObject'], 'ArrayIterator' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castArrayIterator'], 'SplDoublyLinkedList' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castDoublyLinkedList'], 'SplFileInfo' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castFileInfo'], 'SplFileObject' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castFileObject'], 'SplHeap' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castHeap'], 'SplObjectStorage' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castObjectStorage'], 'SplPriorityQueue' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castHeap'], 'OuterIterator' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castOuterIterator'], 'WeakReference' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\SplCaster', 'castWeakReference'], 'Redis' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster', 'castRedis'], 'RedisArray' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster', 'castRedisArray'], 'RedisCluster' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RedisCaster', 'castRedisCluster'], 'DateTimeInterface' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castDateTime'], 'DateInterval' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castInterval'], 'DateTimeZone' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castTimeZone'], 'DatePeriod' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DateCaster', 'castPeriod'], 'GMP' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\GmpCaster', 'castGmp'], 'MessageFormatter' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castMessageFormatter'], 'NumberFormatter' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castNumberFormatter'], 'IntlTimeZone' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castIntlTimeZone'], 'IntlCalendar' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castIntlCalendar'], 'IntlDateFormatter' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\IntlCaster', 'castIntlDateFormatter'], 'Memcached' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\MemcachedCaster', 'castMemcached'], 'ReloadifyScoped\\Ds\\Collection' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castCollection'], 'ReloadifyScoped\\Ds\\Map' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castMap'], 'ReloadifyScoped\\Ds\\Pair' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castPair'], 'ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DsPairStub' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\DsCaster', 'castPairStub'], 'mysqli_driver' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\MysqliCaster', 'castMysqliDriver'], 'CurlHandle' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castCurl'], ':curl' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castCurl'], ':dba' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castDba'], ':dba persistent' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castDba'], 'GdImage' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castGd'], ':gd' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castGd'], ':mysql link' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castMysqlLink'], ':pgsql large object' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castLargeObject'], ':pgsql link' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castLink'], ':pgsql link persistent' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castLink'], ':pgsql result' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster', 'castResult'], ':process' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castProcess'], ':stream' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castStream'], 'OpenSSLCertificate' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castOpensslX509'], ':OpenSSL X.509' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castOpensslX509'], ':persistent stream' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castStream'], ':stream-context' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\ResourceCaster', 'castStreamContext'], 'XmlParser' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster', 'castXml'], ':xml' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster', 'castXml'], 'RdKafka' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castRdKafka'], 'ReloadifyScoped\\RdKafka\\Conf' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castConf'], 'ReloadifyScoped\\RdKafka\\KafkaConsumer' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castKafkaConsumer'], 'ReloadifyScoped\\RdKafka\\Metadata\\Broker' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castBrokerMetadata'], 'ReloadifyScoped\\RdKafka\\Metadata\\Collection' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castCollectionMetadata'], 'ReloadifyScoped\\RdKafka\\Metadata\\Partition' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castPartitionMetadata'], 'ReloadifyScoped\\RdKafka\\Metadata\\Topic' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopicMetadata'], 'ReloadifyScoped\\RdKafka\\Message' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castMessage'], 'ReloadifyScoped\\RdKafka\\Topic' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopic'], 'ReloadifyScoped\\RdKafka\\TopicPartition' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopicPartition'], 'ReloadifyScoped\\RdKafka\\TopicConf' => ['ReloadifyScoped\\Symfony\\Component\\VarDumper\\Caster\\RdKafkaCaster', 'castTopicConf']];
    protected $maxItems = 2500;
    protected $maxString = -1;
    protected $minDepth = 1;
    /**
     * @var array<string, list<callable>>
     */
    private $casters = [];
    /**
     * @var callable|null
     */
    private $prevErrorHandler;
    private $classInfo = [];
    private $filter = 0;
    /**
     * @param callable[]|null $casters A map of casters
     *
     * @see addCasters
     */
    public function __construct(?array $casters = null)
    {
        if (null === $casters) {
            $casters = static::$defaultCasters;
        }
        $this->addCasters($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.
     *
     * @param callable[] $casters A map of casters
     */
    public function addCasters(array $casters)
    {
        foreach ($casters as $type => $callback) {
            $this->casters[$type][] = $callback;
        }
    }
    /**
     * Sets the maximum number of items to clone past the minimum depth in nested structures.
     */
    public function setMaxItems(int $maxItems)
    {
        $this->maxItems = $maxItems;
    }
    /**
     * Sets the maximum cloned length for strings.
     */
    public function setMaxString(int $maxString)
    {
        $this->maxString = $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.
     */
    public function setMinDepth(int $minDepth)
    {
        $this->minDepth = $minDepth;
    }
    /**
     * Clones a PHP variable.
     *
     * @param mixed $var    Any PHP variable
     * @param int   $filter A bit field of Caster::EXCLUDE_* constants
     *
     * @return Data
     */
    public function cloneVar($var, int $filter = 0)
    {
        $this->prevErrorHandler = \set_error_handler(function ($type, $msg, $file, $line, $context = []) {
            if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) {
                // Cloner never dies
                throw new \ErrorException($msg, 0, $type, $file, $line);
            }
            if ($this->prevErrorHandler) {
                return ($this->prevErrorHandler)($type, $msg, $file, $line, $context);
            }
            return \false;
        });
        $this->filter = $filter;
        if ($gc = \gc_enabled()) {
            \gc_disable();
        }
        try {
            return new Data($this->doClone($var));
        } finally {
            if ($gc) {
                \gc_enable();
            }
            \restore_error_handler();
            $this->prevErrorHandler = null;
        }
    }
    /**
     * Effectively clones the PHP variable.
     *
     * @param mixed $var Any PHP variable
     *
     * @return array
     */
    protected abstract function doClone($var);
    /**
     * Casts an object to an array representation.
     *
     * @param bool $isNested True if the object is nested in the dumped structure
     *
     * @return array
     */
    protected function castObject(Stub $stub, bool $isNested)
    {
        $obj = $stub->value;
        $class = $stub->class;
        if (\PHP_VERSION_ID < 80000 ? "\x00" === ($class[15] ?? null) : \str_contains($class, "@anonymous\x00")) {
            $stub->class = \get_debug_type($obj);
        }
        if (isset($this->classInfo[$class])) {
            [$i, $parents, $hasDebugInfo, $fileInfo] = $this->classInfo[$class];
        } else {
            $i = 2;
            $parents = [$class];
            $hasDebugInfo = \method_exists($class, '__debugInfo');
            foreach (\class_parents($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            foreach (\class_implements($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            $parents[] = '*';
            $r = new \ReflectionClass($class);
            $fileInfo = $r->isInternal() || $r->isSubclassOf(Stub::class) ? [] : ['file' => $r->getFileName(), 'line' => $r->getStartLine()];
            $this->classInfo[$class] = [$i, $parents, $hasDebugInfo, $fileInfo];
        }
        $stub->attr += $fileInfo;
        $a = Caster::castObject($obj, $class, $hasDebugInfo, $stub->class);
        try {
            while ($i--) {
                if (!empty($this->casters[$p = $parents[$i]])) {
                    foreach ($this->casters[$p] as $callback) {
                        $a = $callback($obj, $a, $stub, $isNested, $this->filter);
                    }
                }
            }
        } catch (\Exception $e) {
            $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '') . '⚠' => new ThrowingCasterException($e)] + $a;
        }
        return $a;
    }
    /**
     * Casts a resource to an array representation.
     *
     * @param bool $isNested True if the object is nested in the dumped structure
     *
     * @return array
     */
    protected function castResource(Stub $stub, bool $isNested)
    {
        $a = [];
        $res = $stub->value;
        $type = $stub->class;
        try {
            if (!empty($this->casters[':' . $type])) {
                foreach ($this->casters[':' . $type] as $callback) {
                    $a = $callback($res, $a, $stub, $isNested, $this->filter);
                }
            }
        } catch (\Exception $e) {
            $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '') . '⚠' => new ThrowingCasterException($e)] + $a;
        }
        return $a;
    }
}
