Commit a923e6c
committed
bug #62772 [PropertyInfo] Fix calling same-named method with required args instead of reading public property (makraz)
This PR was submitted for the 7.3 branch but it was merged into the 6.4 branch instead.
Discussion
----------
[PropertyInfo] Fix calling same-named method with required args instead of reading public property
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix #62733
| License | MIT
- Fixes PropertyAccess choosing a same‑named method over a public property when the method requires parameters.
- Ensures jQuery‑style accessors (methods named exactly like the property) are only considered if they have zero required parameters.
- Prevents `ArgumentCountError` during serialization and aligns behavior with standard getter rules (`getX()/isX()/hasX()/canX()`), which already require zero required parameters.
Commits
-------
02e3153 [PropertyInfo] Fix calling same-named method with required args instead of reading public propertyFile tree
2 files changed
+19
-2
lines changed- src/Symfony/Component
- PropertyAccess/Tests
- PropertyInfo/Extractor
2 files changed
+19
-2
lines changedLines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
55 | 70 | | |
56 | 71 | | |
57 | 72 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| |||
0 commit comments