protected function formatPhoneTenDigitMask(string $phone, string $format): string
    {
        /* mask: (###) ###-####, ###-###-#### */
        return (1 === substr_count($format, '(###)'))
            ? preg_replace('/([0-9]{3})([0-9]{3})([0-9]{4})/', '($1) $2-$3', $phone)
            : preg_replace('/([0-9]{3})([0-9]{3})([0-9]{4})/', '$1-$2-$3', $phone);
    }