| Total Complexity | 3 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 23 | class HttpException extends \RuntimeException implements HttpExceptionInterface |
||
| 24 | { |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Server Request instance |
||
| 28 | * |
||
| 29 | * @var ServerRequestInterface |
||
| 30 | */ |
||
| 31 | protected $request; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Response instance |
||
| 35 | * |
||
| 36 | * @var ResponseInterface |
||
| 37 | */ |
||
| 38 | protected $response; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Constructor of the class |
||
| 42 | * |
||
| 43 | * @param ServerRequestInterface $request |
||
| 44 | * @param ResponseInterface $response |
||
| 45 | * @param null|\Throwable $previous |
||
| 46 | */ |
||
| 47 | public function __construct(ServerRequestInterface $request, ResponseInterface $response, \Throwable $previous = null) |
||
| 48 | { |
||
| 49 | $this->request = $request; |
||
| 50 | |||
| 51 | $this->response = $response; |
||
| 52 | |||
| 53 | parent::__construct(\sprintf('%d %s', $response->getStatusCode(), $response->getReasonPhrase()), 0, $previous); |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritDoc} |
||
| 58 | */ |
||
| 59 | public function getRequest() : ServerRequestInterface |
||
| 60 | { |
||
| 61 | return $this->request; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritDoc} |
||
| 66 | */ |
||
| 67 | public function getResponse() : ResponseInterface |
||
| 70 | } |
||
| 71 | } |
||
| 72 |