PayPalValidationNumericValidator

Class NumericValidator.

Defined (1)

The class is defined in the following location(s).

/classes/lib/PayPal/Validation/NumericValidator.php  
  1. class NumericValidator 
  2.  
  3. /** 
  4. * Helper method for validating an argument if it is numeric 
  5. * @param mixed $argument 
  6. * @param string|null $argumentName 
  7. * @return bool 
  8. */ 
  9. public static function validate($argument, $argumentName = null) 
  10. if (trim($argument) != null && !is_numeric($argument)) { 
  11. throw new \InvalidArgumentException("$argumentName is not a valid numeric value"); 
  12.  
  13. return true;