| 1 | <?php |
||
| 8 | class Error implements \JsonSerializable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var \Exception |
||
| 12 | */ |
||
| 13 | protected $exception; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var ErrorFormatter |
||
| 17 | */ |
||
| 18 | protected $errorFormatter; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param \Exception $exception |
||
| 22 | * @param ErrorFormatter $errorFormatter |
||
| 23 | */ |
||
| 24 | 18 | public function __construct(\Exception $exception, ErrorFormatter $errorFormatter) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @return \Exception |
||
| 32 | */ |
||
| 33 | 18 | public function exception() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return int|mixed |
||
| 40 | */ |
||
| 41 | 12 | public function code() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | 6 | public function message() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return bool |
||
| 56 | */ |
||
| 57 | public function hasData() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return mixed|null |
||
| 64 | */ |
||
| 65 | public function data() |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return \stdClass |
||
| 74 | */ |
||
| 75 | public function jsonSerialize() |
||
| 79 | } |
||
| 80 |