/** * 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()); }
/** @test */ public function should_create_from_native() { $password = Password::fromNative('qwertyuiop'); $this->assertInstanceOf('Cffs\\Domain\\Model\\Identity\\Password', $password); }
/** * 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)); }