| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 13 | class GocketsException extends \Exception |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var Response |
||
| 17 | */ |
||
| 18 | protected $response; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * GocketsException constructor. |
||
| 22 | * |
||
| 23 | * @param $response string The original json response |
||
| 24 | * @param string $message |
||
| 25 | * @param int $code |
||
| 26 | * @param Throwable|null $previous |
||
| 27 | */ |
||
| 28 | 3 | public function __construct(string $response, string $message = '', $code = 0, Throwable $previous = null) |
|
| 29 | { |
||
| 30 | 3 | $this->makeResponse($response); |
|
| 31 | |||
| 32 | 3 | parent::__construct($message, $code, $previous); |
|
| 33 | 3 | } |
|
| 34 | |||
| 35 | 2 | public function getResponse(): Response |
|
| 38 | } |
||
| 39 | |||
| 40 | 3 | protected function makeResponse($content): void |
|
| 47 |