Skip to content

Commit faf0b8c

Browse files
ondrejmirtesclaude
andcommitted
Add regression test for collateral fix #12500
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CGhnJQpUWRRpg6H5LuWJkA Amp-Thread-ID: https://ampcode.com/threads/T-01a19219-874b-7614-bea5-a5f416095107
1 parent c8714c9 commit faf0b8c

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,4 +1419,9 @@ public function testBug13325(): void
14191419
$this->analyse([__DIR__ . '/data/bug-13325.php'], []);
14201420
}
14211421

1422+
public function testBug12500(): void
1423+
{
1424+
$this->analyse([__DIR__ . '/data/bug-12500.php'], []);
1425+
}
1426+
14221427
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug12500;
4+
5+
class HelloWorld
6+
{
7+
/**
8+
* @param array<string,string|int> $input
9+
* @return array<string,string>
10+
*/
11+
public function clean(array $input): array {
12+
foreach ($input as $k => $v) {
13+
if (\is_int($v)) { $input[$k] = 'was-int'; }
14+
}
15+
return $input;
16+
}
17+
}

0 commit comments

Comments
 (0)