ValidationResult.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace libphonenumber;
  3. /**
  4. * Possible outcomes when testing if a PhoneNumber is possible.
  5. */
  6. class ValidationResult
  7. {
  8. /**
  9. * The number length matches that of valid numbers for this region
  10. */
  11. const IS_POSSIBLE = 0;
  12. /**
  13. * The number has an invalid country calling code.
  14. */
  15. const INVALID_COUNTRY_CODE = 1;
  16. /**
  17. * The number is shorter than all valid numbers for this region.
  18. */
  19. const TOO_SHORT = 2;
  20. /**
  21. * The number is longer than all valid numbers for this region.
  22. */
  23. const TOO_LONG = 3;
  24. /**
  25. * The number length matches that of local numbers for this region only (i.e. numbers that may
  26. * be able to be dialled within an area, but do not have all the information to be dialled from
  27. * anywhere inside or outside the country).
  28. */
  29. const IS_POSSIBLE_LOCAL_ONLY = 4;
  30. /**
  31. * The number is longer than the shortest valid numbers for this region, shorter than the
  32. * longest valid numbers for this region, and does not itself have a number length that matches
  33. * valid numbers for this region. This can also be returned in the case where
  34. * isPossibleNumberForTypeWithReason was called, and there are no numbers of this type at all
  35. * for this region.
  36. */
  37. const INVALID_LENGTH = 5;
  38. }