protected static function getGenderDigit(\DateTime $dateOfBirth, $gender, $isResident)
{
if (!$isResident) {
return 9;
}
if ($dateOfBirth->format('Y') < 1900) {
if ($gender == Person::GENDER_MALE) {
return 3;
}
return 4;
}
if ($dateOfBirth->format('Y') < 2000) {
if ($gender == Person::GENDER_MALE) {
return 1;
}
return 2;
}
if ($gender == Person::GENDER_MALE) {
return 5;
}
return 6;
}