File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
tests/PHPStan/Rules/Functions Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,13 @@ public function testBug10732(): void
283283 $ this ->analyse ([__DIR__ . '/data/bug-10732.php ' ], []);
284284 }
285285
286+ public function testBug10960 (): void
287+ {
288+ $ this ->checkExplicitMixed = true ;
289+ $ this ->checkNullables = true ;
290+ $ this ->analyse ([__DIR__ . '/data/bug-10960.php ' ], []);
291+ }
292+
286293 public function testBug11518 (): void
287294 {
288295 $ this ->checkExplicitMixed = true ;
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug10960 ;
4+
5+ /**
6+ * @param array{foo: string} $foo
7+ *
8+ * @return array{FOO: string}
9+ */
10+ function upperCaseKey (array $ foo ): array
11+ {
12+ return array_change_key_case ($ foo , CASE_UPPER );
13+ }
14+
15+ /**
16+ * @param array{FOO: string} $foo
17+ *
18+ * @return array{foo: string}
19+ */
20+ function lowerCaseKey (array $ foo ): array
21+ {
22+ return array_change_key_case ($ foo , CASE_LOWER );
23+ }
24+
25+ upperCaseKey (['foo ' => 'bar ' ]);
26+ lowerCaseKey (['FOO ' => 'bar ' ]);
You can’t perform that action at this time.
0 commit comments