Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[VarExporter] Usearray<property-name,Closure> for partial initialization of lazy ghost objects#48209
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…tion of lazy ghost objects
66cecba toefd6966Compare| publicint$status =0; | ||
| publicfunction__construct(public\Closure$initializer,$skippedProperties = []) | ||
| publicfunction__construct(publicreadonly\Closure|array$initializer,$skippedProperties = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the structure of the array should be documented in phpdoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is an internal API, the phpdoc is on the public one.
Uh oh!
There was an error while loading.Please reload this page.
Lazy ghost objects can be either fully-initialized or partially-initialized: either the lazy-properties are all initialized at once, or they're initialized one-by-one.
In the one-by-one way, the initializer is still one closure for all properties that accepts the property to initialize as argument.
While preparing my talk for SymfonyCon, I realized that it would be better to pass an array of closures instead, keyed by the properties to lazy-initialize.