Skip to content

Commit ae54993

Browse files
authored
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.
1 parent e2fbb83 commit ae54993

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Intl/Icu/IntlDateFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public static function create(?string $locale, ?int $dateType, ?int $timeType, $
203203
*
204204
* @param int|string|\DateTimeInterface $datetime The timestamp to format
205205
*
206-
* @return string|bool The formatted value or false if formatting failed
206+
* @return string|false The formatted value or false if formatting failed
207207
*
208208
* @see https://php.net/intldateformatter.format
209209
*

0 commit comments

Comments
 (0)