Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 740e44f

Browse filesBrowse files
committed
Minor syntax tweak
1 parent 71c3495 commit 740e44f
Copy full SHA for 740e44f

File tree

1 file changed

+10
-12
lines changed
Filter options

1 file changed

+10
-12
lines changed

‎reference/configuration/framework.rst

Copy file name to clipboardExpand all lines: reference/configuration/framework.rst
+10-12Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3612,21 +3612,19 @@ use the configuration of the first exception that matches ``instanceof``:
36123612
status_code: 422
36133613
36143614
You can map a status code and a set of headers to an exception thanks
3615-
to the ``#[WithHttpStatus]`` attribute on the exception class:
3615+
to the ``#[WithHttpStatus]`` attribute on the exception class::
36163616

3617-
.. code-block:: php
3617+
namespace App\Exception;
36183618

3619-
namespace App\Exception;
3619+
use Symfony\Component\HttpKernel\Attribute\WithHttpStatus;
36203620

3621-
use Symfony\Component\HttpKernel\Attribute\WithHttpStatus;
3622-
3623-
#[WithHttpStatus(422, [
3624-
'Retry-After' => 10,
3625-
'X-Custom-Header' => 'header-value',
3626-
])]
3627-
class CustomException extends \Exception
3628-
{
3629-
}
3621+
#[WithHttpStatus(422, [
3622+
'Retry-After' => 10,
3623+
'X-Custom-Header' => 'header-value',
3624+
])]
3625+
class CustomException extends \Exception
3626+
{
3627+
}
36303628

36313629
.. versionadded:: 6.3
36323630

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.