Skip to content

Commit

Permalink
minor #41682 [PasswordHasher] Remove PasswordHasherAwareInterface typ…
Browse files Browse the repository at this point in the history
…e from UserPasswordHasherInterface API (chalasr)

This PR was merged into the 5.3 branch.

Discussion
----------

[PasswordHasher] Remove PasswordHasherAwareInterface type from UserPasswordHasherInterface API

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | no (not yet released)
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

As spotted by `@stof` in #41640 (comment), the methods of this interface should not handle user classes/instances that are not implementing `PasswordAuthenticatedUserInterface`.
This reverts that part from #41678 (not released yet).

Commits
-------

596ba78 [PasswordHasher] Remove PasswordHasherAwareInterface from UserPasswordHasherInterface API
  • Loading branch information
chalasr committed Jun 11, 2021
2 parents 4988db2 + 596ba78 commit 9595726
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -32,7 +32,7 @@ public function __construct(PasswordHasherFactoryInterface $hasherFactory)
}

/**
* @param PasswordAuthenticatedUserInterface|PasswordHasherAwareInterface $user
* @param PasswordAuthenticatedUserInterface $user
*/
public function hashPassword($user, string $plainPassword): string
{
Expand All @@ -54,7 +54,7 @@ public function hashPassword($user, string $plainPassword): string
}

/**
* @param PasswordAuthenticatedUserInterface|PasswordHasherAwareInterface $user
* @param PasswordAuthenticatedUserInterface $user
*/
public function isPasswordValid($user, string $plainPassword): bool
{
Expand All @@ -80,7 +80,7 @@ public function isPasswordValid($user, string $plainPassword): bool
}

/**
* @param PasswordAuthenticatedUserInterface|PasswordHasherAwareInterface $user
* @param PasswordAuthenticatedUserInterface $user
*/
public function needsRehash($user): bool
{
Expand Down
Expand Up @@ -18,9 +18,9 @@
*
* @author Ariel Ferrandini <arielferrandini@gmail.com>
*
* @method string hashPassword(PasswordAuthenticatedUserInterface|PasswordHasherAwareInterface $user, string $plainPassword) Hashes the plain password for the given user.
* @method bool isPasswordValid(PasswordAuthenticatedUserInterface|PasswordHasherAwareInterface $user, string $plainPassword) Checks if the plaintext password matches the user's password.
* @method bool needsRehash(PasswordAuthenticatedUserInterface|PasswordHasherAwareInterface $user) Checks if an encoded password would benefit from rehashing.
* @method string hashPassword(PasswordAuthenticatedUserInterface $user, string $plainPassword) Hashes the plain password for the given user.
* @method bool isPasswordValid(PasswordAuthenticatedUserInterface $user, string $plainPassword) Checks if the plaintext password matches the user's password.
* @method bool needsRehash(PasswordAuthenticatedUserInterface $user) Checks if an encoded password would benefit from rehashing.
*/
interface UserPasswordHasherInterface
{
Expand Down

0 comments on commit 9595726

Please sign in to comment.