Skip to content

Conversation

@damienalexandre
Copy link
Contributor

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 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+

@fabpot
Copy link
Member

fabpot commented Jun 22, 2022

Thank you @damienalexandre.

@fabpot fabpot merged commit c299069 into symfony:4.4 Jun 22, 2022
stof added a commit to symfony/polyfill that referenced this pull request Sep 27, 2022
…mienalexandre)

This PR was merged into the 1.26-dev branch.

Discussion
----------

[Intl] Fix the IntlDateFormatter::formatObject signature

Following bug fix on Symfony Intl component, see symfony/symfony#46730 for the full description.

Commits
-------

6a35083 [Intl] Fix the IntlDateFormatter::formatObject signature
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