Fork me on GitHub
a Sensio Labs Product

7th Gear (v3.59.3) edition

Rule phpdoc_array_type

PHPDoc array<T> type must be used instead of T[].


Using this rule is risky

Risky when using T[] in union types.


Example #1

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


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