Skip to content

Commit

Permalink
Update params directrly in PasswordStrengthValidateEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykgruszka committed Oct 27, 2023
1 parent 783d6bc commit 2cf70cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
28 changes: 2 additions & 26 deletions app/bundles/UserBundle/Event/PasswordStrengthValidateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,8 @@
class PasswordStrengthValidateEvent extends Event
{
public function __construct(
private bool $isValid,
private string $password
public bool $isValid,
public string $password
) {
}

public function isValid(): bool
{
return $this->isValid;
}

public function setIsValid(bool $isValid): PasswordStrengthValidateEvent
{
$this->isValid = $isValid;

return $this;
}

public function getPassword(): string
{
return $this->password;
}

public function setPassword(string $password): PasswordStrengthValidateEvent
{
$this->password = $password;

return $this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function validate(?string $password, int $score = self::MINIMUM_PASSWORD_
$passwordStrengthValidateEvent = new PasswordStrengthValidateEvent($isValid, $password);
$this->dispatcher->dispatch($passwordStrengthValidateEvent, UserEvents::USER_PASSWORD_STRENGTH_VALIDATION);

return $passwordStrengthValidateEvent->isValid();
return $passwordStrengthValidateEvent->isValid;
}

/**
Expand Down

0 comments on commit 2cf70cb

Please sign in to comment.