Sets a service definition.
@api
string $id The service identifier:
Definition $definition A Definition instance:
Definition the service definition
BadMethodCallException When this ContainerBuilder is frozen
public function setDefinition($id, Definition $definition) {
if ($this
->isFrozen()) {
throw new BadMethodCallException('Adding definition to a frozen container is not allowed');
}
$id = strtolower($id);
unset($this->aliasDefinitions[$id]);
return $this->definitions[$id] = $definition;
}