File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments