| Total Complexity | 2 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class DecodeException extends \Exception |
||
| 17 | { |
||
| 18 | public function __construct(string $type, string $rdata, int $code = 0, \Throwable $previous = null) |
||
| 19 | { |
||
| 20 | $message = sprintf('Unable to decode %s record rdata from binary data "%s"', $type, $this->binaryToHex($rdata)); |
||
| 21 | parent::__construct($message, $code, $previous); |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Convert a binary string into hexadecimal values. |
||
| 26 | * |
||
| 27 | * @param string $rdata |
||
| 28 | * |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | public function binaryToHex(string $rdata): string |
||
| 38 | } |
||
| 39 | } |
||
| 40 |