Fork me on GitHub
a Sensio Labs Product

Space Sets (v3.64.0) edition

Rule phpdoc_list_type

PHPDoc list type must be used instead of array without a key.

Warning

Using this rule is risky

Risky when array key should be present, but is missing.

Examples

Example #1

--- Original
+++ New
 <?php
 /**
- * @param array<int> $x
- * @param array<array<string>> $y
+ * @param list<int> $x
+ * @param list<list<string>> $y
  */

References

The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.