From 185adc61f032bc81b4804ec3ae80fc1709413af1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 30 Jan 2021 22:47:20 -0500 Subject: [PATCH] Set correct integer return type for Temporal::getAgeByTimezone --- src/Util/Temporal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index c4a04d586..7902a9447 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -366,7 +366,7 @@ class Temporal * @return int Age in years * @throws \Exception */ - public static function getAgeByTimezone($dob, $owner_tz = '') + public static function getAgeByTimezone($dob, $owner_tz = ''): int { if (!intval($dob)) { return 0; @@ -381,7 +381,7 @@ class Temporal $interval = $birthdate->diff($currentDate); - return $interval->format('%y'); + return (int) $interval->format('%y'); } /**