Commit b93cd6c
Cover the preg_replace_callback arrow-function reproducer in ArrowFunctionReturnTypeRuleTest
The second playground link on phpstan/phpstan#14914 uses an arrow function
without an explicit return type as the preg_replace_callback callback. That
case goes through ArrowFunctionReturnTypeRule (not ClosureReturnTypeRule), so
add it to bug-14914.php and assert no error there. Without the
replaceInFunctionCallStackParameterType fix it reports
"Anonymous function should return 'aa' but returns 'aa'|'possible?'".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 8183e68 commit b93cd6c
2 files changed
Lines changed: 15 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments