mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/tidy: simplify tidy_instantiate (#18647)
This commit is contained in:
@@ -124,7 +124,6 @@ static zend_string *php_tidy_file_to_mem(const char *, bool);
|
||||
static void tidy_object_free_storage(zend_object *);
|
||||
static zend_object *tidy_object_new_node(zend_class_entry *);
|
||||
static zend_object *tidy_object_new_doc(zend_class_entry *);
|
||||
static zval *tidy_instantiate(zend_class_entry *, zval *);
|
||||
static zend_result tidy_doc_cast_handler(zend_object *, zval *, int);
|
||||
static zend_result tidy_node_cast_handler(zend_object *, zval *, int);
|
||||
static void tidy_doc_update_properties(PHPTidyObj *);
|
||||
@@ -273,7 +272,7 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, const char *optname, zval *value)
|
||||
|
||||
static void tidy_create_node_object(zval *zv, PHPTidyDoc *ptdoc, TidyNode node)
|
||||
{
|
||||
tidy_instantiate(tidy_ce_node, zv);
|
||||
object_init_ex(zv, tidy_ce_node);
|
||||
PHPTidyObj *newobj = Z_TIDY_P(zv);
|
||||
newobj->node = node;
|
||||
newobj->type = is_node;
|
||||
@@ -469,12 +468,6 @@ static zend_object *tidy_object_new_doc(zend_class_entry *class_type)
|
||||
return tidy_object_new(class_type, &tidy_object_handlers_doc, is_doc);
|
||||
}
|
||||
|
||||
static zval *tidy_instantiate(zend_class_entry *pce, zval *object)
|
||||
{
|
||||
object_init_ex(object, pce);
|
||||
return object;
|
||||
}
|
||||
|
||||
static zend_result tidy_doc_cast_handler(zend_object *in, zval *out, int type)
|
||||
{
|
||||
TidyBuffer output;
|
||||
@@ -1018,7 +1011,7 @@ PHP_FUNCTION(tidy_parse_string)
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
tidy_instantiate(tidy_ce_doc, return_value);
|
||||
object_init_ex(return_value, tidy_ce_doc);
|
||||
obj = Z_TIDY_P(return_value);
|
||||
|
||||
if (php_tidy_apply_config(obj->ptdoc->doc, options_str, options_ht) != SUCCESS
|
||||
@@ -1086,7 +1079,7 @@ PHP_FUNCTION(tidy_parse_file)
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
tidy_instantiate(tidy_ce_doc, return_value);
|
||||
object_init_ex(return_value, tidy_ce_doc);
|
||||
obj = Z_TIDY_P(return_value);
|
||||
|
||||
if (php_tidy_apply_config(obj->ptdoc->doc, options_str, options_ht) != SUCCESS
|
||||
|
||||
Reference in New Issue
Block a user