1 | <?php |
||
13 | class Exception extends \Exception |
||
14 | { |
||
15 | // Error codes returned as part of exception information. |
||
16 | const CODE_INVALID_ARG = -1; // Invalid argument passed. |
||
17 | const CODE_CURL_ERROR = -2; // Some error in CURL. |
||
18 | const CODE_API_ERROR = -3; // Some error condition returned by Optimizely API. |
||
19 | |||
20 | /** |
||
21 | * HTTP response code. |
||
22 | * @var integer |
||
23 | */ |
||
24 | private $httpCode; |
||
25 | |||
26 | /** |
||
27 | * Error UUID extracted from response JSON. |
||
28 | * @var type |
||
29 | */ |
||
30 | private $uuid; |
||
31 | |||
32 | /** |
||
33 | * The limit for this endpoint |
||
34 | * @var integer |
||
35 | */ |
||
36 | private $rateLimit; |
||
37 | |||
38 | /** |
||
39 | * The amount of calls remaining for this endpoint |
||
40 | * @var integer |
||
41 | */ |
||
42 | private $rateLimitRemaining; |
||
43 | |||
44 | /** |
||
45 | * The X-RateLimit-Reset header provides a Unix UTC timestamp, letting you |
||
46 | * know the exact time that your fresh new rate limit kicks in. |
||
47 | * @var string |
||
48 | */ |
||
49 | private $rateLimitReset; |
||
50 | |||
51 | /** |
||
52 | * Constructor. |
||
53 | */ |
||
54 | 3 | public function __construct($message, $code = self::CODE_INVALID_ARG, $options = array()) |
|
73 | |||
74 | /** |
||
75 | * Return HTTP response code. |
||
76 | * @return integer |
||
77 | */ |
||
78 | public function getHttpCode() |
||
82 | |||
83 | /** |
||
84 | * Set HTTP response code. |
||
85 | * @param integer $code |
||
|
|||
86 | */ |
||
87 | 1 | public function setHttpCode($httpCode) |
|
91 | |||
92 | /** |
||
93 | * Return error UUID. |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getUuid() |
||
100 | |||
101 | /** |
||
102 | * Set message |
||
103 | * @param string $message |
||
104 | */ |
||
105 | public function setUuid($uuid) |
||
109 | |||
110 | public function getRateLimit() |
||
114 | |||
115 | public function setRateLimit($rateLimit) |
||
119 | |||
120 | public function getRateLimitRemaining() |
||
124 | |||
125 | public function setRateLimitRemaining($rateLimitRemaining) |
||
129 | |||
130 | public function getRateLimitReset() |
||
134 | |||
135 | public function setRateLimitReset($rateLimitReset) |
||
139 | } |
||
140 | |||
142 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.