public function clear(string $name): void
    {
        $name = $this->getDefinitiveName($name);

        if (!$this->has($name)) {
            throw NotFoundException::fromId($name);
        }

        unset($this->instances[$name]);

        $this->clearRelationship($name);
    }