PluginProbe
PayPlug for WooCommerce (Official) / 2.9.0
PayPlug for WooCommerce (Official) v2.9.0
3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 All 101 releases
payplug / lib / libphonenumber / NumberParseException.php

NumberParseException.php in PayPlug for WooCommerce (Official) 2.9.0, at lib/libphonenumber/NumberParseException.php

48 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace libphonenumber;
4
5 /**
6 * Generic exception class for errors encountered when parsing phone numbers.
7 * @author Lara Rennie
8 */
9 class NumberParseException extends \Exception
10 {
11 const INVALID_COUNTRY_CODE = 0;
12 // This generally indicates the string passed in had less than 3 digits in it. More
13 // specifically, the number failed to match the regular expression VALID_PHONE_NUMBER in
14 // PhoneNumberUtil.
15 const NOT_A_NUMBER = 1;
16 // This indicates the string started with an international dialing prefix, but after this was
17 // stripped from the number, had less digits than any valid phone number (including country
18 // code) could have.
19 const TOO_SHORT_AFTER_IDD = 2;
20 // This indicates the string, after any country code has been stripped, had less digits than any
21 // valid phone number could have.
22 const TOO_SHORT_NSN = 3;
23 // This indicates the string had more digits than any valid phone number could have.
24 const TOO_LONG = 4;
25
26 protected $errorType;
27
28 public function __construct($errorType, $message, $previous = null)
29 {
30 parent::__construct($message, $errorType, $previous);
31 $this->message = $message;
32 $this->errorType = $errorType;
33 }
34
35 /**
36 * Returns the error type of the exception that has been thrown.
37 */
38 public function getErrorType()
39 {
40 return $this->errorType;
41 }
42
43 public function __toString()
44 {
45 return 'Error type: ' . $this->errorType . '. ' . $this->message;
46 }
47 }
48