Skip to content

Commit

Permalink
chore: add deprecation about 400 to 422 (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon authored Jan 15, 2025
1 parent cad74ff commit 87506b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Exception/InvalidJsonHttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}
1 change: 1 addition & 0 deletions src/Exception/NoParameterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}
1 change: 1 addition & 0 deletions src/Exception/UnauthorizedFieldException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
1 change: 1 addition & 0 deletions src/Exception/UndefinedProviderException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 87506b6

Please sign in to comment.