CountryCodeSource.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace libphonenumber;
  3. /**
  4. * Country code source from number
  5. */
  6. class CountryCodeSource
  7. {
  8. /**
  9. * The country_code is derived based on a phone number with a leading "+", e.g. the French
  10. * number "+33 1 42 68 53 00".
  11. */
  12. const FROM_NUMBER_WITH_PLUS_SIGN = 0;
  13. /**
  14. * The country_code is derived based on a phone number with a leading IDD, e.g. the French
  15. * number "011 33 1 42 68 53 00", as it is dialled from US.
  16. */
  17. const FROM_NUMBER_WITH_IDD = 1;
  18. /**
  19. * The country_code is derived based on a phone number without a leading "+", e.g. the French
  20. * number "33 1 42 68 53 00" when defaultCountry is supplied as France.
  21. */
  22. const FROM_NUMBER_WITHOUT_PLUS_SIGN = 2;
  23. /**
  24. * The country_code is derived NOT based on the phone number itself, but from the defaultCountry
  25. * parameter provided in the parsing function by the clients. This happens mostly for numbers
  26. * written in the national format (without country code). For example, this would be set when
  27. * parsing the French number "01 42 68 53 00", when defaultCountry is supplied as France.
  28. */
  29. const FROM_DEFAULT_COUNTRY = 3;
  30. const UNSPECIFIED = 4;
  31. }