protected function setDefinition($id, Definition $definition)
    {
        $this->container->removeBindings($id);

        if ($this->isLoadingInstanceof) {
            if (!$definition instanceof ChildDefinition) {
                throw new InvalidArgumentException(sprintf('Invalid type definition "%s": ChildDefinition expected, "%s" given.', $id, \get_class($definition)));
            }
            $this->instanceof[$id] = $definition;
        } else {
            $this->container->setDefinition($id, $definition instanceof ChildDefinition ? $definition : $definition->setInstanceofConditionals($this->instanceof));
        }
    }
protected function setDefinition($id, Definition $definition)
    {
        $this->container->removeBindings($id);

        if ($this->isLoadingInstanceof) {
            if (!$definition instanceof ChildDefinition) {
                throw new InvalidArgumentException(sprintf('Invalid type definition "%s": ChildDefinition expected, "%s" given.', $id, \get_class($definition)));
            }
            $this->instanceof[$id] = $definition;
        } else {
            $this->container->setDefinition($id, $definition instanceof ChildDefinition ? $definition : $definition->setInstanceofConditionals($this->instanceof));
        }
    }
protected function setDefinition ( $ id , Definition $ definition ) { $ this -> container -> removeBindings ( $ id ) ; if ( $ this -> isLoadingInstanceof ) { if ( ! $ definition instanceof ChildDefinition ) { throw new InvalidArgumentException ( sprintf ( 'Invalid type definition "%s": ChildDefinition expected, "%s" given.' , $ id , \ get_class ( $ definition ) ) ) ; } $ this -> instanceof [ $ id ] = $ definition ; } else { $ this -> container -> setDefinition ( $ id , $ definition instanceof ChildDefinition ? $ definition : $ definition -> setInstanceofConditionals ( $ this -> instanceof ) ) ; } }
Registers a definition in the container with its instanceof-conditionals.

@param string     $id
@param Definition $definition
Registers a definition in the container with its instanceof - conditionals .