mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Small ext/dom cleanups
This commit is contained in:
parent
312ecc69d5
commit
504f7ffdd6
6 changed files with 9 additions and 10 deletions
|
@ -58,7 +58,7 @@ PHP_METHOD(domcdatasection, __construct)
|
||||||
|
|
||||||
if (!nodep) {
|
if (!nodep) {
|
||||||
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
||||||
RETURN_FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
intern = Z_DOMOBJ_P(ZEND_THIS);
|
intern = Z_DOMOBJ_P(ZEND_THIS);
|
||||||
|
|
|
@ -58,7 +58,7 @@ PHP_METHOD(domcomment, __construct)
|
||||||
|
|
||||||
if (!nodep) {
|
if (!nodep) {
|
||||||
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
||||||
RETURN_FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
intern = Z_DOMOBJ_P(ZEND_THIS);
|
intern = Z_DOMOBJ_P(ZEND_THIS);
|
||||||
|
|
|
@ -1270,7 +1270,7 @@ PHP_METHOD(domdocument, __construct)
|
||||||
|
|
||||||
if (!docp) {
|
if (!docp) {
|
||||||
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
||||||
RETURN_FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (encoding_len > 0) {
|
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));
|
zend_throw_error(NULL, "Class %s is not derived from %s.", ZSTR_VAL(ce->name), ZSTR_VAL(basece->name));
|
||||||
RETURN_FALSE;
|
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ PHP_METHOD(domdocumentfragment, __construct)
|
||||||
|
|
||||||
if (!nodep) {
|
if (!nodep) {
|
||||||
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
||||||
RETURN_FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
intern = Z_DOMOBJ_P(ZEND_THIS);
|
intern = Z_DOMOBJ_P(ZEND_THIS);
|
||||||
|
|
|
@ -165,7 +165,7 @@ PHP_METHOD(domelement, __construct)
|
||||||
name_valid = xmlValidateName((xmlChar *) name, 0);
|
name_valid = xmlValidateName((xmlChar *) name, 0);
|
||||||
if (name_valid != 0) {
|
if (name_valid != 0) {
|
||||||
php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
|
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 */
|
/* 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);
|
xmlFreeNode(nodep);
|
||||||
}
|
}
|
||||||
php_dom_throw_error(errorcode, 1);
|
php_dom_throw_error(errorcode, 1);
|
||||||
RETURN_FALSE;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* If you don't pass a namespace uri, then you can't set a prefix */
|
/* 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(localname);
|
||||||
xmlFree(prefix);
|
xmlFree(prefix);
|
||||||
php_dom_throw_error(NAMESPACE_ERR, 1);
|
php_dom_throw_error(NAMESPACE_ERR, 1);
|
||||||
RETURN_FALSE;
|
return;
|
||||||
}
|
}
|
||||||
nodep = xmlNewNode(NULL, (xmlChar *) name);
|
nodep = xmlNewNode(NULL, (xmlChar *) name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nodep) {
|
if (!nodep) {
|
||||||
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
php_dom_throw_error(INVALID_STATE_ERR, 1);
|
||||||
RETURN_FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value_len > 0) {
|
if (value_len > 0) {
|
||||||
|
|
|
@ -1820,7 +1820,7 @@ PHP_METHOD(domnode, C14NFile)
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ proto int DOMNode::getNodePath()
|
/* {{{ proto string|null DOMNode::getNodePath()
|
||||||
Gets an xpath for a node */
|
Gets an xpath for a node */
|
||||||
PHP_METHOD(domnode, getNodePath)
|
PHP_METHOD(domnode, getNodePath)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue