예제 #1
0
파일: UserStub.php 프로젝트: Evyy/cffs-api
 public static function create()
 {
     //        return 'here';
     $faker = Factory::create();
     $identifier = UserId::generate();
     $email = Email::fromNative($faker->email);
     $first = FirstName::fromNative($faker->word);
     $last = LastName::fromNative($faker->word);
     $username = Username::fromNative($faker->word);
     $password = HashedPassword::fromNative(str_random(10));
     return User::create($identifier, $email, $first, $last, $username, $password);
 }
예제 #2
0
 /**
  * Check if password matches
  *
  * @param Password $password
  * @param HashedPassword $hashedPassword
  * @return boolean
  */
 public function check(Password $password, HashedPassword $hashedPassword)
 {
     return $this->hasher->check($password->toString(), $hashedPassword->toString());
 }
예제 #3
0
파일: User.php 프로젝트: Evyy/cffs-api
 /**
  * Set the User's password
  *
  * @param HashedPassword $password
  * @return void
  */
 private function setPassword(HashedPassword $password)
 {
     $this->password = $password->toString();
 }