| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class ThrowableResponse extends \Exception implements ThrowableResponseInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var ResponseInterface |
||
| 18 | */ |
||
| 19 | protected $response; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param ResponseInterface $response The response to include in the exception. |
||
| 23 | * @param Throwable|null $previous The previous throwable used for the exception chaining. |
||
| 24 | * @param string $message The Exception message to throw. |
||
| 25 | * @param integer $code The Exception code. |
||
| 26 | */ |
||
| 27 | public function __construct( |
||
| 28 | ResponseInterface $response, |
||
| 29 | Throwable $previous = null, |
||
| 30 | string $message = "", |
||
| 31 | int $code = 0 |
||
| 32 | ) { |
||
| 33 | parent::__construct($message, $code, $previous); |
||
| 34 | $this->response = $response; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Create a ThrowableResponse with no other exception information |
||
| 39 | * |
||
| 40 | * @param ResponseInterface $response The response. |
||
| 41 | * @return ThrowableResponse |
||
| 42 | */ |
||
| 43 | public static function of(ResponseInterface $response) |
||
| 46 | } |
||
| 47 | |||
| 48 | public function getResponse(): ResponseInterface |
||
| 53 |