File tree 1 file changed +10
-12
lines changed
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``:
3612
3612
status_code : 422
3613
3613
3614
3614
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::
3616
3616
3617
- .. code-block :: php
3617
+ namespace App\Exception;
3618
3618
3619
- namespace App\Exception ;
3619
+ use Symfony\Component\HttpKernel\Attribute\WithHttpStatus ;
3620
3620
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
+ }
3630
3628
3631
3629
.. versionadded :: 6.3
3632
3630
You can’t perform that action at this time.
0 commit comments