From 87506b60b8114bd396a17dae605902f0ea1dce02 Mon Sep 17 00:00:00 2001 From: Vincent <407859+vincentchalamon@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:39:36 +0100 Subject: [PATCH] chore: add deprecation about 400 to 422 (#151) --- src/Exception/InvalidJsonHttpException.php | 1 + src/Exception/NoParameterException.php | 1 + src/Exception/UnauthorizedFieldException.php | 1 + src/Exception/UndefinedProviderException.php | 1 + 4 files changed, 4 insertions(+) diff --git a/src/Exception/InvalidJsonHttpException.php b/src/Exception/InvalidJsonHttpException.php index a58e199..3ad510c 100644 --- a/src/Exception/InvalidJsonHttpException.php +++ b/src/Exception/InvalidJsonHttpException.php @@ -19,6 +19,7 @@ final class InvalidJsonHttpException extends HttpException implements JsonHttpEx { public function __construct() { + trigger_deprecation('tilleuls/forgot-password-bundle', '1.5', 'Status code will change to "%s" in 2.0.', 422); parent::__construct(400, 'Invalid JSON data.'); } } diff --git a/src/Exception/NoParameterException.php b/src/Exception/NoParameterException.php index 2b04f83..8965d67 100644 --- a/src/Exception/NoParameterException.php +++ b/src/Exception/NoParameterException.php @@ -19,6 +19,7 @@ final class NoParameterException extends HttpException implements JsonHttpExcept { public function __construct() { + trigger_deprecation('tilleuls/forgot-password-bundle', '1.5', 'Status code will change to "%s" in 2.0.', 422); parent::__construct(400, 'No parameter sent.'); } } diff --git a/src/Exception/UnauthorizedFieldException.php b/src/Exception/UnauthorizedFieldException.php index b582ecf..48bef86 100644 --- a/src/Exception/UnauthorizedFieldException.php +++ b/src/Exception/UnauthorizedFieldException.php @@ -19,6 +19,7 @@ final class UnauthorizedFieldException extends HttpException implements JsonHttp { public function __construct($propertyName) { + trigger_deprecation('tilleuls/forgot-password-bundle', '1.5', 'Status code will change to "%s" in 2.0.', 422); parent::__construct(400, \sprintf('The parameter "%s" is not authorized in your configuration.', $propertyName)); } } diff --git a/src/Exception/UndefinedProviderException.php b/src/Exception/UndefinedProviderException.php index 9619bc3..4898125 100644 --- a/src/Exception/UndefinedProviderException.php +++ b/src/Exception/UndefinedProviderException.php @@ -19,6 +19,7 @@ final class UndefinedProviderException extends HttpException implements JsonHttp { public function __construct(string $message = 'This provider is not defined.') { + trigger_deprecation('tilleuls/forgot-password-bundle', '1.5', 'Status code will change to "%s" in 2.0.', 422); parent::__construct(400, $message); } }