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:----NZcZEjq0WH1l3ExVo+hzz0NI7iQfXbt4tN1lwf8z/VRbQ+okOgnCpVflDD8YLOCUjfdBmy+XPHirJLug4JNGzPoK95B+i2ErXGuPx2sYbEZ/tFR8lrIV5qxrY/6TV0RqPE/hzjWRagSV+AR/AxiaeLBiuzAFWMi+S2/e4OQiyVt87DWgVHxuYIPLsmxr2nSFzTh9BSC0ES/nbumvsDKHAzlA02+Ye7IjgssXIc6reAZYFS0iRIqmyQzp+n1MnYe0zLzb5maD/pfO0avHLS+5K6WRj+ntlXp6kPcrCq48/UiA14+BqyE7W7uxKsYtpbcnTRyO8lTphW9AtXnwFaGq3DtPCrYxorQTWQx18k5UuHyUDpFxhAeYLDV+YyFpBOKUt8qeYGerUWceO11uRR9Us9UUPPyIoEm605xmV1UtRLBDWKBZEzMjjgwy8b6PLp+eAJtML2QlRGYR9rZQOsZpguVRWyXcCF725+4K8JbyuyCYTJRpASxNhD5tO0OwDnoNvJ1MItMDGLIxJ1y33meBe++73MHftt9mXmZ6Ny4PZyRNUow8tF06HUMWBeazNhrgMYeL0yoaWKpDSTX/SyLC+v8jvxwXQNu478ErfyBlb3gsjOlTZAqklJ/WYxl8uzKbJmkzMNAbI6J6zCPdRHx99mJLeROgU9zi7PZlZz29PdM=----ATTACHMENT:----MTEwMTMwMTIxMTY0ODA5OCA0MjE2MjUzOTEzOTMzMDk5IDM1MTY4OTYyNjk3OTAyMDg=