public static function checkPhoneNumber($phoneNumber) {
        $phoneNumber = self::cleanPhoneNumber($phoneNumber);

        if (!empty($phoneNumber) && strlen($phoneNumber) > self::$_inputFldMaxLength['PhoneNumber']) {
            $errorMessage = 'The value for phone number can be no more than ' . self::$_inputFldMaxLength['PhoneNumber'] . ' characters, Please try again after making corrections';
            throw new HpsInvalidRequestException(
            HpsExceptionCodes::INVALID_PHONE_NUMBER, $errorMessage
            );
        }
        return $phoneNumber;
    }
public static function checkPhoneNumber($phoneNumber) {
        $phoneNumber = self::cleanPhoneNumber($phoneNumber);

        if (!empty($phoneNumber) && strlen($phoneNumber) > self::$_inputFldMaxLength['PhoneNumber']) {
            $errorMessage = 'The value for phone number can be no more than ' . self::$_inputFldMaxLength['PhoneNumber'] . ' characters, Please try again after making corrections';
            throw new HpsInvalidRequestException(
            HpsExceptionCodes::INVALID_PHONE_NUMBER, $errorMessage
            );
        }
        return $phoneNumber;
    }
public static function checkPhoneNumber ( $ phoneNumber ) { $ phoneNumber = self :: cleanPhoneNumber ( $ phoneNumber ) ; if ( ! empty ( $ phoneNumber ) && strlen ( $ phoneNumber ) > self :: $ _inputFldMaxLength [ 'PhoneNumber' ] ) { $ errorMessage = 'The value for phone number can be no more than ' . self :: $ _inputFldMaxLength [ 'PhoneNumber' ] . ' characters, Please try again after making corrections' ; throw new HpsInvalidRequestException ( HpsExceptionCodes :: INVALID_PHONE_NUMBER , $ errorMessage ) ; } return $ phoneNumber ; }
This method clears the user input and return the phone number in correct format or throw an exception

@param string $phoneNumber this is user entered phone number
@return string
@throws HpsInvalidRequestException
This method clears the user input and return the phone number in correct format or throw an exception