Esempio n. 1
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());
 }
Esempio n. 2
0
 /** @test */
 public function should_create_from_native()
 {
     $password = Password::fromNative('qwertyuiop');
     $this->assertInstanceOf('Cffs\\Domain\\Model\\Identity\\Password', $password);
 }
Esempio n. 3
0
 /**
  * Create a new instance from a native form
  *
  * @param mixed $email
  * @param mixed $password
  * @return ValueObject
  */
 public static function fromNative($email, $password)
 {
     return new Credentials(Email::fromNative($email), Password::fromNative($password));
 }