Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] 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

Merged
merged 1 commit into from
Jun 15, 2025

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.

@carsonbot carsonbot changed the title improve phpdoc for normalizer [Serializer] improve phpdoc for normalizer Jun 15, 2025
@nicolas-grekas nicolas-grekas force-pushed the improve-normalizer-phpdoc branch from 0e1c487 to e26ff94 Compare June 15, 2025 17:15
@nicolas-grekas
Copy link
Member

Thank you @garak.

@nicolas-grekas nicolas-grekas merged commit 6eecdca into symfony:7.4 Jun 15, 2025
11 checks passed
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