File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -3806,6 +3806,26 @@ the ``#[WithLogLevel]`` attribute::
3806
3806
{
3807
3807
}
3808
3808
3809
+ The attributes can also be added to interfaces directly::
3810
+
3811
+ namespace App\Exception;
3812
+
3813
+ use Symfony\Component\HttpKernel\Attribute\WithHttpStatus;
3814
+
3815
+ #[WithHttpStatus(422)]
3816
+ interface CustomExceptionInterface
3817
+ {
3818
+ }
3819
+
3820
+ class CustomException extends \Exception implements CustomExceptionInterface
3821
+ {
3822
+ }
3823
+
3824
+ .. versionadded :: 7.1
3825
+
3826
+ Support to use ``#[WithHttpStatus] `` and ``#[WithLogLevel] `` attributes
3827
+ on interfaces, was introduced in Symfony 7.1.
3828
+
3809
3829
.. _`HTTP Host header attacks` : https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
3810
3830
.. _`Security Advisory Blog post` : https://symfony.com/blog/security-releases-symfony-2-0-24-2-1-12-2-2-5-and-2-3-3-released#cve-2013-4752-request-gethost-poisoning
3811
3831
.. _`phpstorm-url-handler` : https://github.com/sanduhrs/phpstorm-url-handler
You can’t perform that action at this time.
0 commit comments