Set correct integer return type for Temporal::getAgeByTimezone
This commit is contained in:
parent
36f302e6e6
commit
185adc61f0
|
@ -366,7 +366,7 @@ class Temporal
|
||||||
* @return int Age in years
|
* @return int Age in years
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function getAgeByTimezone($dob, $owner_tz = '')
|
public static function getAgeByTimezone($dob, $owner_tz = ''): int
|
||||||
{
|
{
|
||||||
if (!intval($dob)) {
|
if (!intval($dob)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -381,7 +381,7 @@ class Temporal
|
||||||
|
|
||||||
$interval = $birthdate->diff($currentDate);
|
$interval = $birthdate->diff($currentDate);
|
||||||
|
|
||||||
return $interval->format('%y');
|
return (int) $interval->format('%y');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue