private function updateBodyFor(self $toUpdate): JsonResponse
    {
        $json = $this->jsonEncode($toUpdate->payload, $toUpdate->encodingOptions);
        $body = $this->createBodyFromJson($json);

        return $toUpdate->withBody($body);
    }
private function updateBodyFor(self $toUpdate): JsonResponse
    {
        $json = $this->jsonEncode($toUpdate->payload, $toUpdate->encodingOptions);
        $body = $this->createBodyFromJson($json);

        return $toUpdate->withBody($body);
    }
private function updateBodyFor ( self $ toUpdate ) : JsonResponse { $ json = $ this -> jsonEncode ( $ toUpdate -> payload , $ toUpdate -> encodingOptions ) ; $ body = $ this -> createBodyFromJson ( $ json ) ; return $ toUpdate -> withBody ( $ body ) ; }
Update the response body for the given instance.

@param self $toUpdate Instance to update.
@return JsonResponse Returns a new instance with an updated body.
@throws \RuntimeException
@throws \InvalidArgumentException
Update the response body for the given instance .