-
-
Couldn't load subscription status.
- Fork 9.7k
[JsonStreamer] Add synthetic properties support #62069
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
[JsonStreamer] Add synthetic properties support #62069
Conversation
|
Really great improvement, this is quite painful for now in API Platform as we use |
src/Symfony/Component/JsonStreamer/Write/StreamWriterGenerator.php
Outdated
Show resolved
Hide resolved
27c57e0 to
2b9f9d1
Compare
|
From https://www.php.net/manual/en/language.oop5.property-hooks.php
Should we find another name? |
|
The reason for the name is actually similar to the reason in property hooks (a JsonStreamer property that is either backed by a PHP property or not). But it might indeed cause confusion, especially when the 2 different layers are closely tied to each other. |
|
"synthetic" means that it is created from nothing, or from transforming other things. |
|
I like it. |
2b9f9d1 to
bb12653
Compare
|
Updated with the synthetic name instead. It's a nice name, I like it as well, thanks for the review. |
|
Thank you @mtarld. |
This PR adds the support for
virtualsynthetic properties, which are basically values that are computed thanks to property metadata loaders only.This could be useful for projects that are generating highly dynamic object shape, such as API Platform.
/cc @soyuka