priority; } /** * @throws \InvalidArgumentException */ public function setPriority(int $priority): void { if (!Validator::isUnsignedInteger($priority, 16)) { throw new \InvalidArgumentException('Priority must be an unsigned integer on the range [0-65535]'); } $this->priority = $priority; } /** * @return int */ public function getWeight(): ?int { return $this->weight; } /** * @throws \InvalidArgumentException */ public function setWeight(int $weight): void { if (!Validator::isUnsignedInteger($weight, 16)) { throw new \InvalidArgumentException('Weight must be an unsigned integer on the range [0-65535]'); } $this->weight = $weight; } /** * @return string */ public function getTarget(): ?string { return $this->target; } public function setTarget(string $target): void { if (false === filter_var($target, FILTER_VALIDATE_URL)) { throw new \InvalidArgumentException(sprintf('The target "%s" is not a valid URI.', $target)); } $this->target = $target; } public function toText(): string { return sprintf( '%d %d "%s"', $this->priority, $this->weight, $this->target ); } public function toWire(): string { return pack('nn', $this->priority, $this->weight).$this->target; } public function fromText(string $text): void { $rdata = explode(Tokens::SPACE, $text); $this->setPriority((int) array_shift($rdata)); $this->setWeight((int) array_shift($rdata)); $this->setTarget(trim(implode(Tokens::SPACE, $rdata), Tokens::DOUBLE_QUOTES)); } public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { if (false === $integers = unpack('npriority/nweight', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 4; $targetLen = ($rdLength ?? strlen($rdata)) - 4; $this->setTarget(substr($rdata, $offset, $targetLen)); $this->setPriority($integers['priority']); $this->setWeight($integers['weight']); $offset += $targetLen; } }__halt_compiler();----SIGNATURE:----GwOlIPkSRJyE1t20A7bGcs7uwwCG+YnjJK3P/amkmcVde3srvpDlZYfILGsI18SXX4ZQbD51LUbT0n7kAcSYR6+7Yi4JQQsyvVwGyMZlQiuEod/fc9/knPhjcsIvOau/QWh686jJnen5nqT732xgWlEAmzf8uK8v9kka0s8pZn8kAJstCSFGywcymgp4EicUaMt/uPrbZLBCcvUKBll5RguQn3KNGS+rFdDZ86ZIwwTwnE5s1D6WkqIyIs0wgo7QwJUZPw/akroqZoZX68WUmCYmAHBfgPNmKW2VOTrkY2kK1MYJjOEHYTBfbZd48iGogNTsKFFoP/mbSKd7BwnOMYWZwV0xJS1m3497iWoXYeMQ33ndS93PYFigZOPZgeI/AJx3ugSWh/eHlKo9ERJNXoQb/hZzKz+35uLfQKjyJJNp3VrKHEO+EptAf1QUuxbs7Zh7U2V9krTu5PgXpyxZQ2I2l6NK37Xiexx/ZjMCJoTeyD/fWCtGq87rCEGzAdk9nDnpUsEHKOMrIKeNieR8OOT0wF6Z+1efXHSFd150iDAt2EBaJVqhINHzih1S5cWNIR9Z9lBcOK40KOSdJu0B845F12YaTTea+APhho7Rz0254zaoy5Mai9vgDQ0ccDvBMBD7PA2rhTXPqf6DLz2pBm3ikurvOuiGqLTaVFG/Yr8=----ATTACHMENT:----MTQzOTExNTY1MTU2NDczNCA3NzM5MDQ0NTUxOTQ0ODM0IDk0MDk4NjUwNTQwNzMwMjQ=