From f4cc30b72b58ffaec8a7a10897da2cfbadc19353 Mon Sep 17 00:00:00 2001 From: Stefan Kruppa Date: Fri, 4 Jan 2019 17:03:46 +0100 Subject: [PATCH 1/2] Declare exceptions that are already thrown by implementations --- .../Security/Core/Encoder/PasswordEncoderInterface.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php b/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php index 8c018be201..e0573051eb 100644 --- a/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php +++ b/src/Symfony/Component/Security/Core/Encoder/PasswordEncoderInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Security\Core\Encoder; +use Symfony\Component\Security\Core\Exception\BadCredentialsException; + /** * PasswordEncoderInterface is the interface for all encoders. * @@ -25,6 +27,9 @@ interface PasswordEncoderInterface * @param string $salt The salt * * @return string The encoded password + * + * @throws BadCredentialsException If the raw password is invalid, e.g. excessively long + * @throws \InvalidArgumentException If the salt is invalid */ public function encodePassword($raw, $salt); @@ -36,6 +41,8 @@ interface PasswordEncoderInterface * @param string $salt The salt * * @return bool true if the password is valid, false otherwise + * + * @throws \InvalidArgumentException If the salt is invalid */ public function isPasswordValid($encoded, $raw, $salt); } From e8cdda3cf2b8bb427148b829bb5a80a5165a23a4 Mon Sep 17 00:00:00 2001 From: Tarjei Huse Date: Wed, 30 Jan 2019 14:15:45 +0100 Subject: [PATCH 2/2] Fix typo in translation --- .../Security/Core/Resources/translations/security.nb.xlf | 2 +- .../Security/Core/Resources/translations/security.no.xlf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.nb.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.nb.xlf index 3635916971..a01db39770 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.nb.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.nb.xlf @@ -16,7 +16,7 @@ Invalid credentials. - Ugyldig påloggingsinformasjonen. + Ugyldig påloggingsinformasjon. Cookie has already been used by someone else. diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.no.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.no.xlf index 3635916971..a01db39770 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.no.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.no.xlf @@ -16,7 +16,7 @@ Invalid credentials. - Ugyldig påloggingsinformasjonen. + Ugyldig påloggingsinformasjon. Cookie has already been used by someone else.