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

Skip to content

Commit c299069

Browse files
committed
bug #46730 [Intl] Fix the IntlDateFormatter::formatObject signature (damienalexandre)
This PR was merged into the 4.4 branch. Discussion ---------- [Intl] Fix the IntlDateFormatter::formatObject signature | 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. Commits ------- 22cd9cb [Intl] Fix the IntlDateFormatter::formatObject signature
2 parents d2aaf51 + 22cd9cb commit c299069

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public function format($timestamp)
243243
*
244244
* @throws MethodNotImplementedException
245245
*/
246-
public function formatObject($object, $format = null, $locale = null)
246+
public static function formatObject($object, $format = null, $locale = null)
247247
{
248248
throw new MethodNotImplementedException(__METHOD__);
249249
}

0 commit comments

Comments
 (0)