Skip to content

Commit b26373d

Browse files
committed
Update last stub infos based on nikis comments.
1 parent f498b10 commit b26373d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

ext/dom/dom.stub.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,11 @@ public function getFeature(string $feature, string $version) {}
260260
/** @return bool */
261261
public function hasFeature(string $feature, string $version) {}
262262

263+
/** @return DOMDocumentType|false */
263264
public function createDocumentType($qualifiedName, $publicId, $systemId) {}
264265

265266
/** @return DOMDocument|false */
266-
public function createDocument(?string $namespaceURI = null, ?string $qualifiedName = null, ?DOMDocumentType $doctype = null) {}
267+
public function createDocument(string $namespaceURI = "", string $qualifiedName = "", DOMDocumentType $doctype = UNKNOWN) {}
267268
}
268269

269270
class DOMNamedNodeMap {
@@ -323,4 +324,7 @@ public function registerPhpFunctions($restrict = null) {}
323324
}
324325
#endif
325326

327+
class DOMDocumentType {
328+
}
329+
326330
function dom_import_simplexml(object $node): ?DOMElement {}

ext/dom/dom_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocumentType, 0, 0,
329329
ZEND_END_ARG_INFO()
330330

331331
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocument, 0, 0, 0)
332-
ZEND_ARG_TYPE_INFO(0, namespaceURI, IS_STRING, 1)
333-
ZEND_ARG_TYPE_INFO(0, qualifiedName, IS_STRING, 1)
334-
ZEND_ARG_OBJ_INFO(0, doctype, DOMDocumentType, 1)
332+
ZEND_ARG_TYPE_INFO(0, namespaceURI, IS_STRING, 0)
333+
ZEND_ARG_TYPE_INFO(0, qualifiedName, IS_STRING, 0)
334+
ZEND_ARG_OBJ_INFO(0, doctype, DOMDocumentType, 0)
335335
ZEND_END_ARG_INFO()
336336

337337
#define arginfo_class_DOMNamedNodeMap_getNamedItem arginfo_class_DOMDocument_createAttribute

ext/dom/domimplementation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ PHP_METHOD(domimplementation, createDocumentType)
7373
xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL;
7474
xmlURIPtr uri;
7575

76-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) {
76+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) {
7777
return;
7878
}
7979

@@ -139,7 +139,7 @@ PHP_METHOD(domimplementation, createDocument)
139139
char *prefix = NULL, *localname = NULL;
140140
dom_object *doctobj;
141141

142-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssO", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) {
142+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssO!", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) {
143143
return;
144144
}
145145

0 commit comments

Comments
 (0)