Commit 40d765c
Use $varType->isNull()->maybe() instead of TypeCombinator::containsNull()
Address review feedback: cache $varType->isNull() in a variable to avoid
computing it twice, and use ->maybe() instead of TypeCombinator::containsNull()
for the nullable check.
Update throw-points test: doesntThrow() returns mixed which can be null,
so ?-> may short-circuit and variables assigned in the method name/arguments
should be "maybe defined", not "yes defined".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9b0b84a commit 40d765c
File tree
2 files changed
+6
-4
lines changed- src/Analyser/ExprHandler
- tests/PHPStan/Analyser/nsrt/throw-points/php8
2 files changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
0 commit comments