Repository navigation
Commit 6f6c561
Clarify ternary branch-inspection test: benevolent vs strict string|false
The previous `falsePositive` case used `stream_get_contents()`, which returns a
*benevolent* string|false. PHPStan intentionally accepts benevolent unions for a
string parameter, so the equivalent direct call is error-free too — and reporting
the branch would re-introduce the very pg_escape_bytea false positive this branch
inspection guards against (its second `string` parameter is fed the same
`stream_get_contents()` benevolent union).
Document that no-error case precisely and add a companion `strictFalseBranchReported`
showing that a *strict* (non-benevolent) string|false branch under the same
asymmetric `is_resource()` narrowing IS reported. This makes branch inspection's
consistency with PHPStan's standard accept semantics explicit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent d676451 commit 6f6c561
2 files changed
Lines changed: 24 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2989 | 2989 | | |
2990 | 2990 | | |
2991 | 2991 | | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
2992 | 2996 | | |
2993 | 2997 | | |
2994 | 2998 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
0 commit comments