Skip to content

[TypeInfo] Fix @var tag reading for promoted properties #59963

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
Mar 13, 2025

Conversation

mtarld
Copy link
Contributor

@mtarld mtarld commented Mar 12, 2025

Q A
Branch? 7.2
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #59959
License MIT

Read either @param and @var tags for promoted properties.

@mtarld mtarld force-pushed the fix/var-promoted-property branch from 6275905 to 3291bf3 Compare March 12, 2025 15:42
@mtarld mtarld requested a review from jack-worman March 12, 2025 15:42
Copy link
Member

@alexandre-daubois alexandre-daubois left a comment

Choose a reason for hiding this comment

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

You also seem to do something with @return, does this also need an additional test?

@mtarld
Copy link
Contributor Author

mtarld commented Mar 13, 2025

@alexandre-daubois, the @return is already implemented and tested. There is a bit of refactoring but nothing has really changed.

@chalasr
Copy link
Member

chalasr commented Mar 13, 2025

Is there any reference about using @var for constructor property promotion?
Mixing both @var and @param looks horrific to me. I'd think this is one of the use cases where one hits the limits of promoted properties and should just separate the property declaration from the constructor parameter. Am I wrong?

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Is there any reference about using @var for constructor property promotion?

@var is well supported for (promoted or not) arguments - we're even going to use it in #58771 as it provides better locality.

Mixing both @var and @param looks horrific to me.

It is, and should be avoided :)

@nicolas-grekas
Copy link
Member

Thank you @mtarld.

@nicolas-grekas nicolas-grekas merged commit 9f7257e into symfony:7.2 Mar 13, 2025
11 checks passed
@mtarld mtarld deleted the fix/var-promoted-property branch March 13, 2025 12:51
@fabpot fabpot mentioned this pull request Mar 28, 2025
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.

6 participants