| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ErrorResponse extends \RuntimeException |
||
| 10 | { |
||
| 11 | private RequestInterface $request; |
||
| 12 | private ResponseInterface $response; |
||
| 13 | |||
| 14 | public function __construct( |
||
| 15 | int $code, |
||
| 16 | string $message, |
||
| 17 | RequestInterface $request, |
||
| 18 | ResponseInterface $response, |
||
| 19 | \Throwable $previous = null |
||
| 20 | ) { |
||
| 21 | parent::__construct($message, $code, $previous); |
||
| 22 | $this->request = $request; |
||
| 23 | $this->response = $response; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getRequest(): RequestInterface |
||
| 27 | { |
||
| 28 | return $this->request; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getResponse(): ResponseInterface |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getResponseAsString(): string |
||
| 37 | { |
||
| 38 | return Message::toString($this->response); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getRequestAsString(): string |
||
| 42 | { |
||
| 43 | return Message::toString($this->request); |
||
| 44 | } |
||
| 45 | |||
| 46 | public function __toString(): string |
||
| 52 | ; |
||
| 53 | } |
||
| 54 | } |
||
| 55 |