@@ -7,7 +7,7 @@ class IsOperatorTest extends EmittingTest {
7
7
8
8
#[Test]
9
9
public function this_is_self () {
10
- $ r = $ this ->run ('class <T> {
10
+ $ r = $ this ->run ('class %T {
11
11
public function run() {
12
12
return $this is self;
13
13
}
@@ -18,7 +18,7 @@ public function run() {
18
18
19
19
#[Test]
20
20
public function new_self_is_static () {
21
- $ r = $ this ->run ('class <T> {
21
+ $ r = $ this ->run ('class %T {
22
22
public function run() {
23
23
return new self() is static;
24
24
}
@@ -29,7 +29,7 @@ public function run() {
29
29
30
30
#[Test]
31
31
public function is_qualified_type () {
32
- $ r = $ this ->run ('class <T> {
32
+ $ r = $ this ->run ('class %T {
33
33
public function run() {
34
34
return new \util\Date() is \util\Date;
35
35
}
@@ -40,7 +40,7 @@ public function run() {
40
40
41
41
#[Test]
42
42
public function is_imported_type () {
43
- $ r = $ this ->run ('use util\Date; class <T> {
43
+ $ r = $ this ->run ('use util\Date; class %T {
44
44
public function run() {
45
45
return new Date() is Date;
46
46
}
@@ -51,7 +51,7 @@ public function run() {
51
51
52
52
#[Test]
53
53
public function is_aliased_type () {
54
- $ r = $ this ->run ('use util\Date as D; class <T> {
54
+ $ r = $ this ->run ('use util\Date as D; class %T {
55
55
public function run() {
56
56
return new D() is D;
57
57
}
@@ -62,7 +62,7 @@ public function run() {
62
62
63
63
#[Test]
64
64
public function is_type_variable () {
65
- $ r = $ this ->run ('class <T> {
65
+ $ r = $ this ->run ('class %T {
66
66
public function run() {
67
67
$type= self::class;
68
68
return new self() is $type;
@@ -74,7 +74,7 @@ public function run() {
74
74
75
75
#[Test]
76
76
public function is_primitive_type () {
77
- $ r = $ this ->run ('class <T> {
77
+ $ r = $ this ->run ('class %T {
78
78
public function run() {
79
79
return [1 is int, true is bool, -6.1 is float, 6.1 is float, "test" is string];
80
80
}
@@ -85,7 +85,7 @@ public function run() {
85
85
86
86
#[Test]
87
87
public function is_nullable_type () {
88
- $ r = $ this ->run ('class <T> {
88
+ $ r = $ this ->run ('class %T {
89
89
public function run() {
90
90
return [null is ?int, null is ?self, $this is ?self];
91
91
}
@@ -96,7 +96,7 @@ public function run() {
96
96
97
97
#[Test]
98
98
public function is_array_pseudo_type () {
99
- $ r = $ this ->run ('class <T> {
99
+ $ r = $ this ->run ('class %T {
100
100
public function run() {
101
101
return [[] is array, [1, 2, 3] is array, ["key" => "value"] is array, null is array];
102
102
}
@@ -107,7 +107,7 @@ public function run() {
107
107
108
108
#[Test]
109
109
public function is_object_pseudo_type () {
110
- $ r = $ this ->run ('class <T> {
110
+ $ r = $ this ->run ('class %T {
111
111
public function run() {
112
112
return [$this is object, function() { } is object, null is object];
113
113
}
@@ -118,7 +118,7 @@ public function run() {
118
118
119
119
#[Test]
120
120
public function is_callable_pseudo_type () {
121
- $ r = $ this ->run ('class <T> {
121
+ $ r = $ this ->run ('class %T {
122
122
public function run() {
123
123
return [function() { } is callable, [$this, "run"] is callable, null is callable];
124
124
}
@@ -129,7 +129,7 @@ public function run() {
129
129
130
130
#[Test]
131
131
public function is_native_iterable_type () {
132
- $ r = $ this ->run ('class <T> implements \IteratorAggregate {
132
+ $ r = $ this ->run ('class %T implements \IteratorAggregate {
133
133
public function getIterator(): \Traversable {
134
134
yield 1;
135
135
}
@@ -144,7 +144,7 @@ public function run() {
144
144
145
145
#[Test]
146
146
public function is_map_type () {
147
- $ r = $ this ->run ('class <T> {
147
+ $ r = $ this ->run ('class %T {
148
148
public function run() {
149
149
return [["key" => "value"] is array<string, string>, null is array<string, string>];
150
150
}
@@ -155,7 +155,7 @@ public function run() {
155
155
156
156
#[Test]
157
157
public function is_array_type () {
158
- $ r = $ this ->run ('class <T> {
158
+ $ r = $ this ->run ('class %T {
159
159
public function run() {
160
160
return [["key"] is array<string>, ["key"] is array<int>, null is array<string>];
161
161
}
@@ -166,7 +166,7 @@ public function run() {
166
166
167
167
#[Test]
168
168
public function is_union_type () {
169
- $ r = $ this ->run ('class <T> {
169
+ $ r = $ this ->run ('class %T {
170
170
public function run() {
171
171
return [1 is int|string, "test" is int|string, null is int|string];
172
172
}
@@ -177,7 +177,7 @@ public function run() {
177
177
178
178
#[Test]
179
179
public function is_function_type () {
180
- $ r = $ this ->run ('class <T> {
180
+ $ r = $ this ->run ('class %T {
181
181
public function run() {
182
182
return [function(int $a): int { } is function(int): int, null is function(int): int];
183
183
}
@@ -188,7 +188,7 @@ public function run() {
188
188
189
189
#[Test]
190
190
public function precedence () {
191
- $ r = $ this ->run ('class <T> {
191
+ $ r = $ this ->run ('class %T {
192
192
public function run() {
193
193
$arg= "Test";
194
194
return $arg is string ? sprintf("string <%s>", $arg) : typeof($arg)->literal();
@@ -200,7 +200,7 @@ public function run() {
200
200
201
201
#[Test, Values([[1 , 'int ' ], ['test ' , 'string ' ]])]
202
202
public function with_match_statement ($ arg , $ expected ) {
203
- $ r = $ this ->run ('class <T> {
203
+ $ r = $ this ->run ('class %T {
204
204
public function run(string|int $arg) {
205
205
return match {
206
206
$arg is string => "string",
0 commit comments