Commit 4f8d0b3
Still report method_exists($this) as always true when method is defined in the trait
When a trait defines a method itself, method_exists($this, 'method') will
always be true regardless of which class uses the trait. Only suppress the
report when the method is NOT defined in the trait, since then the result
depends on the using class.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent b18a0b0 commit 4f8d0b3
2 files changed
Lines changed: 14 additions & 1 deletion
File tree
- src/Rules/Comparison
- tests/PHPStan/Rules/Comparison
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
0 commit comments