Skip to content

Commit 4844318

Browse files
authored
Use zend_result as return for properties in ext/dom (php#12113)
1 parent 575263f commit 4844318

17 files changed

+188
-186
lines changed

UPGRADING.INTERNALS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ PHP 8.4 INTERNALS UPGRADE NOTES
2222
3. Module changes
2323
========================
2424

25+
a. ext/dom
26+
- dom_read_t and dom_write_t now expect the function to return zend_result
27+
instead of int.
28+
2529
========================
2630
4. OpCode changes
2731
========================

ext/dom/attr.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ readonly=yes
7474
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1112119403
7575
Since:
7676
*/
77-
int dom_attr_name_read(dom_object *obj, zval *retval)
77+
zend_result dom_attr_name_read(dom_object *obj, zval *retval)
7878
{
7979
xmlAttrPtr attrp;
8080

@@ -97,7 +97,7 @@ readonly=yes
9797
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-862529273
9898
Since:
9999
*/
100-
int dom_attr_specified_read(dom_object *obj, zval *retval)
100+
zend_result dom_attr_specified_read(dom_object *obj, zval *retval)
101101
{
102102
/* TODO */
103103
ZVAL_TRUE(retval);
@@ -111,7 +111,7 @@ readonly=no
111111
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-221662474
112112
Since:
113113
*/
114-
int dom_attr_value_read(dom_object *obj, zval *retval)
114+
zend_result dom_attr_value_read(dom_object *obj, zval *retval)
115115
{
116116
xmlAttrPtr attrp = (xmlAttrPtr) dom_object_get_node(obj);
117117
xmlChar *content;
@@ -133,7 +133,7 @@ int dom_attr_value_read(dom_object *obj, zval *retval)
133133

134134
}
135135

136-
int dom_attr_value_write(dom_object *obj, zval *newval)
136+
zend_result dom_attr_value_write(dom_object *obj, zval *newval)
137137
{
138138
xmlAttrPtr attrp = (xmlAttrPtr) dom_object_get_node(obj);
139139

@@ -159,7 +159,7 @@ readonly=yes
159159
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-ownerElement
160160
Since: DOM Level 2
161161
*/
162-
int dom_attr_owner_element_read(dom_object *obj, zval *retval)
162+
zend_result dom_attr_owner_element_read(dom_object *obj, zval *retval)
163163
{
164164
xmlNodePtr nodep, nodeparent;
165165

@@ -188,7 +188,7 @@ readonly=yes
188188
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-schemaTypeInfo
189189
Since: DOM Level 3
190190
*/
191-
int dom_attr_schema_type_info_read(dom_object *obj, zval *retval)
191+
zend_result dom_attr_schema_type_info_read(dom_object *obj, zval *retval)
192192
{
193193
/* TODO */
194194
ZVAL_NULL(retval);

ext/dom/characterdata.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ readonly=no
3535
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-72AB8359
3636
Since:
3737
*/
38-
int dom_characterdata_data_read(dom_object *obj, zval *retval)
38+
zend_result dom_characterdata_data_read(dom_object *obj, zval *retval)
3939
{
4040
xmlNodePtr nodep = dom_object_get_node(obj);
4141

@@ -49,7 +49,7 @@ int dom_characterdata_data_read(dom_object *obj, zval *retval)
4949
return SUCCESS;
5050
}
5151

52-
int dom_characterdata_data_write(dom_object *obj, zval *newval)
52+
zend_result dom_characterdata_data_write(dom_object *obj, zval *newval)
5353
{
5454
xmlNode *nodep = dom_object_get_node(obj);
5555

@@ -74,7 +74,7 @@ readonly=yes
7474
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7D61178C
7575
Since:
7676
*/
77-
int dom_characterdata_length_read(dom_object *obj, zval *retval)
77+
zend_result dom_characterdata_length_read(dom_object *obj, zval *retval)
7878
{
7979
xmlNodePtr nodep = dom_object_get_node(obj);
8080
long length = 0;

ext/dom/document.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ readonly=yes
5050
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
5151
Since:
5252
*/
53-
int dom_document_doctype_read(dom_object *obj, zval *retval)
53+
zend_result dom_document_doctype_read(dom_object *obj, zval *retval)
5454
{
5555
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
5656
xmlDtdPtr dtdptr;
@@ -77,7 +77,7 @@ readonly=yes
7777
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
7878
Since:
7979
*/
80-
int dom_document_implementation_read(dom_object *obj, zval *retval)
80+
zend_result dom_document_implementation_read(dom_object *obj, zval *retval)
8181
{
8282
php_dom_create_implementation(retval);
8383
return SUCCESS;
@@ -90,7 +90,7 @@ readonly=yes
9090
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
9191
Since:
9292
*/
93-
int dom_document_document_element_read(dom_object *obj, zval *retval)
93+
zend_result dom_document_document_element_read(dom_object *obj, zval *retval)
9494
{
9595
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
9696
xmlNode *root;
@@ -116,7 +116,7 @@ int dom_document_document_element_read(dom_object *obj, zval *retval)
116116
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-encoding
117117
Since: DOM Level 3
118118
*/
119-
int dom_document_encoding_read(dom_object *obj, zval *retval)
119+
zend_result dom_document_encoding_read(dom_object *obj, zval *retval)
120120
{
121121
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
122122
char *encoding;
@@ -182,7 +182,7 @@ readonly=no
182182
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
183183
Since: DOM Level 3
184184
*/
185-
int dom_document_standalone_read(dom_object *obj, zval *retval)
185+
zend_result dom_document_standalone_read(dom_object *obj, zval *retval)
186186
{
187187
xmlDoc *docp;
188188

@@ -197,7 +197,7 @@ int dom_document_standalone_read(dom_object *obj, zval *retval)
197197
return SUCCESS;
198198
}
199199

200-
int dom_document_standalone_write(dom_object *obj, zval *newval)
200+
zend_result dom_document_standalone_write(dom_object *obj, zval *newval)
201201
{
202202
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
203203
zend_long standalone;
@@ -220,7 +220,7 @@ readonly=no
220220
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
221221
Since: DOM Level 3
222222
*/
223-
int dom_document_version_read(dom_object *obj, zval *retval)
223+
zend_result dom_document_version_read(dom_object *obj, zval *retval)
224224
{
225225
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
226226
char *version;
@@ -241,7 +241,7 @@ int dom_document_version_read(dom_object *obj, zval *retval)
241241
return SUCCESS;
242242
}
243243

244-
int dom_document_version_write(dom_object *obj, zval *newval)
244+
zend_result dom_document_version_write(dom_object *obj, zval *newval)
245245
{
246246
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
247247
zend_string *str;
@@ -273,14 +273,14 @@ readonly=no
273273
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
274274
Since: DOM Level 3
275275
*/
276-
int dom_document_strict_error_checking_read(dom_object *obj, zval *retval)
276+
zend_result dom_document_strict_error_checking_read(dom_object *obj, zval *retval)
277277
{
278278
libxml_doc_props const* doc_prop = dom_get_doc_props_read_only(obj->document);
279279
ZVAL_BOOL(retval, doc_prop->stricterror);
280280
return SUCCESS;
281281
}
282282

283-
int dom_document_strict_error_checking_write(dom_object *obj, zval *newval)
283+
zend_result dom_document_strict_error_checking_write(dom_object *obj, zval *newval)
284284
{
285285
if (obj->document) {
286286
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -295,14 +295,14 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval)
295295
/* {{{ formatOutput boolean
296296
readonly=no
297297
*/
298-
int dom_document_format_output_read(dom_object *obj, zval *retval)
298+
zend_result dom_document_format_output_read(dom_object *obj, zval *retval)
299299
{
300300
libxml_doc_props const* doc_prop = dom_get_doc_props_read_only(obj->document);
301301
ZVAL_BOOL(retval, doc_prop->formatoutput);
302302
return SUCCESS;
303303
}
304304

305-
int dom_document_format_output_write(dom_object *obj, zval *newval)
305+
zend_result dom_document_format_output_write(dom_object *obj, zval *newval)
306306
{
307307
if (obj->document) {
308308
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -316,14 +316,14 @@ int dom_document_format_output_write(dom_object *obj, zval *newval)
316316
/* {{{ validateOnParse boolean
317317
readonly=no
318318
*/
319-
int dom_document_validate_on_parse_read(dom_object *obj, zval *retval)
319+
zend_result dom_document_validate_on_parse_read(dom_object *obj, zval *retval)
320320
{
321321
libxml_doc_props const* doc_prop = dom_get_doc_props_read_only(obj->document);
322322
ZVAL_BOOL(retval, doc_prop->validateonparse);
323323
return SUCCESS;
324324
}
325325

326-
int dom_document_validate_on_parse_write(dom_object *obj, zval *newval)
326+
zend_result dom_document_validate_on_parse_write(dom_object *obj, zval *newval)
327327
{
328328
if (obj->document) {
329329
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -337,14 +337,14 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval)
337337
/* {{{ resolveExternals boolean
338338
readonly=no
339339
*/
340-
int dom_document_resolve_externals_read(dom_object *obj, zval *retval)
340+
zend_result dom_document_resolve_externals_read(dom_object *obj, zval *retval)
341341
{
342342
libxml_doc_props const* doc_prop = dom_get_doc_props_read_only(obj->document);
343343
ZVAL_BOOL(retval, doc_prop->resolveexternals);
344344
return SUCCESS;
345345
}
346346

347-
int dom_document_resolve_externals_write(dom_object *obj, zval *newval)
347+
zend_result dom_document_resolve_externals_write(dom_object *obj, zval *newval)
348348
{
349349
if (obj->document) {
350350
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -358,14 +358,14 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval)
358358
/* {{{ preserveWhiteSpace boolean
359359
readonly=no
360360
*/
361-
int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval)
361+
zend_result dom_document_preserve_whitespace_read(dom_object *obj, zval *retval)
362362
{
363363
libxml_doc_props const* doc_prop = dom_get_doc_props_read_only(obj->document);
364364
ZVAL_BOOL(retval, doc_prop->preservewhitespace);
365365
return SUCCESS;
366366
}
367367

368-
int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval)
368+
zend_result dom_document_preserve_whitespace_write(dom_object *obj, zval *newval)
369369
{
370370
if (obj->document) {
371371
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -379,14 +379,14 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval)
379379
/* {{{ recover boolean
380380
readonly=no
381381
*/
382-
int dom_document_recover_read(dom_object *obj, zval *retval)
382+
zend_result dom_document_recover_read(dom_object *obj, zval *retval)
383383
{
384384
libxml_doc_props const* doc_prop = dom_get_doc_props_read_only(obj->document);
385385
ZVAL_BOOL(retval, doc_prop->recover);
386386
return SUCCESS;
387387
}
388388

389-
int dom_document_recover_write(dom_object *obj, zval *newval)
389+
zend_result dom_document_recover_write(dom_object *obj, zval *newval)
390390
{
391391
if (obj->document) {
392392
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -400,14 +400,14 @@ int dom_document_recover_write(dom_object *obj, zval *newval)
400400
/* {{{ substituteEntities boolean
401401
readonly=no
402402
*/
403-
int dom_document_substitue_entities_read(dom_object *obj, zval *retval)
403+
zend_result dom_document_substitue_entities_read(dom_object *obj, zval *retval)
404404
{
405405
libxml_doc_props const* doc_prop = dom_get_doc_props_read_only(obj->document);
406406
ZVAL_BOOL(retval, doc_prop->substituteentities);
407407
return SUCCESS;
408408
}
409409

410-
int dom_document_substitue_entities_write(dom_object *obj, zval *newval)
410+
zend_result dom_document_substitue_entities_write(dom_object *obj, zval *newval)
411411
{
412412
if (obj->document) {
413413
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -423,7 +423,7 @@ readonly=no
423423
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
424424
Since: DOM Level 3
425425
*/
426-
int dom_document_document_uri_read(dom_object *obj, zval *retval)
426+
zend_result dom_document_document_uri_read(dom_object *obj, zval *retval)
427427
{
428428
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
429429
char *url;
@@ -443,7 +443,7 @@ int dom_document_document_uri_read(dom_object *obj, zval *retval)
443443
return SUCCESS;
444444
}
445445

446-
int dom_document_document_uri_write(dom_object *obj, zval *newval)
446+
zend_result dom_document_document_uri_write(dom_object *obj, zval *newval)
447447
{
448448
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
449449
zend_string *str;
@@ -475,7 +475,7 @@ readonly=yes
475475
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
476476
Since: DOM Level 3
477477
*/
478-
int dom_document_config_read(dom_object *obj, zval *retval)
478+
zend_result dom_document_config_read(dom_object *obj, zval *retval)
479479
{
480480
ZVAL_NULL(retval);
481481
return SUCCESS;

ext/dom/documenttype.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ readonly=yes
2828
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1844763134
2929
Since:
3030
*/
31-
int dom_documenttype_name_read(dom_object *obj, zval *retval)
31+
zend_result dom_documenttype_name_read(dom_object *obj, zval *retval)
3232
{
3333
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
3434

@@ -49,7 +49,7 @@ readonly=yes
4949
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1788794630
5050
Since:
5151
*/
52-
int dom_documenttype_entities_read(dom_object *obj, zval *retval)
52+
zend_result dom_documenttype_entities_read(dom_object *obj, zval *retval)
5353
{
5454
xmlDtdPtr doctypep = (xmlDtdPtr) dom_object_get_node(obj);
5555
xmlHashTable *entityht;
@@ -77,7 +77,7 @@ readonly=yes
7777
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D46829EF
7878
Since:
7979
*/
80-
int dom_documenttype_notations_read(dom_object *obj, zval *retval)
80+
zend_result dom_documenttype_notations_read(dom_object *obj, zval *retval)
8181
{
8282
xmlDtdPtr doctypep = (xmlDtdPtr) dom_object_get_node(obj);
8383
xmlHashTable *notationht;
@@ -105,7 +105,7 @@ readonly=yes
105105
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-publicId
106106
Since: DOM Level 2
107107
*/
108-
int dom_documenttype_public_id_read(dom_object *obj, zval *retval)
108+
zend_result dom_documenttype_public_id_read(dom_object *obj, zval *retval)
109109
{
110110
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
111111

@@ -130,7 +130,7 @@ readonly=yes
130130
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-systemId
131131
Since: DOM Level 2
132132
*/
133-
int dom_documenttype_system_id_read(dom_object *obj, zval *retval)
133+
zend_result dom_documenttype_system_id_read(dom_object *obj, zval *retval)
134134
{
135135
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
136136

@@ -154,7 +154,7 @@ readonly=yes
154154
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-internalSubset
155155
Since: DOM Level 2
156156
*/
157-
int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval)
157+
zend_result dom_documenttype_internal_subset_read(dom_object *obj, zval *retval)
158158
{
159159
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
160160
xmlDtdPtr intsubset;

0 commit comments

Comments
 (0)