Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 758c980

Browse files
committed
Declare exceptions that are already thrown by implementations
1 parent cf15589 commit 758c980

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Core/Encoder/PasswordEncoderInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Security\Core\Encoder;
1313

14+
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
15+
1416
/**
1517
* PasswordEncoderInterface is the interface for all encoders.
1618
*
@@ -25,6 +27,9 @@ interface PasswordEncoderInterface
2527
* @param string $salt The salt
2628
*
2729
* @return string The encoded password
30+
*
31+
* @throws BadCredentialsException If the raw password is invalid, e.g. excessively long
32+
* @throws \InvalidArgumentException If the salt is invalid
2833
*/
2934
public function encodePassword($raw, $salt);
3035

@@ -36,6 +41,8 @@ public function encodePassword($raw, $salt);
3641
* @param string $salt The salt
3742
*
3843
* @return bool true if the password is valid, false otherwise
44+
*
45+
* @throws \InvalidArgumentException If the salt is invalid
3946
*/
4047
public function isPasswordValid($encoded, $raw, $salt);
4148
}

0 commit comments

Comments
 (0)