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

Update DenormalizerInterface::denormalize #263

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
ondrejmirtes merged 1 commit into phpstan:master from VincentLanglet:patch-1
Mar 24, 2022

Conversation

Copy link
Contributor

@VincentLanglet VincentLanglet commented Mar 22, 2022

Hi @ondrejmirtes

The stub from phpstan-symfony is restricting the return type to object|array, but there is no restriction in the interface from Symfony ; cf https://github.com/symfony/Serializer/blob/6.1/Normalizer/DenormalizerInterface.php.

So I changed the return type to mixed like the one from Symfony.

Copy link
Member

Copy link
Contributor Author

For more context @lucassabreu, I have a friend returning other thing than object/array in this method, and everything working fine.
So since even the phpdoc from symfony is not restricting to object/array, I don't think we should here.

lucassabreu reacted with eyes emoji

Copy link
Contributor

@ondrejmirtes i think it makes sense to return mixed, Symfony kind of accepts scalar types, and there is no restriction by what I understand.

I think my logic at the time was that you didn't need a Denormalizer to convert mixed to scalars or resources, but I don't think it will make the stub less effective to allow mixed.

cc: @VincentLanglet

VincentLanglet reacted with thumbs up emoji

@ondrejmirtes ondrejmirtes merged commit 4bdffcf into phpstan:master Mar 24, 2022
Copy link
Member

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@lucassabreu lucassabreu lucassabreu approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /