original_string: public static function checkEmailAddress($value) {
          $value = filter_var(trim($value),FILTER_SANITIZE_EMAIL);
          
          //validate the email address format
          if(!empty($value) && filter_var($value, FILTER_VALIDATE_EMAIL) === false){            
              throw new HpsInvalidRequestException(
                  HpsExceptionCodes::INVALID_EMAIL_ADDRESS, 'Invalid email address'
              );
          }
  
          //validate length of input data and throw exception
          if (!empty(self::$_inputFldMaxLength['Email']) && strlen($value) > self::$_inputFldMaxLength['Email']) {            
              $errorMessage = "The value for Email can be no more than " . self::$_inputFldMaxLength['Email'] . ' characters, Please try again after making corrections';
              throw new HpsInvalidRequestException(
                  HpsExceptionCodes::INVALID_INPUT_LENGTH, $errorMessage
              );
          }
          return $value;
      }
code: public static function checkEmailAddress($value) {
          $value = filter_var(trim($value),FILTER_SANITIZE_EMAIL);
          
          //validate the email address format
          if(!empty($value) && filter_var($value, FILTER_VALIDATE_EMAIL) === false){            
              throw new HpsInvalidRequestException(
                  HpsExceptionCodes::INVALID_EMAIL_ADDRESS, 'Invalid email address'
              );
          }
  
          //validate length of input data and throw exception
          if (!empty(self::$_inputFldMaxLength['Email']) && strlen($value) > self::$_inputFldMaxLength['Email']) {            
              $errorMessage = "The value for Email can be no more than " . self::$_inputFldMaxLength['Email'] . ' characters, Please try again after making corrections';
              throw new HpsInvalidRequestException(
                  HpsExceptionCodes::INVALID_INPUT_LENGTH, $errorMessage
              );
          }
          return $value;
      }
code_tokens: public static function checkEmailAddress ( $ value ) { $ value = filter_var ( trim ( $ value ) , FILTER_SANITIZE_EMAIL ) ; //validate the email address format if ( ! empty ( $ value ) && filter_var ( $ value , FILTER_VALIDATE_EMAIL ) === false ) { throw new HpsInvalidRequestException ( HpsExceptionCodes :: INVALID_EMAIL_ADDRESS , 'Invalid email address' ) ; } //validate length of input data and throw exception if ( ! empty ( self :: $ _inputFldMaxLength [ 'Email' ] ) && strlen ( $ value ) > self :: $ _inputFldMaxLength [ 'Email' ] ) { $ errorMessage = "The value for Email can be no more than " . self :: $ _inputFldMaxLength [ 'Email' ] . ' characters, Please try again after making corrections' ; throw new HpsInvalidRequestException ( HpsExceptionCodes :: INVALID_INPUT_LENGTH , $ errorMessage ) ; } return $ value ; }
docstring: This method clears the user input and return the email in correct format or throw an exception
  
  @param string $value this is user entered email address
  @return string
  @throws HpsInvalidRequestException
docstring_tokens: This method clears the user input and return the email in correct format or throw an exception