From 3b498354ff523063d7df599e11718f99957a9a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Lundb=C3=B8l?= Date: Fri, 27 Apr 2018 06:58:36 +0200 Subject: [PATCH] Add missing responseAccepted method. --- src/Controllers/ApiController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Controllers/ApiController.php b/src/Controllers/ApiController.php index c1125bc..6e73e00 100644 --- a/src/Controllers/ApiController.php +++ b/src/Controllers/ApiController.php @@ -126,6 +126,21 @@ public function responseNoContent( return $this->setResponseCode(204) ->respond(['message' => $message], $headers); } + + /** + * @param string $message + * @param array $headers + * @return JsonResponse + */ + public function responseAccepted( + string $message = 'The request was accepted for processing', + array $headers = [] + ): JsonResponse { + + return $this->setResponseCode(202) + ->setStatusCode(224) + ->respond(['message' => $message], $headers); + } /** * @param array $headers