From 7aea62643bfd45a1dbf8eba978a8e726dd23ddd4 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 28 Sep 2025 00:57:32 +0200 Subject: [PATCH] URI: Mark params and fields as nullable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The class allows each of them to be `null` and checks for that internally. Let’s make the param and property types reflect that so that consumers are not given false positives by static analysis. --- library/HTMLPurifier/URI.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/library/HTMLPurifier/URI.php b/library/HTMLPurifier/URI.php index 9e9d2da2..da768b44 100644 --- a/library/HTMLPurifier/URI.php +++ b/library/HTMLPurifier/URI.php @@ -11,48 +11,48 @@ class HTMLPurifier_URI { /** - * @type string + * @type ?string */ public $scheme; /** - * @type string + * @type ?string */ public $userinfo; /** - * @type string + * @type ?string */ public $host; /** - * @type int + * @type ?int */ public $port; /** - * @type string + * @type ?string */ public $path; /** - * @type string + * @type ?string */ public $query; /** - * @type string + * @type ?string */ public $fragment; /** - * @param string $scheme - * @param string $userinfo - * @param string $host - * @param int $port - * @param string $path - * @param string $query - * @param string $fragment + * @param ?string $scheme + * @param ?string $userinfo + * @param ?string $host + * @param ?int $port + * @param ?string $path + * @param ?string $query + * @param ?string $fragment * @note Automatically normalizes scheme and port */ public function __construct($scheme, $userinfo, $host, $port, $path, $query, $fragment)