Commit dc4f3fb
committed
bug #54194 [PropertyAccess] Fix checking for missing properties (nicolas-grekas)
This PR was merged into the 6.4 branch.
Discussion
----------
[PropertyAccess] Fix checking for missing properties
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix #48970, fix #54194, fix #51919
| License | MIT
PropertyAccess and PropertyInfo make a few assumptions when magic methods are involved.
Namely they assume that if a `__get` method is defined, then any property name is accessible.
This assumption is generally wrong, and this becomes more evident with the introduction of lazy objects.
The linked issue gives some more details.
In this PR, I tweak these assumptions in order to make less of them.
Note that there is no bullet-proof way to decide if a *virtual* property exists in PHP. We're missing an `__exists()` magic method for that. Because of this, I'm submitting this PR to 6.4 and not 5.4. Let 5.4 end its life quietly and ensure 6.4 works at its best with lazy ghosts, where they're mainstream.
Commits
-------
9610a7c [PropertyAccess] Fix checking for missing propertiesFile tree
4 files changed
+29
-9
lines changed- src/Symfony/Component
- PropertyAccess
- Tests
- Fixtures
- PropertyInfo/Extractor
4 files changed
+29
-9
lines changedLines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
416 | 426 | | |
417 | 427 | | |
418 | 428 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| 993 | + | |
| 994 | + | |
993 | 995 | | |
994 | 996 | | |
995 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
996 | 1003 | | |
997 | 1004 | | |
998 | | - | |
| 1005 | + | |
999 | 1006 | | |
1000 | 1007 | | |
1001 | 1008 | | |
| |||
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | | - | |
| 277 | + | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 281 | + | |
| 282 | + | |
285 | 283 | | |
286 | 284 | | |
287 | 285 | | |
| |||
0 commit comments