Пример #1
0
 public function generateId() : string
 {
     return Token::generate(128);
 }
Пример #2
0
 public function generatePasswordResetToken($token = null, DateInterval $expiration = null) : UserEntityInterface
 {
     if (null === $expiration) {
         $expiration = new DateInterval('P1D');
     }
     $this->setPasswordResetToken(null === $token ? Token::generate(40) : $token);
     $this->setPasswordResetTokenExpirationDatetime((new DateTime())->add($expiration));
     $this->setLastPasswordResetTokenGeneratedDatetime(new DateTime());
     return $this;
 }