Skip to content

Commit 010c340

Browse files
author
Rob Richards
committed
use new style constructors
fix return for nodelist item
1 parent 39a43c9 commit 010c340

File tree

12 files changed

+50
-49
lines changed

12 files changed

+50
-49
lines changed

ext/dom/attr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939

4040
zend_function_entry php_dom_attr_class_functions[] = {
4141
PHP_FALIAS(isId, dom_attr_is_id, NULL)
42-
PHP_FALIAS(domattr, dom_attr_attr, NULL)
42+
PHP_ME(domattr, __construct, NULL, ZEND_ACC_PUBLIC)
4343
{NULL, NULL, NULL}
4444
};
4545

46-
/* {{{ proto domnode dom_attr_attr(string name, [string value]); */
47-
PHP_FUNCTION(dom_attr_attr)
46+
/* {{{ proto void DomAttr::__construct(string name, [string value]); */
47+
PHP_METHOD(domattr, __construct)
4848
{
4949

5050
zval *id;
@@ -79,7 +79,7 @@ PHP_FUNCTION(dom_attr_attr)
7979
}
8080
}
8181

82-
/* }}} end dom_attr_attr */
82+
/* }}} end DomAttr::__construct */
8383

8484

8585
/* {{{ proto name string

ext/dom/cdatasection.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
*/
3737

3838
zend_function_entry php_dom_cdatasection_class_functions[] = {
39-
PHP_FALIAS("domcdatasection", dom_cdatasection_cdatasection, NULL)
39+
PHP_ME(domcdatasection, __construct, NULL, ZEND_ACC_PUBLIC)
4040
{NULL, NULL, NULL}
4141
};
4242

43-
/* {{{ proto domnode dom_cdatasection_cdatasection(string value); */
44-
PHP_FUNCTION(dom_cdatasection_cdatasection)
43+
/* {{{ proto void DomCDataSection::__construct(string value); */
44+
PHP_METHOD(domcdatasection, __construct)
4545
{
4646

4747
zval *id;
@@ -68,6 +68,6 @@ PHP_FUNCTION(dom_cdatasection_cdatasection)
6868
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
6969
}
7070
}
71-
/* }}} end dom_cdatasection_cdatasection */
71+
/* }}} end DomCDataSection::__construct */
7272

7373
#endif

ext/dom/comment.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
*/
3737

3838
zend_function_entry php_dom_comment_class_functions[] = {
39-
PHP_FALIAS(domcomment, dom_comment_comment, NULL)
39+
PHP_ME(domcomment, __construct, NULL, ZEND_ACC_PUBLIC)
4040
{NULL, NULL, NULL}
4141
};
4242

43-
/* {{{ proto dom_comment_comment([string value]); */
44-
PHP_FUNCTION(dom_comment_comment)
43+
/* {{{ proto void DomComment::__construct([string value]); */
44+
PHP_METHOD(domcomment, __construct)
4545
{
4646

4747
zval *id;
@@ -68,5 +68,5 @@ PHP_FUNCTION(dom_comment_comment)
6868
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC);
6969
}
7070
}
71-
/* }}} end dom_comment_comment */
71+
/* }}} end DomComment::__construct */
7272
#endif

ext/dom/document.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ zend_function_entry php_dom_document_class_functions[] = {
7070
PHP_FALIAS(save, dom_document_save, NULL)
7171
PHP_ME(domdocument, loadXML, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
7272
PHP_FALIAS(saveXML, dom_document_savexml, NULL)
73-
PHP_FALIAS(domdocument, dom_document_document, NULL)
73+
PHP_ME(domdocument, __construct, NULL, ZEND_ACC_PUBLIC)
7474
PHP_FALIAS(validate, dom_document_validate, NULL)
7575
PHP_FALIAS(xinclude, dom_document_xinclude, NULL)
7676
#if defined(LIBXML_HTML_ENABLED)
@@ -1286,8 +1286,8 @@ PHP_FUNCTION(dom_document_rename_node)
12861286
}
12871287
/* }}} end dom_document_rename_node */
12881288

1289-
/* {{{ proto domnode dom_document_document([string version], [string encoding]); */
1290-
PHP_FUNCTION(dom_document_document)
1289+
/* {{{ proto void DomDocument::__construct([string version], [string encoding]); */
1290+
PHP_METHOD(domdocument, __construct)
12911291
{
12921292

12931293
zval *id;

ext/dom/documentfragment.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
*/
3737

3838
zend_function_entry php_dom_documentfragment_class_functions[] = {
39-
PHP_FALIAS(domdocumentfragment, dom_documentfragment_documentfragment, NULL)
39+
PHP_ME(domdocumentfragment, __construct, NULL, ZEND_ACC_PUBLIC)
4040
{NULL, NULL, NULL}
4141
};
4242

43-
/* {{{ proto dom_documentfragment_documentfragment(); */
44-
PHP_FUNCTION(dom_documentfragment_documentfragment)
43+
/* {{{ proto void DomDocumentFragment::__construct(); */
44+
PHP_METHOD(domdocumentfragment, __construct)
4545
{
4646

4747
zval *id;
@@ -67,5 +67,5 @@ PHP_FUNCTION(dom_documentfragment_documentfragment)
6767
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
6868
}
6969
}
70-
/* }}} end dom_documentfragment_documentfragment */
70+
/* }}} end DomDocumentFragment::__construct */
7171
#endif

ext/dom/dom_fe.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ PHP_METHOD(domimplementation, createDocument);
9999
PHP_METHOD(domimplementation, getFeature);
100100

101101
/* domdocumentfragment methods */
102-
PHP_FUNCTION(dom_documentfragment_documentfragment);
102+
PHP_METHOD(domdocumentfragment, __construct);
103103

104104
/* domdocument methods */
105105
PHP_FUNCTION(dom_document_create_element);
@@ -119,7 +119,7 @@ PHP_FUNCTION(dom_document_get_element_by_id);
119119
PHP_FUNCTION(dom_document_adopt_node);
120120
PHP_FUNCTION(dom_document_normalize_document);
121121
PHP_FUNCTION(dom_document_rename_node);
122-
PHP_FUNCTION(dom_document_document);
122+
PHP_METHOD(domdocument, __construct);
123123
/* convienience methods */
124124
PHP_METHOD(domdocument, load);
125125
PHP_FUNCTION(dom_document_save);
@@ -183,7 +183,7 @@ PHP_FUNCTION(dom_characterdata_replace_data);
183183

184184
/* domattr methods */
185185
PHP_FUNCTION(dom_attr_is_id);
186-
PHP_FUNCTION(dom_attr_attr);
186+
PHP_METHOD(domattr, __construct);
187187

188188
/* domelement methods */
189189
PHP_FUNCTION(dom_element_get_attribute);
@@ -204,16 +204,16 @@ PHP_FUNCTION(dom_element_has_attribute_ns);
204204
PHP_FUNCTION(dom_element_set_id_attribute);
205205
PHP_FUNCTION(dom_element_set_id_attribute_ns);
206206
PHP_FUNCTION(dom_element_set_id_attribute_node);
207-
PHP_FUNCTION(dom_element_element);
207+
PHP_METHOD(domelement, __construct);
208208

209209
/* domtext methods */
210210
PHP_FUNCTION(dom_text_split_text);
211211
PHP_FUNCTION(dom_text_is_whitespace_in_element_content);
212212
PHP_FUNCTION(dom_text_replace_whole_text);
213-
PHP_FUNCTION(dom_text_text);
213+
PHP_METHOD(domtext, __construct);
214214

215215
/* domcomment methods */
216-
PHP_FUNCTION(dom_comment_comment);
216+
PHP_METHOD(domcomment, __construct);
217217

218218
/* domtypeinfo methods */
219219

@@ -233,7 +233,7 @@ PHP_FUNCTION(dom_domconfiguration_get_parameter);
233233
PHP_FUNCTION(dom_domconfiguration_can_set_parameter);
234234

235235
/* domcdatasection methods */
236-
PHP_FUNCTION(dom_cdatasection_cdatasection);
236+
PHP_METHOD(domcdatasection, __construct);
237237

238238
/* domdocumenttype methods */
239239

@@ -242,18 +242,18 @@ PHP_FUNCTION(dom_cdatasection_cdatasection);
242242
/* domentity methods */
243243

244244
/* domentityreference methods */
245-
PHP_FUNCTION(dom_entityreference_entityreference);
245+
PHP_METHOD(domentityreference, __construct);
246246

247247
/* domprocessinginstruction methods */
248-
PHP_FUNCTION(dom_processinginstruction_processinginstruction);
248+
PHP_METHOD(domprocessinginstruction, __construct);
249249

250250
/* string_extend methods */
251251
PHP_FUNCTION(dom_string_extend_find_offset16);
252252
PHP_FUNCTION(dom_string_extend_find_offset32);
253253

254254
#if defined(LIBXML_XPATH_ENABLED)
255255
/* xpath methods */
256-
PHP_FUNCTION(dom_xpath_xpath);
256+
PHP_METHOD(domxpath, __construct);
257257
PHP_FUNCTION(dom_xpath_register_ns);
258258
PHP_FUNCTION(dom_xpath_query);
259259
#endif

ext/dom/element.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ zend_function_entry php_dom_element_class_functions[] = {
5454
PHP_FALIAS(setIdAttribute, dom_element_set_id_attribute, NULL)
5555
PHP_FALIAS(setIdAttributeNS, dom_element_set_id_attribute_ns, NULL)
5656
PHP_FALIAS(setIdAttributeNode, dom_element_set_id_attribute_node, NULL)
57-
PHP_FALIAS(domelement, dom_element_element, NULL)
57+
PHP_ME(domelement, __construct, NULL, ZEND_ACC_PUBLIC)
5858
{NULL, NULL, NULL}
5959
};
6060

61-
/* {{{ proto domnode dom_element_element(string name, [string value]); */
62-
PHP_FUNCTION(dom_element_element)
61+
/* {{{ proto void DomElement::__construct(string name, [string value]); */
62+
PHP_METHOD(domelement, __construct)
6363
{
6464

6565
zval *id;
@@ -121,7 +121,7 @@ PHP_FUNCTION(dom_element_element)
121121
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
122122
}
123123
}
124-
/* }}} end dom_element_element */
124+
/* }}} end DomElement::__construct */
125125

126126
/* {{{ proto tagName string
127127
readonly=yes

ext/dom/entityreference.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
*/
3737

3838
zend_function_entry php_dom_entityreference_class_functions[] = {
39-
PHP_FALIAS(domentityreference, dom_entityreference_entityreference, NULL)
39+
PHP_ME(domentityreference, __construct, NULL, ZEND_ACC_PUBLIC)
4040
{NULL, NULL, NULL}
4141
};
4242

43-
/* {{{ proto domnode dom_entityreference_entityreference(string name); */
44-
PHP_FUNCTION(dom_entityreference_entityreference)
43+
/* {{{ proto void DomEntityReference::__construct(string name); */
44+
PHP_METHOD(domentityreference, __construct)
4545
{
4646
zval *id;
4747
xmlNode *node;
@@ -74,5 +74,5 @@ PHP_FUNCTION(dom_entityreference_entityreference)
7474
}
7575
}
7676

77-
/* }}} end dom_entityreference_entityreference */
77+
/* }}} end DomEntityReference::__construct */
7878
#endif

ext/dom/nodelist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ PHP_FUNCTION(dom_nodelist_item)
160160

161161
if (itemnode) {
162162
DOM_RET_OBJ(rv, itemnode, &ret, objmap->baseobj);
163+
return;
163164
}
164165
}
165166

ext/dom/processinginstruction.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
*/
3737

3838
zend_function_entry php_dom_processinginstruction_class_functions[] = {
39-
PHP_FALIAS("domprocessinginstruction", dom_processinginstruction_processinginstruction, NULL)
39+
PHP_ME(domprocessinginstruction, __construct, NULL, ZEND_ACC_PUBLIC)
4040
{NULL, NULL, NULL}
4141
};
4242

43-
/* {{{ proto domnode dom_processinginstruction_processinginstruction(string name, [string value]); */
44-
PHP_FUNCTION(dom_processinginstruction_processinginstruction)
43+
/* {{{ proto void DomProcessingInstruction::__construct(string name, [string value]); */
44+
PHP_METHOD(domprocessinginstruction, __construct)
4545
{
4646

4747
zval *id;
@@ -73,7 +73,7 @@ PHP_FUNCTION(dom_processinginstruction_processinginstruction)
7373
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
7474
}
7575
}
76-
/* }}} end dom_processinginstruction_processinginstruction */
76+
/* }}} end DomProcessingInstruction::__construct */
7777

7878
/* {{{ proto target string
7979
readonly=yes

0 commit comments

Comments
 (0)