getPathInfo(); $scheme = $request->getScheme(); $host = $request->getHost(); $base = "{$scheme}://{$host}/"; function response(string $text): Response { return new Response($text, 200, [ 'Content-Type' => 'text/plain', ]); } $response = match ($path) { '/uuid/v1' => \response(Uuid::v1()->toString()), '/uuid/v4' => \response(Uuid::v4()->toString()), '/uuid/v6' => \response(Uuid::v6()->toString()), '/uuid/v7' => response(Uuid::v7()->toString()), '/ulid' => response(Ulid::generate()), '/' => response(<< new RedirectResponse("/", 301), }; $response->send();