Skip to content
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

[Intl] Fix the IntlDateFormatter::formatObject signature #46730

Merged
merged 1 commit into from Jun 22, 2022

Conversation

damienalexandre
Copy link
Contributor

@damienalexandre damienalexandre commented Jun 21, 2022

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets None
License MIT
Doc PR 🕳️

I was calling IntlDateFormatter::formatObject in my user-land code and got this error from PHPStan:

Static call to instance method Symfony\Component\Intl\DateFormatter\IntlDateFormatter::formatObject().  

The Intl component formatObject method signature is indeed non-static, but the PHP Intl signature is.

Reference: https://www.php.net/manual/en/intldateformatter.formatobject.php

So I think the component should respect PHP method signature.

@stof
Copy link
Member

@stof stof commented Jun 21, 2022

The same PR should be submitted to https://github.com/symfony/polyfill which is the new location of that code for Symfony 5+

stof
stof approved these changes Jun 21, 2022
fabpot
fabpot approved these changes Jun 22, 2022
@fabpot
Copy link
Member

@fabpot fabpot commented Jun 22, 2022

Thank you @damienalexandre.

@fabpot fabpot merged commit c299069 into symfony:4.4 Jun 22, 2022
9 checks passed
@fabpot fabpot mentioned this pull request Jun 26, 2022
@fabpot fabpot mentioned this pull request Jun 26, 2022
@fabpot fabpot mentioned this pull request Jun 26, 2022
@fabpot fabpot mentioned this pull request Jun 26, 2022
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.

None yet

6 participants