| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 5 | final class UnexpectedJsonTextResponseException extends InvalidResponseException |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string the unexpected JSON Text of the API response |
||
| 9 | */ |
||
| 10 | private $jsonText; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * utility method to shorten a string (e.g. to create shorter messages) |
||
| 14 | * |
||
| 15 | * @param string $buffer |
||
| 16 | * @param int $size |
||
| 17 | * @return string ASCII, printable with other characters escaped (C-slashes) |
||
| 18 | */ |
||
| 19 | public static function shorten(string $buffer, int $size = 32): string |
||
| 30 | } |
||
| 31 | |||
| 32 | public static function create(string $message, string $jsonText, \Throwable $previous = null): UnexpectedJsonTextResponseException |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getJsonText(): string |
||
| 45 |