File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ private static function findTestFiles(): iterable
253253 yield __DIR__ . '/data/dio-functions.php ' ;
254254 }
255255
256+ yield __DIR__ . '/../Rules/Variables/data/bug-13921.php ' ;
256257 yield __DIR__ . '/../Rules/Arrays/data/bug-14234.php ' ;
257258 yield __DIR__ . '/../Rules/Arrays/data/bug-11679.php ' ;
258259 yield __DIR__ . '/../Rules/Methods/data/bug-4801.php ' ;
Original file line number Diff line number Diff line change @@ -364,7 +364,12 @@ public function testBug14213(): void
364364
365365 public function testBug13921 (): void
366366 {
367- $ this ->analyse ([__DIR__ . '/data/bug-13921.php ' ], []);
367+ $ this ->analyse ([__DIR__ . '/data/bug-13921.php ' ], [
368+ [
369+ 'Offset 0 on non-empty-list<array<string|null>> on left side of ?? always exists and is not nullable. ' ,
370+ 17
371+ ]
372+ ]);
368373 }
369374
370375}
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ function foo(array $x): void {
1111 var_dump ($ x [0 ] ?? null );
1212}
1313
14+ /** @param non-empty-list<array<?string>> $x */
15+ function nonEmptyFoo (array $ x ): void {
16+ var_dump ($ x [0 ]['bar ' ] ?? null );
17+ var_dump ($ x [0 ] ?? null );
18+ }
19+
1420/** @param list<array<?string>> $x */
1521function bar (array $ x ): void {
1622 var_dump ($ x [0 ] ?? null );
You can’t perform that action at this time.
0 commit comments