-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#6820Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/11e12bef-b1a9-4948-bc12-fc1d1c036ddf
<?php
function doFoo() {
$a = [];
$a[] = 1;
return $a;
}Responsible rules
ReturnTypeFromStrictNewArrayRector
Expected Behavior
creates
<?php
-function doFoo() {
+/**
+ * @return int[]
+ */
+function doFoo(): array {
$a = [];
$a[] = 1;
return $a;
}
but I would expect
<?php
-function doFoo() {
+/**
+ * @return list<int>
+ */
+function doFoo(): array {
$a = [];
$a[] = 1;
return $a;
}