Skip to content

Commit 0cda0d5

Browse files
hkdobrevjaviereguiluz
authored andcommitted
Rename missing allowCustomResponseCode to correct allowCustomResponseCode
Introduced in 5f0becf The functionality was introduced in symfony/symfony#19822. The method got renamed during code review, but was not updated in the docs. symfony/symfony#19822 (comment)
1 parent 3498aa9 commit 0cda0d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reference/events.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,15 @@ response:
236236

237237
If you want to overwrite the status code of the exception response, which
238238
you should not without a good reason, call
239-
``GetResponseForExceptionEvent::allowSuccessfulResponse()`` first and then
239+
``GetResponseForExceptionEvent::allowCustomResponseCode()`` first and then
240240
set the status code on the response::
241241

242-
$event->allowSuccessfulResponse();
242+
$event->allowCustomResponseCode();
243243
$response = new Response('No Content', 204);
244244
$event->setResponse($response);
245245

246246
The status code sent to the client in the above example will be ``204``. If
247-
``$event->allowSuccessfulResponse()`` is omitted, then the kernel will set
247+
``$event->allowCustomResponseCode()`` is omitted, then the kernel will set
248248
an appropriate status code based on the type of exception thrown.
249249

250250
.. seealso::

0 commit comments

Comments
 (0)