Instantiator\Instantiator::getCloneablesMap PHP Method

getCloneablesMap() private method

Builds or fetches the cloneables map
private getCloneablesMap ( ) : LazyMap\CallbackLazyMap
return LazyMap\CallbackLazyMap
    private function getCloneablesMap()
    {
        $cachedInstantiators = $this->getInstantiatorsMap();
        $that = $this;
        return self::$cachedCloneables = self::$cachedCloneables ?: new CallbackLazyMap(function ($className) use($cachedInstantiators, $that) {
            /* @var $factory Closure */
            $factory = $cachedInstantiators->{$className};
            $instance = $factory();
            if (!$that->isSafeToClone(new ReflectionClass($className))) {
                return null;
            }
            return $instance;
        });
    }