Neos\Flow\ObjectManagement\ObjectManager::createLazyDependency PHP Method

createLazyDependency() public method

Internally used by the injectProperties method of generated proxy classes.
public createLazyDependency ( string $hash, &$propertyReferenceVariable, string $className, Closure $builder ) : DependencyProxy
$hash string An md5 hash over the code needed to actually build the dependency instance
$className string Name of the class of the dependency which eventually will be instantiated
$builder Closure An anonymous function which creates the instance to be injected
return Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy
    public function createLazyDependency($hash, &$propertyReferenceVariable, $className, \Closure $builder)
    {
        $this->dependencyProxies[$hash] = new DependencyProxy($className, $builder);
        $this->dependencyProxies[$hash]->_addPropertyVariable($propertyReferenceVariable);
        return $this->dependencyProxies[$hash];
    }