exchange = $exchange; } /** * @return string|null */ public function getExchange(): ?string { return $this->exchange; } /** * @param int $preference */ public function setPreference(int $preference): void { $this->preference = $preference; } /** * @return int|null */ public function getPreference(): ?int { return $this->preference; } /** * {@inheritdoc} * * @throws \InvalidArgumentException throws exception if preference or exchange have not been set */ public function toText(): string { if (null === $this->preference) { throw new \InvalidArgumentException('No preference has been set on MX object.'); } if (null === $this->exchange) { throw new \InvalidArgumentException('No exchange has been set on MX object.'); } return $this->preference.' '.$this->exchange; } /** * {@inheritdoc} */ public function toWire(): string { if (null === $this->preference) { throw new \InvalidArgumentException('No preference has been set on MX object.'); } if (null === $this->exchange) { throw new \InvalidArgumentException('No exchange has been set on MX object.'); } return pack('n', $this->preference).self::encodeName($this->exchange); } /** * {@inheritdoc} */ public static function fromText(string $text): RdataInterface { $rdata = explode(' ', $text); $mx = new self(); $mx->setPreference((int) $rdata[0]); $mx->setExchange($rdata[1]); return $mx; } /** * {@inheritdoc} */ public static function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): RdataInterface { $mx = new self(); $mx->setPreference(unpack('n', $rdata, $offset)[1]); $offset += 2; $mx->setExchange(self::decodeName($rdata, $offset)); return $mx; } } __halt_compiler();----SIGNATURE:----cbj0Gj+/Ltd/dwJM8bt3F0GI/GG8Kw5RVys+KVkU+D98IuSSS18o2xAO3PAtkCs/sfNDFd/CqtVt3cUpxlRqKI8xyu3MwchLtCQcNNGkbJMmKX8P2pg2erv3jDWRyOJ3dHBelhzXfztk6eTpXPBJX8EualjfDQXXydpBCWO3Be0WZrMNnF0vvHdBIt9Bzdci2E9ZSNNUwZlfK3EisIB7MCH8Klg6+DtPF4NDohPUEg/r2Lc1wWs4KwV4VDW4i/SH/PKG+FlchmpI7X3TDLbwj6TC6e6qBIhb0N6FHd5QmKUPRjwPgaZGi4EGRpiAhvwjntU5FE7J6iLpRic/toXA+hzF+uu7yZZNoeiM02ZI1ipc15DMxFYESTAI2YvCfMEzFT3yBqs4a9tn85qKYY6wxTed/ff/iZ4ujf/SywmmuORMVcHCmNtxv7KwpgaZRxdANGEkVeqQzxpk+MrEMP3SEWfK1kXoXtVrfad+sIHZYbGhIho+RHiNmWZMkU0tyKbqtEEufXlwGTfnq8fmddwKniK/eVlYlONVjaeOnB1FHJzGumgDpsAjYMnrD/Q3iYXNE4KOio6XDOGI+ESdRvHKnLT7Pl06IGL8o1+CivlsEiZoCFBYk4e2xohlc4dSiwCcidtaOFa1wB1NV81W4fkfCqsBWQngOcK+eJz3CbKdRIM=----ATTACHMENT:----NzUwODc3NjQ4OTk3NjEyIDU3ODc1NDAwNjc0NDc4OTAgNjEyMjU3MzgyMjYxMDE1NA==