From 504f7ffdd656cca19576d54dfe94ecc800cc2a42 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 29 Oct 2019 11:15:08 +0100 Subject: [PATCH] Small ext/dom cleanups --- ext/dom/cdatasection.c | 2 +- ext/dom/comment.c | 2 +- ext/dom/document.c | 3 +-- ext/dom/documentfragment.c | 2 +- ext/dom/element.c | 8 ++++---- ext/dom/node.c | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index 6af743e4e3f..ed6df89cc2a 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -58,7 +58,7 @@ PHP_METHOD(domcdatasection, __construct) if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + return; } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/comment.c b/ext/dom/comment.c index c4b488888d1..d415e0139a4 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -58,7 +58,7 @@ PHP_METHOD(domcomment, __construct) if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + return; } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/document.c b/ext/dom/document.c index ede0311b5d3..8557f14cf3e 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1270,7 +1270,7 @@ PHP_METHOD(domdocument, __construct) if (!docp) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + return; } if (encoding_len > 0) { @@ -2258,7 +2258,6 @@ PHP_METHOD(domdocument, registerNodeClass) } zend_throw_error(NULL, "Class %s is not derived from %s.", ZSTR_VAL(ce->name), ZSTR_VAL(basece->name)); - RETURN_FALSE; } /* }}} */ diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index e84553db4dd..dab8dd71856 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -59,7 +59,7 @@ PHP_METHOD(domdocumentfragment, __construct) if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + return; } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/element.c b/ext/dom/element.c index b0b070e18a0..1db915c77f0 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -165,7 +165,7 @@ PHP_METHOD(domelement, __construct) name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { php_dom_throw_error(INVALID_CHARACTER_ERR, 1); - RETURN_FALSE; + return; } /* Namespace logic is separate and only when uri passed in to insure no BC breakage */ @@ -187,7 +187,7 @@ PHP_METHOD(domelement, __construct) xmlFreeNode(nodep); } php_dom_throw_error(errorcode, 1); - RETURN_FALSE; + return; } } else { /* If you don't pass a namespace uri, then you can't set a prefix */ @@ -196,14 +196,14 @@ PHP_METHOD(domelement, __construct) xmlFree(localname); xmlFree(prefix); php_dom_throw_error(NAMESPACE_ERR, 1); - RETURN_FALSE; + return; } nodep = xmlNewNode(NULL, (xmlChar *) name); } if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + return; } if (value_len > 0) { diff --git a/ext/dom/node.c b/ext/dom/node.c index 2e745314677..ab2151f290f 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1820,7 +1820,7 @@ PHP_METHOD(domnode, C14NFile) } /* }}} */ -/* {{{ proto int DOMNode::getNodePath() +/* {{{ proto string|null DOMNode::getNodePath() Gets an xpath for a node */ PHP_METHOD(domnode, getNodePath) {