Skip to content

[VarExporter] Improve partial-initialization API for ghost objects #48312

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Nov 24, 2022

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Discussed with @alcaeus at SymfonyCon, this improves support for partial-initialization of lazy ghost objects.

  • isLazyObjectInitialized(bool $partial = false): bool allows checking if an object is partially-initialized.
  • a partial initializer set to the special "\0" key can be used to initialize all/many properties at once.

Targeting 6.2 because this would be a BC break in 6.3, also because this improves a new unreleased feature.

Copy link
Contributor

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this against a small proof of concept I've been working on, and the object initialisation works as expected. Thanks @nicolas-grekas!

@fabpot
Copy link
Member

fabpot commented Nov 25, 2022

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 894adcb into symfony:6.2 Nov 25, 2022
@nicolas-grekas nicolas-grekas deleted the lazy-partial branch November 25, 2022 08:15
@fabpot fabpot mentioned this pull request Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants