Skip to content

Commit 40c0b2c

Browse files
Add test
1 parent 7133400 commit 40c0b2c

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/PHPStan/Rules/Functions/ReturnTypeRuleTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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']);

0 commit comments

Comments
 (0)