]> git.mxchange.org Git - friendica.git/commitdiff
Set correct integer return type for Temporal::getAgeByTimezone
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 31 Jan 2021 03:47:20 +0000 (22:47 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 31 Jan 2021 13:36:56 +0000 (08:36 -0500)
src/Util/Temporal.php

index c4a04d586cb266cd32d647617fe99056bdd420f6..7902a944779ab2464629db1158c90c12233ac0b4 100644 (file)
@@ -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');
        }
 
        /**