diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h index ce2edaebc4bab..d6e0ae3d2297c 100644 --- a/ext/dom/dom_properties.h +++ b/ext/dom/dom_properties.h @@ -90,9 +90,9 @@ zend_result dom_entity_encoding_read(dom_object *obj, zval *retval); zend_result dom_entity_version_read(dom_object *obj, zval *retval); /* entity reference properties */ -int dom_entity_reference_child_read(dom_object *obj, zval *retval); -int dom_entity_reference_text_content_read(dom_object *obj, zval *retval); -int dom_entity_reference_child_nodes_read(dom_object *obj, zval *retval); +zend_result dom_entity_reference_child_read(dom_object *obj, zval *retval); +zend_result dom_entity_reference_text_content_read(dom_object *obj, zval *retval); +zend_result dom_entity_reference_child_nodes_read(dom_object *obj, zval *retval); /* namednodemap properties */ zend_result dom_namednodemap_length_read(dom_object *obj, zval *retval); diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index 9935594453a79..c0b640d39aa60 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -80,14 +80,9 @@ xmlEntityPtr dom_entity_reference_fetch_and_sync_declaration(xmlNodePtr referenc return entity; } -int dom_entity_reference_child_read(dom_object *obj, zval *retval) +zend_result dom_entity_reference_child_read(dom_object *obj, zval *retval) { - xmlNodePtr nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, true); - return FAILURE; - } + DOM_PROP_NODE(xmlNodePtr, nodep, obj); xmlEntityPtr entity = dom_entity_reference_fetch_and_sync_declaration(nodep); if (entity == NULL) { @@ -99,27 +94,17 @@ int dom_entity_reference_child_read(dom_object *obj, zval *retval) return SUCCESS; } -int dom_entity_reference_text_content_read(dom_object *obj, zval *retval) +zend_result dom_entity_reference_text_content_read(dom_object *obj, zval *retval) { - xmlNodePtr nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, true); - return FAILURE; - } + DOM_PROP_NODE(xmlNodePtr, nodep, obj); dom_entity_reference_fetch_and_sync_declaration(nodep); return dom_node_text_content_read(obj, retval); } -int dom_entity_reference_child_nodes_read(dom_object *obj, zval *retval) +zend_result dom_entity_reference_child_nodes_read(dom_object *obj, zval *retval) { - xmlNodePtr nodep = dom_object_get_node(obj); - - if (nodep == NULL) { - php_dom_throw_error(INVALID_STATE_ERR, true); - return FAILURE; - } + DOM_PROP_NODE(xmlNodePtr, nodep, obj); dom_entity_reference_fetch_and_sync_declaration(nodep); return dom_node_child_nodes_read(obj, retval);