protected function getProxyInstance(string $name, ReflectionClass $class, array $arguments, array $config)
    {
        $factory = new LazyLoadingValueHolderFactory();
        $that = $this;

        return $factory->createProxy(
            $class->getName(),
            function (&$wrappedObject, $proxy, $method, $parameters, &$initializer) use ($that, $name,$class,$arguments,$config) {
                $wrappedObject = $that->getRealInstance($name, $class, $arguments, $config);
                $initializer = null;
            }
        );
    }
protected function getProxyInstance(string $name, ReflectionClass $class, array $arguments, array $config)
    {
        $factory = new LazyLoadingValueHolderFactory();
        $that = $this;

        return $factory->createProxy(
            $class->getName(),
            function (&$wrappedObject, $proxy, $method, $parameters, &$initializer) use ($that, $name,$class,$arguments,$config) {
                $wrappedObject = $that->getRealInstance($name, $class, $arguments, $config);
                $initializer = null;
            }
        );
    }
protected function getProxyInstance ( string $ name , ReflectionClass $ class , array $ arguments , array $ config ) { $ factory = new LazyLoadingValueHolderFactory ( ) ; $ that = $ this ; return $ factory -> createProxy ( $ class -> getName ( ) , function ( & $ wrappedObject , $ proxy , $ method , $ parameters , & $ initializer ) use ( $ that , $ name , $ class , $ arguments , $ config ) { $ wrappedObject = $ that -> getRealInstance ( $ name , $ class , $ arguments , $ config ) ; $ initializer = null ; } ) ; }
Create proxy instance.
Create proxy instance .