Skip to content

Commit 405eec0

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
1 parent 1a9ae52 commit 405eec0

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
@@ -1415,4 +1415,9 @@ public function testBug12984(): void
14151415
$this->analyse([__DIR__ . '/data/bug-12984.php'], []);
14161416
}
14171417

1418+
public function testBug12500(): void
1419+
{
1420+
$this->analyse([__DIR__ . '/data/bug-12500.php'], []);
1421+
}
1422+
14181423
}
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)