Skip to content

Commit f6a87b1

Browse files
committed
patch bugs type
1 parent 9a731c0 commit f6a87b1

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/Packet/Question.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Question implements PacketQuestionInterface
6666
*/
6767
public function __construct(
6868
string $name,
69-
string|Int|ResourceRecordTypeInterface $type,
69+
string|Int|ResourceRecordTypeInterface|ResourceRecordQTypeDefinitionInterface $type,
7070
string|int|ResourceRecordClassInterface $class,
7171
bool $disableInit = false
7272
) {
@@ -79,12 +79,12 @@ public function __construct(
7979
}
8080

8181
private function initType(
82-
string|Int|ResourceRecordTypeInterface $type,
82+
string|Int|ResourceRecordTypeInterface|ResourceRecordQTypeDefinitionInterface $type,
8383
): void {
8484
$this->type ??= Lookup::resourceType($type);
8585
}
8686

87-
private function initClass(string|Int|ResourceRecordTypeInterface $type, bool $internal = false): void
87+
private function initClass(string|Int|ResourceRecordClassInterface $type): void
8888
{
8989
if (isset($this->class)) {
9090
return;
@@ -113,13 +113,13 @@ private function initName(string $name, bool $internal = false): void
113113
* Init constructor
114114
*
115115
* @param string $name
116-
* @param string|Int|ResourceRecordTypeInterface $type
116+
* @param string|Int|ResourceRecordTypeInterface|ResourceRecordQTypeDefinitionInterface $type
117117
* @param string|int|ResourceRecordClassInterface $class
118118
* @return void
119119
*/
120120
private function init(
121121
string $name,
122-
string|Int|ResourceRecordTypeInterface $type,
122+
string|Int|ResourceRecordTypeInterface|ResourceRecordQTypeDefinitionInterface $type,
123123
string|int|ResourceRecordClassInterface $class
124124
): void {
125125
$this->initType($type);
@@ -203,6 +203,9 @@ public static function fromFilteredResponse(
203203
/** @noinspection PhpUnhandledExceptionInspection */
204204
$object = (new ReflectionClass(__CLASS__))
205205
->newInstanceWithoutConstructor();
206+
/**
207+
* @var Question $object
208+
*/
206209
try {
207210
$object->initType($type);
208211
} catch (Throwable) {

0 commit comments

Comments
 (0)