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:----XjQI0SiUUk+80zfppAwUOFrUQxEAl5KZG9lXambYnLy1zKr+w0gWP6DlBZRDliNt5ZHAUsj5IdZmb/fvf00JWesYD20FBkzX3VWDwm9MZBRBIAemxZPq4ivQOgxs2OAVgoLkNvRsWEtt7c0HZq+7bgj+NADSYj0dpl1VFebw9b8v0WH73DTY4BgHyppbkPUrBQ2nj8N2o+SVeNMoalKdRpWUtxQ8BVcIWMs4n7/TK9UymTK4JtFuxq+CduhFNkK7JDAFQproHakZFXijXO6oB5QpLg7e148xmuwaXZbVZIJxFm3Niw6PMsgg8D3fABnHlJJ9w+YW77ZmDZjX6Iz51iaVFCxlbyAXmSa4FaiBUDYbK7RpLzHah3vQ2rJ2w5e7sXXCfttk07bchls+55/GSMwR6gVOmsOSvLG2iTrx6VwvQs8x24DC4UvhZqku5ceiT2rJjOJ02uS0TFwpGfvKQAQ8SYdjr0iq6/2lodW1ezCGpjymNX1QhW01/YPVJ8jLBOFUYMlL7WX16YCAYRDK/yHDjfLS5T2Ia3FXXPjvqIyAwT2VQYZTW6rswjFaL86fFw6989GENS/KN7YZlGrAdddoJzgqiC9m7+jwjdjSSIF+KEsYS0p0qshnXuP+pTKCI/sNKYR0I/DxoPJ1v4MjwsRYGDg/qBcS9XH3VzNVJqU=----ATTACHMENT:----OTg1MDA2Mjc4Nzk1Mzc5OCAzNzYwOTIwODAyMjQ4MjEyIDQ5NzI5MzA4MDcxODg5NTk=