<?php /** * Exception for unknown status responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; use WpOrg\Requests\Response; /** * Exception for unknown status responses * * @package Requests\Exceptions */ final class StatusUnknown extends Http { /** * HTTP status code * * @var integer|bool Code if available, false if an error occurred */ protected $code = 0; /** * Reason phrase * * @var string */ protected $reason = 'Unknown'; /** * Create a new exception * * If `$data` is an instance of {@see \WpOrg\Requests\Response}, uses the status * code from it. Otherwise, sets as 0 * * @param string|null $reason Reason phrase * @param mixed $data Associated data */ public function __construct($reason = null, $data = null) { if ($data instanceof Response) { $this->code = (int) $data->status_code; } parent::__construct($reason, $data); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Status304.php | File | 460 B | 0644 |
|
Status305.php | File | 451 B | 0644 |
|
Status306.php | File | 460 B | 0644 |
|
Status400.php | File | 457 B | 0644 |
|
Status401.php | File | 460 B | 0644 |
|
Status402.php | File | 472 B | 0644 |
|
Status403.php | File | 451 B | 0644 |
|
Status404.php | File | 451 B | 0644 |
|
Status405.php | File | 478 B | 0644 |
|
Status406.php | File | 466 B | 0644 |
|
Status407.php | File | 511 B | 0644 |
|
Status408.php | File | 469 B | 0644 |
|
Status409.php | File | 448 B | 0644 |
|
Status410.php | File | 436 B | 0644 |
|
Status411.php | File | 469 B | 0644 |
|
Status412.php | File | 481 B | 0644 |
|
Status413.php | File | 496 B | 0644 |
|
Status414.php | File | 487 B | 0644 |
|
Status415.php | File | 490 B | 0644 |
|
Status416.php | File | 517 B | 0644 |
|
Status417.php | File | 478 B | 0644 |
|
Status418.php | File | 556 B | 0644 |
|
Status428.php | File | 583 B | 0644 |
|
Status429.php | File | 627 B | 0644 |
|
Status431.php | File | 613 B | 0644 |
|
Status500.php | File | 487 B | 0644 |
|
Status501.php | File | 469 B | 0644 |
|
Status502.php | File | 457 B | 0644 |
|
Status503.php | File | 481 B | 0644 |
|
Status504.php | File | 469 B | 0644 |
|
Status505.php | File | 502 B | 0644 |
|
Status511.php | File | 613 B | 0644 |
|
StatusUnknown.php | File | 970 B | 0644 |
|