Fork me on GitHub
a Sensio Labs Product

7th Gear (v3.59.3) edition

Rule phpdoc_list_type

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


Using this rule is risky

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


Example #1

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


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