@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_415 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 415; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 415; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Unsupported Media Type'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Unsupported Media Type'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_403 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 403; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 403; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Forbidden'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Forbidden'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -11,34 +11,34 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_Unknown extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer|bool Code if available, false if an error occurred |
|
18 | - */ |
|
19 | - protected $code = 0; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer|bool Code if available, false if an error occurred |
|
18 | + */ |
|
19 | + protected $code = 0; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Unknown'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Unknown'; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Create a new exception |
|
30 | - * |
|
31 | - * If `$data` is an instance of {@see Requests_Response}, uses the status |
|
32 | - * code from it. Otherwise, sets as 0 |
|
33 | - * |
|
34 | - * @param string|null $reason Reason phrase |
|
35 | - * @param mixed $data Associated data |
|
36 | - */ |
|
37 | - public function __construct($reason = null, $data = null) { |
|
38 | - if ($data instanceof Requests_Response) { |
|
39 | - $this->code = $data->status_code; |
|
40 | - } |
|
28 | + /** |
|
29 | + * Create a new exception |
|
30 | + * |
|
31 | + * If `$data` is an instance of {@see Requests_Response}, uses the status |
|
32 | + * code from it. Otherwise, sets as 0 |
|
33 | + * |
|
34 | + * @param string|null $reason Reason phrase |
|
35 | + * @param mixed $data Associated data |
|
36 | + */ |
|
37 | + public function __construct($reason = null, $data = null) { |
|
38 | + if ($data instanceof Requests_Response) { |
|
39 | + $this->code = $data->status_code; |
|
40 | + } |
|
41 | 41 | |
42 | - parent::__construct($reason, $data); |
|
43 | - } |
|
42 | + parent::__construct($reason, $data); |
|
43 | + } |
|
44 | 44 | } |
45 | 45 | \ No newline at end of file |
@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_414 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 414; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 414; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Request-URI Too Large'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Request-URI Too Large'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_402 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 402; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 402; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Payment Required'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Payment Required'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_417 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 417; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 417; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Expectation Failed'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Expectation Failed'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_408 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 408; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 408; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Request Timeout'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Request Timeout'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_400 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 400; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 400; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Bad Request'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Bad Request'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -11,17 +11,17 @@ |
||
11 | 11 | * @package Requests |
12 | 12 | */ |
13 | 13 | class Requests_Exception_HTTP_503 extends Requests_Exception_HTTP { |
14 | - /** |
|
15 | - * HTTP status code |
|
16 | - * |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - protected $code = 503; |
|
14 | + /** |
|
15 | + * HTTP status code |
|
16 | + * |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + protected $code = 503; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Reason phrase |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $reason = 'Service Unavailable'; |
|
21 | + /** |
|
22 | + * Reason phrase |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $reason = 'Service Unavailable'; |
|
27 | 27 | } |
28 | 28 | \ No newline at end of file |