Skip to content

Navigation Menu

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

Appearance settings

Commit c299069

Browse filesBrowse 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
Copy full SHA for c299069

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.