}, array{}>|DataResponse * * 200: Upcoming events * 401: When not authenticated */ #[NoAdminRequired] public function getEvents(?string $location = null): DataResponse { if ($this->userId === null) { return new DataResponse(null, Http::STATUS_UNAUTHORIZED); } return new DataResponse([ 'events' => array_values(array_map(fn (UpcomingEvent $e) => $e->jsonSerialize(), $this->service->getEvents( $this->userId, $location, ))), ]); } }