Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[VarExporter] Fix lazy objects with hooked properties#59761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:6.4fromnicolas-grekas:ve-hooks
Feb 13, 2025

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedFeb 12, 2025
edited
Loading

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#59153
LicenseMIT

With hook proxies when needed so that lazy objects are fully compatible with non-final hooks.

@carsonbotcarsonbot added this to the6.4 milestoneFeb 12, 2025
@nicolas-grekasnicolas-grekas changed the title[VarExporter] Fix ignoring hooked properties[VarExporter] Fix lazy objects with hooked propertiesFeb 13, 2025
@nicolas-grekasnicolas-grekas merged commit88649d9 intosymfony:6.4Feb 13, 2025
2 of 10 checks passed
@stof
Copy link
Member

stof commentedFeb 13, 2025
edited
Loading

I think this should have more tests to cover more cases:

  • virtual properties with only a get hook
  • virtual properties with both a get and a set hook (this is currently covered)
  • backed properties with a get hook and no set hook (i.e. writing directly to the backing storage)
  • backed properties with a set hook and no get hook (i.e. reading directly from the backing storage)
  • backed properties with both hooks (this is currently covered)

@nicolas-grekasnicolas-grekas deleted the ve-hooks branchFebruary 13, 2025 11:38
@nicolas-grekas
Copy link
MemberAuthor

That'd be nice indeed, help wanted!

@rixafy
Copy link

@nicolas-grekas was this somewhere reverted? I see $hookedProperties but it's not used later in codehttps://github.com/symfony/symfony/blame/7.3/src/Symfony/Component/VarExporter/Internal/LazyObjectRegistry.php#L69

The part with foreach remained unchanged, unlike in this commit, and I can't figure out why. I'm gettingCannot unset private(set) property.. error in doctrine hydrator that leads to that part of code, where unset is being executed.

@rixafy
Copy link

I see that in 6.4 the commit is OK and$hookedProperties are used, but I'm getting error here

(Cannot modify private(set) property), which I don't know if it's var-exporter problem or doctrine orm problem, because I know that doctrine is not yet ready for hooked properties, so I solved it with protected(set) for now (because it's called from doctrine proxy object that extends mine).

@nicolas-grekas
Copy link
MemberAuthor

Please open a new issue if you want this to be tracked.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

4 participants
@nicolas-grekas@stof@rixafy@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp