File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,32 @@ function getItemsWithForLoop(array $items): array
2121}
2222
2323/**
24- * @param non-empty- list<string> $items
24+ * @param list<string> $items
2525 *
26- * @return non-empty- list<string>
26+ * @return list<string>
2727 */
2828function getItemsWithForLoopInvertLastCond (array $ items ): array
2929{
3030 for ($ i = 0 ; count ($ items ) > $ i ; ++$ i ) {
3131 $ items [$ i ] = 'hello ' ;
3232 }
3333
34- assertType ('non-empty-list<string> ' , $ items );
34+ assertType ('list<string> ' , $ items );
35+ return $ items ;
36+ }
37+
38+
39+ /**
40+ * @param array<string> $items
41+ *
42+ * @return array<string>
43+ */
44+ function getItemsArray (array $ items ): array
45+ {
46+ for ($ i = 0 ; count ($ items ) > $ i ; ++$ i ) {
47+ $ items [$ i ] = 'hello ' ;
48+ }
49+
50+ assertType ('array<string> ' , $ items );
3551 return $ items ;
3652}
You can’t perform that action at this time.
0 commit comments