Skip to content

Commit f1937bb

Browse files
committed
feature #19344 Document #[WithHttpStatus] and #[WithLogLevel] on interfaces. (priyadi)
This PR was merged into the 7.1 branch. Discussion ---------- Document `#[WithHttpStatus]` and `#[WithLogLevel]` on interfaces. resolves #19337 Commits ------- 420bf58 Document `#[WithHttpStatus]` and `#[WithLogLevel]` on interfaces.
2 parents f25632c + 420bf58 commit f1937bb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

reference/configuration/framework.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3806,6 +3806,26 @@ the ``#[WithLogLevel]`` attribute::
38063806
{
38073807
}
38083808

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+
38093829
.. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
38103830
.. _`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
38113831
.. _`phpstorm-url-handler`: https://github.com/sanduhrs/phpstorm-url-handler

0 commit comments

Comments
 (0)