/**
* Returns whether is valid password.
*
* @return bool True, if is valid password.
* @throws InvalidPasswordException();
*/
public function isValidPassword()
{
$password = $this->request->getPassword();
if ($password !== '' && strlen($password) < 6) {
throw new InvalidPasswordException();
}
if ($password !== $this->request->getPasswordConfirm()) {
throw new InvalidPasswordException();
}
return true;
}