name; } /** * @param string $name * * @throws InvalidArgumentException */ public function setName($name): void { if (!Validator::fullyQualifiedDomainName($name, false)) { throw new InvalidArgumentException(sprintf('"%s" is not a fully qualified domain name.', $name)); } $this->name = $name; } public function getTypeCode(): int { return $this->typeCode; } /** * @throws UnsupportedTypeException */ public function getType(): string { return Types::getName($this->typeCode); } /** * @throws \DomainException */ public function setTypeCode(int $typeCode): void { if (!Validator::isUnsignedInteger($typeCode, 16)) { throw new \DomainException(sprintf('TypeCode must be an unsigned 16-bit integer. "%d" given.', $typeCode)); } $this->typeCode = $typeCode; } /** * @throws UnsupportedTypeException */ public function setType(string $type): void { $this->setTypeCode(Types::getTypeCode($type)); } public function getClassId(): int { return $this->classId; } public function getClass(): string { return Classes::getClassName($this->classId); } /** * @throws \InvalidArgumentException */ public function setClassId(int $classId): void { if (!Validator::isUnsignedInteger($classId, 16)) { throw new InvalidArgumentException(sprintf('Invalid class: "%s".', $classId)); } $this->classId = $classId; } public function setClass(string $class): void { $this->setClassId(Classes::getClassId($class)); } public function toWire(): string { return Message::encodeName($this->name).pack('nn', $this->typeCode, $this->classId); } /** * @throws UnexpectedValueException * @throws UnsupportedTypeException */ public static function fromWire(string $encoded, int &$offset = 0): Question { $question = new self(); $question->setName(Message::decodeName($encoded, $offset)); if (false === $integers = unpack('ntype/nclass', $encoded, $offset)) { throw new UnexpectedValueException(sprintf('Malformed DNS query encountered. "%s"', DecodeException::binaryToHex($encoded))); } $question->setTypeCode($integers['type']); $question->setClassId($integers['class']); $offset += 4; return $question; } }__halt_compiler();----SIGNATURE:----NMYjnslNXwmtLqiLoGJ/NAw0GgJLa0Wd2ZiGEW16mcG2UkSXU112M9kpu121dvN+9KHNkUjHb2ubDP9rK6TtguqyYYfzJk6SaC52LxkEO1o3OJOvNRXFk0X1cOTN1fBMbNNhifVh8zuPhm0mXMPuAkwhLAjD7giBAC5xyiRCy9rNnrWdAkNIQTrPDM9l6aR2C4ZqrZmohntrZm1CWkv8Y3ehwd8lC8y2Q988h4skaU6oQITXMlD9UaTKNz8wvUqYTm2HrNIMnMhD4iw62sY5PHUZeiMDYlCnGMl9IUQFdfUhJ1sE1tMij41FaoVTYsVw6+WSxE9d8Wv3X3YdTLIyoiNRRzWjTaltMNvnlSHrANoZBce8RUO+EYBJVfAHDnxlsXZFc1teonoURvVFIy0YN9Mhbpr0LvaAxcZHaxYH3Yubi4SHftjV+cwtrDdza0ZFegUCEu38xh1cwPOGUv6Mk+IDu5rcAJ0pT2MDNMK9RQ41jMNcfIjYzsn6xyQX8PskabH0X4NS8akFSbYSF4OKkABSek6t8upcstJeVSDy4JnPnQbCCNvsELffkqoCzBNdjPmGilbdogv9K9uHUVqPtwTfih5R8qzeKKo55qIulTXEC5ffoFTpvVlPde9gt0wXh6vNwez2Xi0z/qWZdz+ySJVz3Ca75FYlWLfQOoFzgXk=----ATTACHMENT:----MjA4ODMyNTkxMTU1OTQ5MSAzNzkzMzQ1MDA3MzgxMjUwIDMyOTI1NjMxMDkwODI0Mzc=