-
-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecb9799
commit 8098ab1
Showing
48 changed files
with
187 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
use Sonata\UserBundle\Model\UserManagerInterface; | ||
use Sonata\UserBundle\Util\CanonicalFieldsUpdaterInterface; | ||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; | ||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; | ||
|
||
/** | ||
* @author Hugo Briand <[email protected]> | ||
|
@@ -29,25 +28,17 @@ | |
final class UserManager extends BaseDocumentManager implements UserManagerInterface | ||
{ | ||
/** | ||
* TODO: Simplify this once support for Symfony 4.4 is dropped. | ||
* | ||
* @param UserPasswordEncoderInterface|UserPasswordHasherInterface $userPasswordHasher | ||
* | ||
* @phpstan-param class-string<UserInterface> $class | ||
*/ | ||
public function __construct( | ||
string $class, | ||
ManagerRegistry $registry, | ||
private CanonicalFieldsUpdaterInterface $canonicalFieldsUpdater, | ||
// @phpstan-ignore-next-line | ||
private object $userPasswordHasher | ||
private UserPasswordHasherInterface $userPasswordHasher | ||
) { | ||
parent::__construct($class, $registry); | ||
} | ||
|
||
/** | ||
* @psalm-suppress UndefinedDocblockClass | ||
*/ | ||
public function updatePassword(UserInterface $user): void | ||
{ | ||
$plainPassword = $user->getPlainPassword(); | ||
|
@@ -56,12 +47,7 @@ public function updatePassword(UserInterface $user): void | |
return; | ||
} | ||
|
||
if ($this->userPasswordHasher instanceof UserPasswordHasherInterface) { | ||
$password = $this->userPasswordHasher->hashPassword($user, $plainPassword); | ||
} else { | ||
// @phpstan-ignore-next-line | ||
$password = $this->userPasswordHasher->encodePassword($user, $plainPassword); | ||
} | ||
$password = $this->userPasswordHasher->hashPassword($user, $plainPassword); | ||
|
||
$user->setPassword($password); | ||
$user->eraseCredentials(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
use Sonata\UserBundle\Model\UserManagerInterface; | ||
use Sonata\UserBundle\Util\CanonicalFieldsUpdaterInterface; | ||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; | ||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; | ||
|
||
/** | ||
* @author Hugo Briand <[email protected]> | ||
|
@@ -29,25 +28,17 @@ | |
final class UserManager extends BaseEntityManager implements UserManagerInterface | ||
{ | ||
/** | ||
* TODO: Simplify this once support for Symfony 4.4 is dropped. | ||
* | ||
* @param UserPasswordEncoderInterface|UserPasswordHasherInterface $userPasswordHasher | ||
* | ||
* @phpstan-param class-string<UserInterface> $class | ||
*/ | ||
public function __construct( | ||
string $class, | ||
ManagerRegistry $registry, | ||
private CanonicalFieldsUpdaterInterface $canonicalFieldsUpdater, | ||
// @phpstan-ignore-next-line | ||
private object $userPasswordHasher | ||
private UserPasswordHasherInterface $userPasswordHasher | ||
) { | ||
parent::__construct($class, $registry); | ||
} | ||
|
||
/** | ||
* @psalm-suppress UndefinedDocblockClass | ||
*/ | ||
public function updatePassword(UserInterface $user): void | ||
{ | ||
$plainPassword = $user->getPlainPassword(); | ||
|
@@ -56,12 +47,7 @@ public function updatePassword(UserInterface $user): void | |
return; | ||
} | ||
|
||
if ($this->userPasswordHasher instanceof UserPasswordHasherInterface) { | ||
$password = $this->userPasswordHasher->hashPassword($user, $plainPassword); | ||
} else { | ||
// @phpstan-ignore-next-line | ||
$password = $this->userPasswordHasher->encodePassword($user, $plainPassword); | ||
} | ||
$password = $this->userPasswordHasher->hashPassword($user, $plainPassword); | ||
|
||
$user->setPassword($password); | ||
$user->eraseCredentials(); | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.