original_string: 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));
          }
      }
code: 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));
          }
      }
code_tokens: 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 ) ) ; } }
docstring: Registers a definition in the container with its instanceof-conditionals.
  
  @param string     $id
  @param Definition $definition
docstring_tokens: Registers a definition in the container with its instanceof - conditionals .