From 5d9f0785bd256533037120489d9f769c67f40ee2 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 06:37:31 +0000 Subject: [PATCH] Refactor for PHP 8.4 compatibility: Add explicit nullable type declarations - Fix implicitly nullable parameters in PhpSIP constructor - Add nullable type hints to setContentType() and setCallId() methods - Addresses PHP 8.4 deprecation of implicitly nullable parameters - All syntax validated with PHP 8.4.10 - Preserves existing functionality and API compatibility Co-Authored-By: devin@siptools.org --- PhpSIP.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PhpSIP.class.php b/PhpSIP.class.php index 804547d..32ad703 100644 --- a/PhpSIP.class.php +++ b/PhpSIP.class.php @@ -240,7 +240,7 @@ class PhpSIP * * @param $src_ip Ip address to bind (optional) */ - public function __construct($src_ip = null, $src_port = null, $fr_timer = null) + public function __construct(?string $src_ip = null, ?int $src_port = null, ?int $fr_timer = null) { if (!function_exists('socket_create')) { @@ -1328,7 +1328,7 @@ public function setBody($body) /** * Sets Content Type */ - public function setContentType($content_type = null) + public function setContentType(?string $content_type = null) { if ($content_type !== null) { @@ -1394,7 +1394,7 @@ public function setCseq($v) * * @param string $v */ - public function setCallId($v = null) + public function setCallId(?string $v = null) { if ($v) {