From fe0452d6887a0fa76e2eaf80166e1ea205e7bb81 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 4 Dec 2019 16:29:08 +0100 Subject: [PATCH] Correct typehinting of maybeGet* (#240) getDefinition can return null, this wasn't properly hinted leaning to false error detections with static analyzers --- library/HTMLPurifier/Config.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/HTMLPurifier/Config.php b/library/HTMLPurifier/Config.php index f569d40c..4ecaa141 100644 --- a/library/HTMLPurifier/Config.php +++ b/library/HTMLPurifier/Config.php @@ -408,7 +408,7 @@ class HTMLPurifier_Config * maybeGetRawHTMLDefinition, which is more explicitly * named, instead. * - * @return HTMLPurifier_HTMLDefinition + * @return HTMLPurifier_HTMLDefinition|null */ public function getHTMLDefinition($raw = false, $optimized = false) { @@ -427,7 +427,7 @@ class HTMLPurifier_Config * maybeGetRawCSSDefinition, which is more explicitly * named, instead. * - * @return HTMLPurifier_CSSDefinition + * @return HTMLPurifier_CSSDefinition|null */ public function getCSSDefinition($raw = false, $optimized = false) { @@ -446,7 +446,7 @@ class HTMLPurifier_Config * maybeGetRawURIDefinition, which is more explicitly * named, instead. * - * @return HTMLPurifier_URIDefinition + * @return HTMLPurifier_URIDefinition|null */ public function getURIDefinition($raw = false, $optimized = false) { @@ -468,7 +468,7 @@ class HTMLPurifier_Config * maybe semantics is the "right thing to do." * * @throws HTMLPurifier_Exception - * @return HTMLPurifier_Definition + * @return HTMLPurifier_Definition|null */ public function getDefinition($type, $raw = false, $optimized = false) { @@ -647,7 +647,7 @@ class HTMLPurifier_Config } /** - * @return HTMLPurifier_HTMLDefinition + * @return HTMLPurifier_HTMLDefinition|null */ public function maybeGetRawHTMLDefinition() { @@ -655,7 +655,7 @@ class HTMLPurifier_Config } /** - * @return HTMLPurifier_CSSDefinition + * @return HTMLPurifier_CSSDefinition|null */ public function maybeGetRawCSSDefinition() { @@ -663,7 +663,7 @@ class HTMLPurifier_Config } /** - * @return HTMLPurifier_URIDefinition + * @return HTMLPurifier_URIDefinition|null */ public function maybeGetRawURIDefinition() {