| Total Complexity | 6 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class TelegramException extends Exception implements \JsonSerializable |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var int|null |
||
| 17 | */ |
||
| 18 | private $errorCode; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var string|null |
||
| 22 | */ |
||
| 23 | private $description; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return int|null |
||
| 27 | */ |
||
| 28 | public function getErrorCode(): ?int |
||
| 29 | { |
||
| 30 | return $this->errorCode; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param int|null $errorCode |
||
| 35 | */ |
||
| 36 | public function setErrorCode(?int $errorCode): void |
||
| 37 | { |
||
| 38 | $this->errorCode = $errorCode; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return string|null |
||
| 43 | */ |
||
| 44 | public function getDescription(): ?string |
||
| 45 | { |
||
| 46 | return $this->description; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param string|null $description |
||
| 51 | */ |
||
| 52 | public function setDescription(?string $description): void |
||
| 53 | { |
||
| 54 | $this->description = $description; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @inheritDoc |
||
| 59 | */ |
||
| 60 | public function jsonSerialize() |
||
| 61 | { |
||
| 62 | return [ |
||
| 63 | 'error_code' => $this->errorCode, |
||
| 64 | 'description' => $this->description |
||
| 65 | ]; |
||
| 66 | } |
||
| 67 | |||
| 68 | public function __toString() |
||
| 71 | } |
||
| 72 | |||
| 73 | } |
||
| 74 |