Type error libphonenumber\PhoneNumberUtil::format()

libphonenumber\PhoneNumberUtil::format(): Argument #2 ($numberFormat) must be of type libphonenumber\PhoneNumberFormat, int given, called in C:\xampp\htdocs\src\phpfn.php on line 3599

The call:

$this->EmployeeMobilePhone->ViewValue = FormatPhoneNumber("$EmployeeMobilePhone", "US", 2);

function FormatPhoneNumber(#[\SensitiveParameter] string $phoneNumber, mixed $region = null, int $format = PhoneNumberFormat::E164)
{
    global $httpContext;
    $region ??= Config("SMS_REGION_CODE");
    if ($region === false) { // Skip formatting
        return $phoneNumber;
    }
    if ($region === null) { // Get region from locale
        $ar = explode("-", str_replace("_", "-", $httpContext["CurrentLanguage"]));
        $region = count($ar) >= 2 ? $ar[1] : "US";
    }
    try {
        $phoneNumberUtil = PhoneNumberUtil::getInstance();
        $phoneNumberObj = $phoneNumberUtil->parse($phoneNumber, $region);
        return $phoneNumberUtil->format($phoneNumberObj, $format); // <- ***
}

not sure what the issue is...

JS

Try update to the latest template and generate again.