13
13
14
14
use Symfony \Component \Security \Core \User \LegacyPasswordAuthenticatedUserInterface ;
15
15
use Symfony \Component \Security \Core \User \PasswordAuthenticatedUserInterface ;
16
- use Symfony \Component \Security \Core \User \UserInterface ;
17
16
18
17
/**
19
18
* Hashes passwords based on the user and the PasswordHasherFactory.
@@ -31,10 +30,7 @@ public function __construct(PasswordHasherFactoryInterface $hasherFactory)
31
30
$ this ->hasherFactory = $ hasherFactory ;
32
31
}
33
32
34
- /**
35
- * @param PasswordAuthenticatedUserInterface $user
36
- */
37
- public function hashPassword ($ user , string $ plainPassword ): string
33
+ public function hashPassword (PasswordAuthenticatedUserInterface $ user , string $ plainPassword ): string
38
34
{
39
35
if (!$ user instanceof PasswordAuthenticatedUserInterface) {
40
36
if (!$ user instanceof UserInterface) {
@@ -53,10 +49,7 @@ public function hashPassword($user, string $plainPassword): string
53
49
return $ hasher ->hash ($ plainPassword , $ salt );
54
50
}
55
51
56
- /**
57
- * @param PasswordAuthenticatedUserInterface $user
58
- */
59
- public function isPasswordValid ($ user , string $ plainPassword ): bool
52
+ public function isPasswordValid (PasswordAuthenticatedUserInterface $ user , string $ plainPassword ): bool
60
53
{
61
54
if (!$ user instanceof PasswordAuthenticatedUserInterface) {
62
55
if (!$ user instanceof UserInterface) {
@@ -79,10 +72,7 @@ public function isPasswordValid($user, string $plainPassword): bool
79
72
return $ hasher ->verify ($ user ->getPassword (), $ plainPassword , $ salt );
80
73
}
81
74
82
- /**
83
- * @param PasswordAuthenticatedUserInterface $user
84
- */
85
- public function needsRehash ($ user ): bool
75
+ public function needsRehash (PasswordAuthenticatedUserInterface $ user ): bool
86
76
{
87
77
if (null === $ user ->getPassword ()) {
88
78
return false ;
0 commit comments