Hello'); } #[Route('/error')] public function error(): ResponseInterface { return new GenericResponse('error', StatusEnum::NOT_FOUND); } #[Route('/hello')] public function hello(): ResponseInterface { return new GenericResponse('Hello World!'); } #[Route('/routes/{word}')] public function routes(RouterConfig $config, string $word): ResponseInterface { $routes = implode('
', array_map( fn($route) => sprintf('%s - %s->%s', $route->getRoute()->path, $route->getController(), $route->getMethod()), $config->getRoutes() )) . "
$word"; return new GenericResponse($routes); } #[Route('/world/{name}')] public function world(string $name): ResponseInterface { return new GenericResponse("Hello $name!"); } }