protected function prefix(string $uri): string
    {
        $trimmed = \trim($this->getLastGroupPrefix(), '/') . '/' . \trim($uri, '/');

        if (! $trimmed) {
            return '/';
        }

        if (\strpos($trimmed, '/') === 0) {
            return $trimmed;
        }

        return '/' . $trimmed;
    }