Skip to content

Commit 2687a09

Browse files
committed
Drop XP 9, add XP 12
1 parent 0b282d2 commit 2687a09

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Is operator for PHP - ChangeLog
33

44
## ?.?.? / ????-??-??
55

6+
## 2.0.0 / 2022-03-24
7+
8+
* Dropped support for PHP 7.0 - 7.3 - @thekid
9+
* Dropped support for XP <= 9, see xp-framework/rfc#341 - @thekid
10+
* Made compatible with XP 12, Compiler version 9.0.0 - @thekid
11+
* Added PHP 8.4 to the test matrix - @thekid
12+
613
## 1.1.2 / 2022-01-24
714

815
* Made compatible with compiler version 8.0.0 - @thekid

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"description" : "Is operator for PHP",
77
"keywords": ["language", "module", "xp"],
88
"require" : {
9-
"xp-framework/core": "^11.0 | ^10.0 | ^9.0 | ^8.0 | ^7.0",
10-
"xp-framework/compiler": "^8.0 | ^7.0 | ^6.0 | ^5.0 | ^4.3",
11-
"php" : ">=7.0.0"
9+
"xp-framework/core": "^12.0 | ^11.0 | ^10.0",
10+
"xp-framework/compiler": "^9.0 | ^8.0",
11+
"php" : ">=7.4.0"
1212
},
1313
"require-dev" : {
14-
"xp-framework/test": "^1.0"
14+
"xp-framework/test": "^2.0 | ^1.0"
1515
},
1616
"autoload" : {
1717
"files" : ["src/main/php/autoload.php"]

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class IsOperatorTest extends EmittingTest {
77

88
#[Test]
99
public function this_is_self() {
10-
$r= $this->run('class <T> {
10+
$r= $this->run('class %T {
1111
public function run() {
1212
return $this is self;
1313
}
@@ -18,7 +18,7 @@ public function run() {
1818

1919
#[Test]
2020
public function new_self_is_static() {
21-
$r= $this->run('class <T> {
21+
$r= $this->run('class %T {
2222
public function run() {
2323
return new self() is static;
2424
}
@@ -29,7 +29,7 @@ public function run() {
2929

3030
#[Test]
3131
public function is_qualified_type() {
32-
$r= $this->run('class <T> {
32+
$r= $this->run('class %T {
3333
public function run() {
3434
return new \util\Date() is \util\Date;
3535
}
@@ -40,7 +40,7 @@ public function run() {
4040

4141
#[Test]
4242
public function is_imported_type() {
43-
$r= $this->run('use util\Date; class <T> {
43+
$r= $this->run('use util\Date; class %T {
4444
public function run() {
4545
return new Date() is Date;
4646
}
@@ -51,7 +51,7 @@ public function run() {
5151

5252
#[Test]
5353
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 {
5555
public function run() {
5656
return new D() is D;
5757
}
@@ -62,7 +62,7 @@ public function run() {
6262

6363
#[Test]
6464
public function is_type_variable() {
65-
$r= $this->run('class <T> {
65+
$r= $this->run('class %T {
6666
public function run() {
6767
$type= self::class;
6868
return new self() is $type;
@@ -74,7 +74,7 @@ public function run() {
7474

7575
#[Test]
7676
public function is_primitive_type() {
77-
$r= $this->run('class <T> {
77+
$r= $this->run('class %T {
7878
public function run() {
7979
return [1 is int, true is bool, -6.1 is float, 6.1 is float, "test" is string];
8080
}
@@ -85,7 +85,7 @@ public function run() {
8585

8686
#[Test]
8787
public function is_nullable_type() {
88-
$r= $this->run('class <T> {
88+
$r= $this->run('class %T {
8989
public function run() {
9090
return [null is ?int, null is ?self, $this is ?self];
9191
}
@@ -96,7 +96,7 @@ public function run() {
9696

9797
#[Test]
9898
public function is_array_pseudo_type() {
99-
$r= $this->run('class <T> {
99+
$r= $this->run('class %T {
100100
public function run() {
101101
return [[] is array, [1, 2, 3] is array, ["key" => "value"] is array, null is array];
102102
}
@@ -107,7 +107,7 @@ public function run() {
107107

108108
#[Test]
109109
public function is_object_pseudo_type() {
110-
$r= $this->run('class <T> {
110+
$r= $this->run('class %T {
111111
public function run() {
112112
return [$this is object, function() { } is object, null is object];
113113
}
@@ -118,7 +118,7 @@ public function run() {
118118

119119
#[Test]
120120
public function is_callable_pseudo_type() {
121-
$r= $this->run('class <T> {
121+
$r= $this->run('class %T {
122122
public function run() {
123123
return [function() { } is callable, [$this, "run"] is callable, null is callable];
124124
}
@@ -129,7 +129,7 @@ public function run() {
129129

130130
#[Test]
131131
public function is_native_iterable_type() {
132-
$r= $this->run('class <T> implements \IteratorAggregate {
132+
$r= $this->run('class %T implements \IteratorAggregate {
133133
public function getIterator(): \Traversable {
134134
yield 1;
135135
}
@@ -144,7 +144,7 @@ public function run() {
144144

145145
#[Test]
146146
public function is_map_type() {
147-
$r= $this->run('class <T> {
147+
$r= $this->run('class %T {
148148
public function run() {
149149
return [["key" => "value"] is array<string, string>, null is array<string, string>];
150150
}
@@ -155,7 +155,7 @@ public function run() {
155155

156156
#[Test]
157157
public function is_array_type() {
158-
$r= $this->run('class <T> {
158+
$r= $this->run('class %T {
159159
public function run() {
160160
return [["key"] is array<string>, ["key"] is array<int>, null is array<string>];
161161
}
@@ -166,7 +166,7 @@ public function run() {
166166

167167
#[Test]
168168
public function is_union_type() {
169-
$r= $this->run('class <T> {
169+
$r= $this->run('class %T {
170170
public function run() {
171171
return [1 is int|string, "test" is int|string, null is int|string];
172172
}
@@ -177,7 +177,7 @@ public function run() {
177177

178178
#[Test]
179179
public function is_function_type() {
180-
$r= $this->run('class <T> {
180+
$r= $this->run('class %T {
181181
public function run() {
182182
return [function(int $a): int { } is function(int): int, null is function(int): int];
183183
}
@@ -188,7 +188,7 @@ public function run() {
188188

189189
#[Test]
190190
public function precedence() {
191-
$r= $this->run('class <T> {
191+
$r= $this->run('class %T {
192192
public function run() {
193193
$arg= "Test";
194194
return $arg is string ? sprintf("string <%s>", $arg) : typeof($arg)->literal();
@@ -200,7 +200,7 @@ public function run() {
200200

201201
#[Test, Values([[1, 'int'], ['test', 'string']])]
202202
public function with_match_statement($arg, $expected) {
203-
$r= $this->run('class <T> {
203+
$r= $this->run('class %T {
204204
public function run(string|int $arg) {
205205
return match {
206206
$arg is string => "string",

0 commit comments

Comments
 (0)