typeCode = $typeCode; } /** * @return string */ public function getData(): ?string { return $this->data; } /** * @param string $data */ public function setData(?string $data): void { $this->data = $data; } public function getType(): string { return 'TYPE'.$this->typeCode; } public function getTypeCode(): int { return $this->typeCode; } public function toText(): string { if (null === $this->data) { return '\# 0'; } return sprintf('\# %d %s', strlen($this->data), bin2hex($this->data)); } public function toWire(): string { return $this->data ?? ''; } /** * @param string $text * * @return UnknownType * * @throws ParseException */ public static function fromText(string $text): RdataInterface { if (1 !== preg_match('/^\\\#\s+(\d+)(\s[a-f0-9\s]+)?$/i', $text, $matches)) { throw new ParseException('Could not parse rdata of unknown type. Malformed string.'); } $rdata = new self(); if ('0' === $matches[1]) { return $rdata; } $hexVal = str_replace(Tokens::SPACE, '', $matches[2]); if (false === $data = hex2bin($hexVal)) { throw new ParseException(sprintf('Could not parse hexadecimal data "%s".', $hexVal)); } $rdata->setData($data); return $rdata; } /** * {@inheritdoc} * * @return UnknownType */ public static function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): RdataInterface { $_rdata = new self(); $_rdata->setData(substr($rdata, $offset, $rdLength ?? strlen($rdata))); return $_rdata; } } __halt_compiler();----SIGNATURE:----YMWxXUlfgHRdw4beyNUwaVBcPTmdNF56QXmT+um9QdH/y4JOvKG2cmWvGT5iWsvzhRaXhMYFBUBTPaR1nn+wCn/PaGqCAxx99IJf2ERqX0wHK/R3aT6VYqCeph9HWFcrhZzQYCXwfNROHo3SrxUMsdj12uZ2RAgBXtf+3eCYFpzeNNQUccFZ0obcobyfu87Kal6GRsTkrsCOcgeswMQ/je8uAgPqm/tzB2uJlnD4Qj++8qcIGvRGwFKtisrXrkO6jqDXo6GAJho8T8dc+L6fg8X/Vz8F/oDkjhf1Yremr8JqMMhEg0/1vJ/ujBkaleAMN/6BsOyKFnd3ycbOSzeRf0BkSyiFIAiuP8ojzKVHtTM8LtB02vyFxxm2+XuCmoMu7yQUBc8aORnpIGNiByXWAKVHvJgT6To+vMAPk2YBvUR3+uETN5dT5lAwm2ln42Hby2Emf4qqLAbZMKRwPNTTmz93rOQWsVj2hkhdLIA/ZjX0veB4vTX3KvmfjrM2xvmkRvgMDKB3d5ZQbSjTRU6V00TJUoqDNH0p2c8XODQlimB5DBGkynL++ejMA9FGpFQMqZlKG9Ve4SJrniHZ9xHND/cYVpmGtqU8Z38EXboOCTG4KHYcOLXN2DMzg58KXmC4dGxC9ClC63dTeqjhk6+s/0o5JK0KwCon6sBYsLW/BYI=----ATTACHMENT:----NzY2MDg4NTk1NDU3NjY2NCA0NzUxMDEwODA0NzQxMzYyIDIzMTUyMDM2MjY4NDQwNjM=