Skip to content

Commit

Permalink
minor #430 Update return type for IntlDateFormatter::format() (mbab…
Browse files Browse the repository at this point in the history
…ker)

This PR was merged into the 1.28-dev branch.

Discussion
----------

Update return type for `IntlDateFormatter::format()`

Since PHP 8.0.0, the method is documented as having a `string|false` return (see https://github.com/php/php-src/blob/php-8.0.0/ext/intl/dateformat/dateformat.stub.php#L99-L104), this updates the polyfill to match the native signature which can help avoid static analysis issues where the polyfill has a wider return type than the native implementation.

Commits
-------

ae54993 Update return type for `IntlDateFormatter::format()`
  • Loading branch information
derrabus committed Mar 27, 2023
2 parents e2fbb83 + ae54993 commit 05dfdff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Intl/Icu/IntlDateFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public static function create(?string $locale, ?int $dateType, ?int $timeType, $
*
* @param int|string|\DateTimeInterface $datetime The timestamp to format
*
* @return string|bool The formatted value or false if formatting failed
* @return string|false The formatted value or false if formatting failed
*
* @see https://php.net/intldateformatter.format
*
Expand Down

0 comments on commit 05dfdff

Please sign in to comment.