File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
tests/PHPStan/Rules/Properties Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,11 @@ public function testBug1216(): void
139139 ]);
140140 }
141141
142+ public function testBug1311 (): void
143+ {
144+ $ this ->analyse ([__DIR__ . '/data/bug-1311.php ' ], []);
145+ }
146+
142147 public function testTypesAssignedToPropertiesExpressionNames (): void
143148 {
144149 $ this ->analyse ([__DIR__ . '/data/properties-from-array-into-object.php ' ], [
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug1311 ;
4+
5+ class HelloWorld
6+ {
7+ /**
8+ * @var array<int, string>
9+ */
10+ private $ list = [];
11+
12+ public function convertList (): void
13+ {
14+ $ temp = [1 , 2 , 3 ];
15+
16+ for ($ i = 0 ; $ i < count ($ temp ); $ i ++) {
17+ $ temp [$ i ] = (string ) $ temp [$ i ];
18+ }
19+
20+ $ this ->list = $ temp ;
21+ }
22+ }
23+
24+ (new HelloWorld ())->convertList ();
You can’t perform that action at this time.
0 commit comments