File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
tests/PHPStan/Rules/Arrays Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -926,4 +926,12 @@ public function testBug3747(): void
926926 $ this ->analyse ([__DIR__ . '/data/bug-3747.php ' ], []);
927927 }
928928
929+ public function testBug8372 (): void
930+ {
931+ $ this ->checkExplicitMixed = true ;
932+ $ this ->checkImplicitMixed = true ;
933+
934+ $ this ->analyse ([__DIR__ . '/data/bug-8372.php ' ], []);
935+ }
936+
929937}
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Bug8372 ;
4+
5+ class Test
6+ {
7+ /**
8+ * @param array<mixed> $path
9+ */
10+ function test (string $ method , array $ path ): void
11+ {
12+ if (!key_exists ($ method , $ path )) {
13+ return ;
14+ }
15+
16+ if (!is_array ($ path [$ method ])) {
17+ return ;
18+ }
19+
20+ if (!key_exists ('parameters ' , $ path [$ method ])) {
21+ $ path [$ method ]['parameters ' ] = [];
22+
23+ $ path [$ method ]['parameters ' ][] = 'foo ' ;
24+ $ path [$ method ]['parameters ' ][] = 'bar ' ;
25+ $ path [$ method ]['parameters ' ][] = 'baz ' ;
26+ }
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments