setAlgorithm() public method

public setAlgorithm ( $algorithm )
Example #1
0
 /**
  * {@inheritDoc}
  */
 public function updatePassword(UserInterface $user)
 {
     if (0 !== strlen($password = $user->getPlainPassword())) {
         $user->setAlgorithm($this->algorithm);
         $encoder = $this->getEncoder($user);
         $user->setPassword($encoder->encodePassword($password, $user->getSalt()));
         $user->eraseCredentials();
     }
 }