Skip to content

improve phpdoc for normalizer #60769

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

Open
wants to merge 2 commits into
base: 7.4
Choose a base branch
from

Conversation

garak
Copy link
Contributor

@garak garak commented Jun 12, 2025

Q A
Branch? 7.4
Bug fix? kind of
New feature? no
Deprecations? no
Issues none
License MIT

The problem with the old phpdoc is that phpstan complains about the user's concrete implementation ("no value type specified in iterable type array")
Moreover, if the user adds the proper phpdoc in their concrete implementation, phpstan still complains about the concrete method not being contravariant (using strict rules)

After a Slack discussion with @stof we agreed that this small improvement could be useful, and avoid being forced to install phpstan-symfony to get the proper annotation.

@garak garak requested a review from dunglas as a code owner June 12, 2025 07:45
@carsonbot carsonbot added this to the 7.4 milestone Jun 12, 2025
@stof
Copy link
Member

stof commented Jun 12, 2025

Can you also apply the improvement in DenormalizerInterface please ? SerializerInterface already has the precise type.

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.

3 participants