DI\Definition\ObjectDefinition::setSubDefinition PHP Method

setSubDefinition() public method

public setSubDefinition ( DI\Definition\Definition $definition )
$definition DI\Definition\Definition
    public function setSubDefinition(Definition $definition)
    {
        if (!$definition instanceof self) {
            return;
        }
        // The current prevails
        if ($this->className === null) {
            $this->setClassName($definition->className);
        }
        if ($this->scope === null) {
            $this->scope = $definition->scope;
        }
        if ($this->lazy === null) {
            $this->lazy = $definition->lazy;
        }
        // Merge constructor injection
        $this->mergeConstructorInjection($definition);
        // Merge property injections
        $this->mergePropertyInjections($definition);
        // Merge method injections
        $this->mergeMethodInjections($definition);
    }