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); }
/** * 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()); }
/** * Set the User's password * * @param HashedPassword $password * @return void */ private function setPassword(HashedPassword $password) { $this->password = $password->toString(); }