From d877c0e7125f56479590dc60197d5168a718370a Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 14 Nov 2025 13:21:26 -0700 Subject: [PATCH] Allow type to be null --- resources/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index 9ad26f2e48..2870e3f75e 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1020,7 +1020,7 @@ if (!function_exists('user_add')) { * * @return bool True if the module is running, false otherwise or if not connected to FreeSwitch. */ -function switch_module_is_running($mod, event_socket $esl = null): bool { +function switch_module_is_running($mod, ?event_socket $esl = null): bool { //if the object does not exist create it if ($esl === null) { $esl = event_socket::create(); @@ -1089,11 +1089,11 @@ function format_string(string $format, string $data): string { /** * Formats a given phone number based on user-defined formats stored in session. * - * @param string $phone_number The phone number to format. + * @param string|null $phone_number The phone number to format. * - * @return string The formatted phone number if the input matches any defined format, otherwise the original input. + * @return string|null The formatted phone number if the input matches any defined format, otherwise the original input. */ -function format_phone(string $phone_number): string { +function format_phone(?string $phone_number): ?string { if (is_numeric(trim($phone_number ?? '', ' +'))) { if (isset($_SESSION["format"]["phone"])) { $phone_number = trim($phone_number, ' +');