protected function resolveBaseUrlFrom(?string $root): void
    {
        // Build base URL and prefix.
        $baseUrl = \ltrim(\str_replace(['https://', 'http://'], '', $root), '/');
        $base = \explode('/', $baseUrl, 2);

        if (\count($base) > 1) {
            $this->basePrefix = \array_pop($base);
        }

        $this->baseUrl = \array_shift($base);
    }