getUri()->withHost('')->withPort(0)->withScheme(''); $task = TasksCommand::getTasks($id); if (empty($task)) { return api_error('Task not found.', HTTP_STATUS::HTTP_NOT_FOUND); } $response = [ ...Index::formatTask($task), 'links' => [ 'self' => (string)$apiUrl, 'list' => (string)$apiUrl->withPath(parseConfigValue(Index::URL)), ], ]; return api_response(HTTP_STATUS::HTTP_OK, ['task' => $response]); } }