| Total Complexity | 5 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class AsanaError extends RuntimeException { |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | protected $curlInfo; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param int $code |
||
| 26 | * @param string $message |
||
| 27 | * @param array $curlInfo |
||
| 28 | */ |
||
| 29 | public function __construct (int $code, string $message, array $curlInfo) { |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Asana context. |
||
| 36 | * |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | public function asResponse () { |
||
| 40 | return json_decode($this->getMessage(), true, JSON_BIGINT_AS_STRING | JSON_THROW_ON_ERROR); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * cURL context. |
||
| 45 | * |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | public function getCurlInfo (): array { |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param int $code |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | final public function is (int $code): bool { |
||
| 57 | return $this->code === $code; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return bool |
||
| 62 | */ |
||
| 63 | final public function isCurl (): bool { |
||
| 65 | } |
||
| 66 | } |