Skip to content

[Serializer][Validator] Make internal properties private #61449

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
Aug 18, 2025

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Aug 18, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

With the new __serialize implementations, we can finally replace those @internal properties by private ones, without breaking either child classes still implementing __sleep nor payloads created before.

@carsonbot carsonbot added this to the 7.4 milestone Aug 18, 2025
@carsonbot carsonbot changed the title [Validator][Serializer] Make internal properties private [Serializer][Validator] Make internal properties private Aug 18, 2025
if ($constraint->traverse) {
$this->traversalStrategy = TraversalStrategy::IMPLICIT;
} else {
$this->traversalStrategy = TraversalStrategy::NONE;
Copy link
Member Author

@nicolas-grekas nicolas-grekas Aug 18, 2025

Choose a reason for hiding this comment

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

$cascadingStrategy and $cascadingStrategy are now private properties, so we have to duplicate them in this child class, and copy/paste the code that updates them (this case for the Valid constraint is the only one)

@nicolas-grekas nicolas-grekas force-pushed the pub-int-priv branch 3 times, most recently from 2ca3446 to 9798863 Compare August 18, 2025 09:59
@nicolas-grekas nicolas-grekas force-pushed the pub-int-priv branch 2 times, most recently from 72d2b18 to 18ade30 Compare August 18, 2025 13:15
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

Nice 👍🏻

@nicolas-grekas nicolas-grekas merged commit feee7b7 into symfony:7.4 Aug 18, 2025
3 of 12 checks passed
@nicolas-grekas nicolas-grekas deleted the pub-int-priv branch August 18, 2025 14:00
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