@@ -14,6 +14,55 @@ static code analysis tools: [PHPStan](https://phpstan.org/) and [Psalm](https://
14
14
> The logical component (the physical existence of the type) is ** NOT**
15
15
> taken into account.
16
16
17
+ General table across all type parsing capabilities
18
+
19
+ <table style =" header-row " >
20
+ <tr>
21
+ <td>
22
+ <icon src="typelang.svg" height="16"/> <a href="https://github.com/php-type-language">TypeLang</a>
23
+ </td>
24
+ <td>
25
+ <icon src="psalm.png" height="16"/> <a href="https://github.com/vimeo/psalm">Psalm</a>
26
+ </td>
27
+ <td>
28
+ <icon src="phpstan.png" height="16"/> <a href="https://github.com/phpstan">PHPStan</a>
29
+ </td>
30
+ <td>
31
+ <icon src="phan.png" height="16"/> <a href="https://github.com/phan">PHAN</a>
32
+ </td>
33
+ <td>
34
+ <icon src="phpdocumentor.png" height="16"/> <a href="https://github.com/phpDocumentor">phpDocumentor</a>
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td>
39
+ <note>
40
+ <format style="bold" color="DarkSeaGreen">32/32</format>
41
+ </note>
42
+ </td>
43
+ <td>
44
+ <warning>
45
+ <format style="bold" color="RosyBrown">19/32</format>
46
+ </warning>
47
+ </td>
48
+ <td>
49
+ <warning>
50
+ <format style="bold" color="RosyBrown">25/32</format>
51
+ </warning>
52
+ </td>
53
+ <td>
54
+ <tip>
55
+ <format style="bold" color="DarkGray">?/32</format>
56
+ </tip>
57
+ </td>
58
+ <td>
59
+ <tip>
60
+ <format style="bold" color="DarkGray">?/32</format>
61
+ </tip>
62
+ </td>
63
+ </tr>
64
+ </table >
65
+
17
66
## Basic Types
18
67
19
68
Below is a list of simple, logical and other common types.
@@ -1039,7 +1088,7 @@ Below is a list of grammar of shaped types.
1039
1088
<td></td>
1040
1089
<td colspan="5">
1041
1090
<deflist collapsible="true">
1042
- <def title="1. Psalm supports only array and object types " id="ref-4-1">
1091
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-4-1">
1043
1092
<code-block lang="typescript">
1044
1093
// OK
1045
1094
object {
@@ -1081,7 +1130,7 @@ Below is a list of grammar of shaped types.
1081
1130
<td></td>
1082
1131
<td colspan="5">
1083
1132
<deflist collapsible="true">
1084
- <def title="1. Psalm supports only array and object types " id="ref-5-1">
1133
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-5-1">
1085
1134
<code-block lang="typescript">
1086
1135
// OK
1087
1136
object {
@@ -1123,7 +1172,7 @@ Below is a list of grammar of shaped types.
1123
1172
<td></td>
1124
1173
<td colspan="5">
1125
1174
<deflist collapsible="true">
1126
- <def title="1. Psalm supports only array and object types " id="ref-6-1">
1175
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-6-1">
1127
1176
<code-block lang="typescript">
1128
1177
// OK
1129
1178
object {
@@ -1190,7 +1239,7 @@ Below is a list of grammar of shaped types.
1190
1239
<td></td>
1191
1240
<td colspan="5">
1192
1241
<deflist collapsible="true">
1193
- <def title="1. Psalm supports only array and object types " id="ref-7-1">
1242
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-7-1">
1194
1243
<code-block lang="typescript">
1195
1244
// OK
1196
1245
object {
@@ -1230,7 +1279,7 @@ Below is a list of grammar of shaped types.
1230
1279
<td></td>
1231
1280
<td colspan="5">
1232
1281
<deflist collapsible="true">
1233
- <def title="1. Psalm supports only array and object types " id="ref-8-1">
1282
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-8-1">
1234
1283
<code-block lang="typescript">
1235
1284
// OK
1236
1285
object {}
@@ -1266,7 +1315,7 @@ Below is a list of grammar of shaped types.
1266
1315
<td></td>
1267
1316
<td colspan="5">
1268
1317
<deflist collapsible="true">
1269
- <def title="1. Psalm supports only array and object types " id="ref-9-1">
1318
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-9-1">
1270
1319
<code-block lang="typescript">
1271
1320
// OK
1272
1321
object { ... }
@@ -1305,7 +1354,7 @@ Below is a list of grammar of shaped types.
1305
1354
<td></td>
1306
1355
<td colspan="5">
1307
1356
<deflist collapsible="true">
1308
- <def title="1. Psalm supports only array and object types " id="ref-10-1">
1357
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-10-1">
1309
1358
<code-block lang="typescript">
1310
1359
// OK
1311
1360
object {
@@ -1350,7 +1399,7 @@ Below is a list of grammar of shaped types.
1350
1399
<td></td>
1351
1400
<td colspan="5">
1352
1401
<deflist collapsible="true">
1353
- <def title="1. Psalm supports only array and object types " id="ref-11-1">
1402
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-11-1">
1354
1403
<code-block lang="typescript">
1355
1404
// OK
1356
1405
object {
@@ -1386,20 +1435,15 @@ Below is a list of grammar of shaped types.
1386
1435
<td></td>
1387
1436
<td><icon src="ok.svg"/></td>
1388
1437
<td><icon src="warning.svg"/> <a anchor="ref-12-1">Works with restrictions <sup>1</sup></a></td>
1389
- <td>
1390
- <icon src="ko.svg"/>
1391
- <a href="https://phpstan.org/r/401619e4-36a2-4c30-94eb-16c40a62c7ad">
1392
- Not Supported
1393
- </a>
1394
- </td>
1438
+ <td><icon src="warning.svg"/> <a anchor="ref-12-2">Works with restrictions <sup>1</sup></a></td>
1395
1439
<td><icon src="unknown.svg"/></td>
1396
1440
<td><icon src="unknown.svg"/></td>
1397
1441
</tr>
1398
1442
<tr>
1399
1443
<td></td>
1400
1444
<td colspan="5">
1401
1445
<deflist collapsible="true">
1402
- <def title="1. Psalm supports only array and object types " id="ref-12-1">
1446
+ <def title="1. Psalm does not support custom (class instances) objects " id="ref-12-1">
1403
1447
<code-block lang="typescript">
1404
1448
// OK
1405
1449
object {
@@ -1414,6 +1458,22 @@ Below is a list of grammar of shaped types.
1414
1458
</code-block>
1415
1459
<a href="https://psalm.dev/r/487c82502c">Open in psalm.dev</a>
1416
1460
</def>
1461
+ <def title="2. PHPStan does not support some built-in types such as list (hardcoded in the parser)" id="ref-12-2">
1462
+ <code-block lang="typescript">
1463
+ // OK
1464
+ array {
1465
+ ...<array-key, Type>
1466
+ }
1467
+ </code-block>
1468
+ <code-block lang="typescript">
1469
+ // Syntax Error
1470
+ list {
1471
+ array-key,
1472
+ ...<Type>
1473
+ }
1474
+ </code-block>
1475
+ <a href="https://phpstan.org/r/d89fdfaf-cee8-4737-b5fd-c9145458da6a">Open in phpstan.org</a>
1476
+ </def>
1417
1477
</deflist>
1418
1478
</td>
1419
1479
</tr>
@@ -1431,7 +1491,7 @@ Below is a list of grammar of shaped types.
1431
1491
</td>
1432
1492
<td>
1433
1493
<warning>
1434
- <format style="bold" color="RosyBrown">9 /10</format>
1494
+ <format style="bold" color="RosyBrown">10 /10</format>
1435
1495
</warning>
1436
1496
</td>
1437
1497
<td>
0 commit comments