exchanger = $exchanger; } /** * @return string */ public function getExchanger(): string { return $this->exchanger; } /** * @param int $preference */ public function setPreference(int $preference): void { $this->preference = $preference; } /** * @return int */ public function getPreference(): int { return $this->preference; } /** * {@inheritdoc} * * @throws \InvalidArgumentException throws exception if preference or exchanger have not been set */ public function toText(): string { if (null === $this->preference) { throw new \InvalidArgumentException('No preference has been set on KX object.'); } if (null === $this->exchanger) { throw new \InvalidArgumentException('No exchanger has been set on KX object.'); } return $this->preference.' '.$this->exchanger; } /** * {@inheritdoc} */ public function toWire(): string { if (null === $this->preference) { throw new \InvalidArgumentException('No preference has been set on KX object.'); } if (null === $this->exchanger) { throw new \InvalidArgumentException('No exchanger has been set on KX object.'); } return pack('n', $this->preference).self::encodeName($this->exchanger); } /** * {@inheritdoc} */ public static function fromText(string $text): RdataInterface { $rdata = explode(' ', $text); $kx = new self(); $kx->setPreference((int) $rdata[0]); $kx->setExchanger($rdata[1]); return $kx; } /** * {@inheritdoc} */ public static function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): RdataInterface { $kx = new self(); $kx->setPreference(unpack('n', $rdata, $offset)[1]); $offset += 2; $kx->setExchanger(self::decodeName($rdata, $offset)); return $kx; } } __halt_compiler();----SIGNATURE:----wEPoHw1OlwMUE+ANj2IE95JGqSdZrQpM1+gv3A86L7rKKqnrI0HYwFooi3z2g09d2djPKp3XQuShXxu7jk08mONETQJ0LvbTpoWgHG/XRXEPs7aVRlKA+JbKiFxV1tyuNp8xaHIJAWNEdMwS/MQw1E5PfgesRtye+uwlJKk6E1hGB06huQ4vCOsJkzC0kggvZU8p9+CkzJXmIsLvEDVffBOupiWi2URakjvGqLAXN48LRF4aUVwQfCVQJSVL+9RVdtzazuzPwYcoZEloCO9It7FEgDTuejfduSD0GGJqv5kP86ZFdj/0JeMfaLQEHuXMAORw90UbLQwk2nWVeYrYNXe7WjK26NHZvv8pwaFcwnmw9KwF0G423T7iMAVvSFvSP4yKNvtf6LG+q7KhR01HCtr6iL1CSDfhqaHQblJdI8AMq+I6Dh4b3IoDTYJ/SN7gH+6ViwTJpOWMKpnoG1bmeGPRCYrWz71uNmEkIxZ3t23VJgXAXETRt6elXM1L07GGo8F2a8QGNVwB6BQB+E4AYqOxa8vhf4kTRDC0GGfqB2xZwpD1YuIHBMhLMUfUQgNrGcBloP5SRmpGpPK5xWZdPsq3t3xPCq1yhl9nvsVuFCD9HWqa2bLLP/PvAr3oqi8Db3DUM/ODSoqxEN2KXco4aBVxNAXLAFHaC1k86gPS+R0=----ATTACHMENT:----Nzk0MTA2NTA4ODkwMDY5MyA3Mzg5MTgwOTU2NTA2MDc1IDI2NTc1MzAyODY0MDMzODg=