Commit 2da3c78
Treat protected(set) properties as invariant for template variance
protected(set) allows subclasses to write to the property, just like
regular protected properties. Only private(set) truly restricts writes
to the declaring class, so only private(set) should be treated as
covariant.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8eca891 commit 2da3c78
File tree
2 files changed
+10
-2
lines changed- src/Rules/Generics
- tests/PHPStan/Rules/Generics
2 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
168 | 176 | | |
169 | 177 | | |
170 | 178 | | |
| |||
0 commit comments