Sets a service.
@api
string $id The service identifier:
object $service The service instance:
string $scope The scope:
BadMethodCallException When this ContainerBuilder is frozen
Overrides Container::set
public function set($id, $service, $scope = self::SCOPE_CONTAINER) {
if ($this
->isFrozen()) {
throw new BadMethodCallException('Setting service on a frozen container is not allowed');
}
$id = strtolower($id);
unset($this->definitions[$id], $this->aliases[$id]);
parent::set($id, $service, $scope);
}