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

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@mtarld
Copy link
Contributor

@mtarldmtarld commentedOct 14, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
Issues
LicenseMIT

This PR adds the support forvirtual synthetic 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

@soyuka
Copy link
Contributor

Really great improvement, this is quite painful for now in API Platform as we useid everywhere and sometimes the property doesn't exist.

@mtarldmtarldforce-pushed thefeat/json-streamer-virtual-property branch from27c57e0 to2b9f9d1CompareOctober 17, 2025 13:06
@chalasr
Copy link
Member

Fromhttps://www.php.net/manual/en/language.oop5.property-hooks.php

A property may be "backed" or "virtual". [...] A virtual property is one that has hooks and those hooks do not interact with the property itself. In this case, the hooks are effectively the same as methods, and the object does not use any space to store a value for that property.

Should we find another name?

@stof
Copy link
Member

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.
I don't have an idea for a good alternate name though.

@GromNaN
Copy link
Member

GromNaN commentedOct 17, 2025
edited
Loading

"synthetic" means that it is created from nothing, or from transforming other things.

chalasr and mtarld reacted with thumbs up emoji

@chalasr
Copy link
Member

I like it.

@mtarldmtarldforce-pushed thefeat/json-streamer-virtual-property branch from2b9f9d1 tobb12653CompareOctober 18, 2025 09:35
@mtarldmtarld changed the title[JsonStreamer] Add virtual properties support[JsonStreamer] Add synthetic properties supportOct 18, 2025
@mtarld
Copy link
ContributorAuthor

Updated with the synthetic name instead. It's a nice name, I like it as well, thanks for the review.

@GromNaN
Copy link
Member

Thank you@mtarld.

@GromNaNGromNaN merged commit742d742 intosymfony:7.4Oct 22, 2025
12 checks passed
@mtarldmtarld deleted the feat/json-streamer-virtual-property branchOctober 22, 2025 09:15
This was referencedOct 27, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@GromNaNGromNaNGromNaN approved these changes

@alexandre-dauboisalexandre-dauboisalexandre-daubois approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@soyukasoyukasoyuka approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

7 participants

@mtarld@soyuka@chalasr@stof@GromNaN@alexandre-daubois@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp