From d625c29df7b4bdb1abe2aa0bc987aecfd534fd54 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 17 Jul 2020 16:11:30 +0200 Subject: [PATCH] Remove spurious return true from DOMXPath::registerPhpFunctions() Only one of three identical cases returned true, and the function is documented to return void. Remove the outlier. --- ext/dom/php_dom.stub.php | 2 +- ext/dom/php_dom_arginfo.h | 2 +- ext/dom/xpath.c | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index f84282542d..42628c39a2 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -425,7 +425,7 @@ class DOMXPath /** @return bool */ public function registerNamespace(string $prefix, string $namespaceURI) {} - /** @return bool|null */ + /** @return void */ public function registerPhpFunctions(string|array|null $restrict = null) {} } #endif diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 5724b98b79..c45b319f1c 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a9c30985948768261ea275fdbde598cf9119029e */ + * Stub hash: a30205758df3a00757ffdfdd0c500b090e022d4f */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 1) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0) diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index e45ca84d8c..c96f104229 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -510,7 +510,6 @@ PHP_METHOD(DOMXPath, registerPhpFunctions) zend_string_release_ex(str, 0); } ZEND_HASH_FOREACH_END(); intern->registerPhpFunctions = 2; - RETURN_TRUE; } else if (name) { ZVAL_LONG(&new_string, 1); zend_hash_update(intern->registered_phpfunctions, name, &new_string); -- 2.40.0