Skip to content

Commit 2cf70cb

Browse files
committed
Update params directrly in PasswordStrengthValidateEvent
1 parent 783d6bc commit 2cf70cb

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

app/bundles/UserBundle/Event/PasswordStrengthValidateEvent.php

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,8 @@
99
class PasswordStrengthValidateEvent extends Event
1010
{
1111
public function __construct(
12-
private bool $isValid,
13-
private string $password
12+
public bool $isValid,
13+
public string $password
1414
) {
1515
}
16-
17-
public function isValid(): bool
18-
{
19-
return $this->isValid;
20-
}
21-
22-
public function setIsValid(bool $isValid): PasswordStrengthValidateEvent
23-
{
24-
$this->isValid = $isValid;
25-
26-
return $this;
27-
}
28-
29-
public function getPassword(): string
30-
{
31-
return $this->password;
32-
}
33-
34-
public function setPassword(string $password): PasswordStrengthValidateEvent
35-
{
36-
$this->password = $password;
37-
38-
return $this;
39-
}
4016
}

app/bundles/UserBundle/Model/PasswordStrengthEstimatorModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function validate(?string $password, int $score = self::MINIMUM_PASSWORD_
3939
$passwordStrengthValidateEvent = new PasswordStrengthValidateEvent($isValid, $password);
4040
$this->dispatcher->dispatch($passwordStrengthValidateEvent, UserEvents::USER_PASSWORD_STRENGTH_VALIDATION);
4141

42-
return $passwordStrengthValidateEvent->isValid();
42+
return $passwordStrengthValidateEvent->isValid;
4343
}
4444

4545
/**

0 commit comments

Comments
 (0)