| 1 | <?php |
||
| 9 | class ClientException extends Exception |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var mixed |
||
| 13 | */ |
||
| 14 | protected $response; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param string $message |
||
| 18 | * @param integer $code |
||
| 19 | * @param array|string $response |
||
| 20 | * @return void |
||
|
|
|||
| 21 | */ |
||
| 22 | public function __construct(string $message, int $code, $response) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Returns the exception's response body. |
||
| 31 | * @TODO: Refactor this method, so that it returns a single type. |
||
| 32 | * |
||
| 33 | * @return array|string |
||
| 34 | */ |
||
| 35 | public function getResponseBody() |
||
| 39 | } |
||
| 40 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.