From 4a8b44ff1ff63549b6de9f48ffe7c712ac45f2d0 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Fri, 12 Dec 2014 22:06:50 +0100 Subject: [PATCH] Pass the HTTP status code directly in the constructor My IDE is telling me this way of doing things doesn't not work ``` return new JSONResponse()->setStatus(Http::STATUS_NOT_FOUND); ``` --- developer_manual/app/controllers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_manual/app/controllers.rst b/developer_manual/app/controllers.rst index 2d20ab0d5..6270194b4 100644 --- a/developer_manual/app/controllers.rst +++ b/developer_manual/app/controllers.rst @@ -504,7 +504,7 @@ Each response subclass has access to the **setStatus** method which lets you set // try to get author with $id } catch (NotFoundException $ex) { - return new JSONResponse()->setStatus(Http::STATUS_NOT_FOUND); + return new JSONResponse(array(), Http::STATUS_NOT_FOUND); } }