commit f06233d9960d0c576555751043cc601fdcd53a26 Author: upstream Date: Thu Sep 10 08:56:01 2026 +0200 Upstream kanboard/kanboard state of the touched files before cf53b54597 diff --git a/libs/jsonrpc/src/JsonRPC/Request/BatchRequestParser.php b/libs/jsonrpc/src/JsonRPC/Request/BatchRequestParser.php new file mode 100644 index 0000000..c0fc776 --- /dev/null +++ b/libs/jsonrpc/src/JsonRPC/Request/BatchRequestParser.php @@ -0,0 +1,55 @@ +payload as $payload) { + $responses[] = RequestParser::create() + ->withPayload($payload) + ->withProcedureHandler($this->procedureHandler) + ->withMiddlewareHandler($this->middlewareHandler) + ->withLocalException($this->localExceptions) + ->parse(); + } + + $responses = array_filter($responses); + return empty($responses) ? '' : '['.implode(',', $responses).']'; + } + + /** + * Return true if we have a batch request + * + * ex : [ + * 0 => '...', + * 1 => '...', + * 2 => '...', + * 3 => '...', + * ] + * + * @static + * @access public + * @param array $payload + * @return bool + */ + public static function isBatchRequest(array $payload) + { + return array_keys($payload) === range(0, count($payload) - 1); + } +}