From 99006cd6370f0502693f3fa9e3c20c83c02b364f Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 10 Apr 2026 13:37:26 +0200 Subject: switch routing to attributes --- .../Client/ServerInformationController.php | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/Controllers/Client/ServerInformationController.php (limited to 'src/Controllers/Client/ServerInformationController.php') diff --git a/src/Controllers/Client/ServerInformationController.php b/src/Controllers/Client/ServerInformationController.php new file mode 100644 index 0000000..51e68e6 --- /dev/null +++ b/src/Controllers/Client/ServerInformationController.php @@ -0,0 +1,57 @@ + [ + "base_url" => "https://$_ENV[DOMAIN]", + ], + ]); + } + + #[Route(path: "/.well-known/matrix/support", methods: ["GET"])] + public function support(Request $request): Response + { + return new JsonResponse([ + "contacts" => [], + "support_page" => "", + ]); + } + + #[Route(path: "/_matrix/client/versions", methods: ["GET"])] + public function versions(Request $request): Response + { + return new JsonResponse(new ClientVersionsGetResponse([ + "r0.0.1", + "v1.1", + ])); + } + + public function server(Request $request): Response + { + return new JsonResponse([ + "m.server" => "$_ENV[DOMAIN]:443", + ]); + } + + public function version(Request $request): Response + { + return new JsonResponse([ + "server" => [ + "name" => "Matrix PHP", + "version" => "0.1.0", + ], + ]); + } +} -- cgit v1.2.3