Skip to content

Commit ec6c202

Browse files
committed
Use new reflection API
1 parent 8bae463 commit ec6c202

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/test/php/lang/ast/syntax/php/unittest/GenericsTest.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function implements_generic_interface() {
4242
$t= $this->type('class %T<E> implements '.$i->literal().'<E> { }');
4343

4444
$c= Primitive::$STRING;
45-
Assert::equals([$c], $t->newGenericType([$c])->getInterfaces()[0]->genericArguments());
45+
Assert::equals([$c], Reflection::type($t->newGenericType([$c]))->interfaces()[0]->class()->genericArguments());
4646
}
4747

4848
#[Test]
@@ -60,7 +60,7 @@ public function extends_generic_interface() {
6060
$t= $this->type('interface %T<E> extends '.$i->literal().'<E> { }');
6161

6262
$c= Primitive::$STRING;
63-
Assert::equals([$c], $t->newGenericType([$c])->getInterfaces()[0]->genericArguments());
63+
Assert::equals([$c], Reflection::type($t->newGenericType([$c]))->interfaces()[0]->class()->genericArguments());
6464
}
6565

6666
#[Test]

src/test/php/lang/ast/syntax/php/unittest/MethodsTest.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ public function run() {
144144

145145
#[Test]
146146
public function generic_type_inside_non_generic_class() {
147-
$q= $this->type('class %T<E> { }');
148-
$t= $this->type('class %T {
147+
$q= $this->declare('class %T<E> { }');
148+
$t= $this->declare('class %T {
149149
public function all('.$q->literal().'<?> $queue): iterable { /* Not implemented */ }
150150
}');
151151

152152
Assert::equals(
153-
new WildcardType($q, [Wildcard::$ANY]),
154-
$t->getMethod('all')->getParameter(0)->getType()
153+
new WildcardType($q->class(), [Wildcard::$ANY]),
154+
$t->method('all')->parameter(0)->constraint()->type()
155155
);
156156
}
157157
}

0 commit comments

Comments
 (0)