getClient(name: $name); } catch (InvalidArgumentException $e) { return api_error($e->getMessage(), HTTP_STATUS::HTTP_NOT_FOUND); } $opts = []; $params = DataUtil::fromRequest($request, true); if (true === (bool)$params->get('raw', false)) { $opts[Options::RAW_RESPONSE] = true; } try { $version = $client->getVersion($opts); } catch (Throwable $e) { return api_error($e->getMessage(), HTTP_STATUS::HTTP_INTERNAL_SERVER_ERROR); } $apiUrl = $request->getUri()->withHost('')->withPort(0)->withScheme(''); $response = [ 'version' => $version, 'links' => [ 'self' => (string)$apiUrl, 'list' => (string)$apiUrl->withPath(parseConfigValue(Index::URL)), ], ]; return api_response(HTTP_STATUS::HTTP_OK, $response); } }