We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bb9cdb commit 978a497Copy full SHA for 978a497
1 file changed
tests/PHPStan/Rules/Arrays/data/bug-14390.php
@@ -129,3 +129,21 @@ public function countMinus1Static(): void
129
}
130
131
132
+
133
+function doWithMethods(WithMethods $withMethods) {
134
+ echo $withMethods->pureMethod()[array_key_first($withMethods->pureMethod())];
135
+ echo $withMethods->impureMethod()[array_key_first($withMethods->impureMethod())];
136
+}
137
138
+class WithMethods {
139
+ /**
140
+ * @phpstan-pure
141
+ * @return non-empty-array
142
+ */
143
+ public function pureMethod():array {}
144
145
+ * @phpstan-impure
146
147
148
+ public function impureMethod():array {}
149
0 commit comments