Server.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WonderPush\Errors; |
| 4 | |
| 5 | if (count(get_included_files()) === 1) { http_response_code(403); exit(); } // Prevent direct access |
| 6 | |
| 7 | /** |
| 8 | * Network related errors, and API error responses. |
| 9 | */ |
| 10 | class Server extends Base { |
| 11 | |
| 12 | /** @var \WonderPush\Net\Request */ |
| 13 | protected $request; |
| 14 | |
| 15 | /** @var \WonderPush\Net\Response */ |
| 16 | protected $response; |
| 17 | |
| 18 | public function __construct(\WonderPush\Net\Request $request, \WonderPush\Net\Response $response, $message = '', $code = '0', \Exception $previous = null) { |
| 19 | parent::__construct($message, $code, $previous); |
| 20 | $this->request = $request; |
| 21 | $this->response = $response; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * The network request that was performed. |
| 26 | * @return \WonderPush\Net\Request |
| 27 | */ |
| 28 | public function getRequest() { |
| 29 | return $this->request; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * The network response that was received. |
| 34 | * @return \WonderPush\Net\Response |
| 35 | */ |
| 36 | public function getResponse() { |
| 37 | return $this->response; |
| 38 | } |
| 39 | |
| 40 | } |
| 41 |