public function registerDefinition($id, array $definition, $isShared = true)
    {
        if (isset($this->immutable[$id])) {
            throw new ContainerException(sprintf(
                'A service by the name "%s" already exists and cannot be overridden',
                $id
            ));
        }

        $this->definition[$id] = $definition;
        $this->keys[$id] = boolval($isShared);

        if (isset($this->aliases[$id])) {
            unset($this->aliases[$id]);
        }
    }