<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* @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;
$interval = $birthdate->diff($currentDate);
- return $interval->format('%y');
+ return (int) $interval->format('%y');
}
/**