Skip to content
Snippets Groups Projects

php 8.1: Argument #1 ($rpc_responses) must be of type array, null given

Open Patrick Kenny requested to merge issue/jsonrpc-3285339:fix_response_header into 2.x
@@ -162,15 +162,14 @@ class HttpController extends ControllerBase {
try {
$rpc_responses = $this->getRpcResponses($rpc_requests);
// Aggregate the response headers so we can add them to the HTTP response.
$header_bag = $this->aggregateResponseHeaders($rpc_responses);
// If no RPC response(s) were generated (happens if all of the request(s)
// were notifications), then return a 204 HTTP response.
if (empty($rpc_responses)) {
$response = new CacheableJsonResponse(NULL, Response::HTTP_NO_CONTENT);
$response->headers->add($header_bag->all());
return $response;
return new CacheableJsonResponse(NULL, Response::HTTP_NO_CONTENT);
}
else {
// Aggregate the response headers to add them to the HTTP response.
$header_bag = $this->aggregateResponseHeaders($rpc_responses);
}
// Map the RPC response(s) to an HTTP response.
Loading