@@ -263,7 +263,7 @@ public function calendar($format, $local = false, $translate = true) {
263263 * @return string The date string in the specified format format.
264264 *
265265 */
266- public function format ($ format , $ local = false , $ translate = true , $ language = null ) {
266+ public function format ($ format , $ local = false , $ translate = true , $ language = null ): string {
267267 if ($ translate ) {
268268 // Do string replacements for date format options that can be translated.
269269 $ format = preg_replace ('/(^|[^ \\\])D/ ' , "\\1 " . self ::DAY_ABBR , $ format );
@@ -366,7 +366,7 @@ public function monthToString($month, $abbr = false, $language = null) {
366366 *
367367 * @note This method can't be type hinted due to a PHP bug: https://bugs.php.net/bug.php?id=61483
368368 */
369- public function setTimezone ($ tz ) {
369+ public function setTimezone ($ tz ): \ DateTime {
370370 $ this ->tz = $ tz ;
371371
372372 return parent ::setTimezone ($ tz );
@@ -415,7 +415,7 @@ public function toUnix() {
415415 }
416416
417417 /** create a local instance from given format */
418- public static function createFromFormat ($ format , $ timeString , $ timezone = null ) {
418+ public static function createFromFormat ($ format , $ timeString , $ timezone = null ): \ DateTime | false {
419419 if ($ timezone == null ) {
420420 $ timezone = new \DateTimeZone (date_default_timezone_get ());
421421 }
0 commit comments