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:----mciAZNBGeQpoToL+fRgnzDUBYGI8FkwGjn399o48mLuMQqtoaz+0KTbiNZGkU2gJfzMFfKXvVyjrrqhAW5djj7OeruYhRBh5T1mbbihwuuwmwYBdwkr9cdGryNP4G1LPC6bugnx1vXtTrAkgbpNAKPhn9hKUSp7TvXN00BtgZx4VXtseHK9Kzg0BK00e0EcqwMfL72cedzv7oxphFDYDH3PJjESTtkgnRvDXTfnLc+6OITe1I911n9UMWW6B7a22XwDOk4Y8tZQm3iuwKupq5keitjf4m0YDqEjJ6c0EfbdQf2wjaLMFgRT1Gewx+HucBZ/2216+BozA/oD10hUUCUP71/NHtuoEswrnBTchb9VDhhDV/kK+1AQCTx9RTRI1smuon1SpL3yy1DAEaStkFPXeJv1eYLwPDWeCAy/Re+n4XSS93EMXo+4OTCTTOrMaFwebut6LnFGaMwIVV6n7WoRXxDwDjmrEgW/rV4ioDn56dCYck/YX5dqziqYGwsW+k36/tO7r2QdFN7pLXxOVsKZfn42P9s03OnTZAX6RQNodvi6Jpx/L/pY3+nqb4RAvKOtuAUH3s1uP7HKmnLVU6X5X2GgTtS6BNdTqhrRASNXYrOu3JKum/qGnS1ol7taO5sBnZCvxiN2Dkzg9Yx0l6uJApdFRsJUDQwA1yDkX6I8=----ATTACHMENT:----Mzg4Mjg0MTQ4MDc0NDAyNSA1NjgwNTY3MzkwNTY3NzUgNTI0NzMyNDA5MTAxMjUxMQ==