private function setCurrentProfile(string $name): self
    {
        if (!$this->mapOfProfiles->hasKey($name)) {
            throw UndefinedProfileException::forProfile($name);
        }

        $this->resolver = null;
        $this->currentProfile = $name;

        return $this;
    }