From: Nikita Popov Date: Mon, 10 Feb 2020 09:48:18 +0000 (+0100) Subject: Fix stub for DomImplementation::createDocumentType() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74da772933731312cbfb48febb0855dae56d8126;p=php Fix stub for DomImplementation::createDocumentType() --- diff --git a/ext/dom/dom.stub.php b/ext/dom/dom.stub.php index 36b478b73c..d88fb7f4c4 100644 --- a/ext/dom/dom.stub.php +++ b/ext/dom/dom.stub.php @@ -261,7 +261,8 @@ class DOMImplementation { public function hasFeature(string $feature, string $version) {} /** @return DOMDocumentType|false */ - public function createDocumentType($qualifiedName, $publicId, $systemId) {} + public function createDocumentType( + string $qualifiedName, string $publicId = "", string $systemId = "") {} /** @return DOMDocument|false */ public function createDocument(string $namespaceURI = "", string $qualifiedName = "", DOMDocumentType $doctype = UNKNOWN) {} diff --git a/ext/dom/dom_arginfo.h b/ext/dom/dom_arginfo.h index 6e58060bd8..eda6659f9e 100644 --- a/ext/dom/dom_arginfo.h +++ b/ext/dom/dom_arginfo.h @@ -322,10 +322,10 @@ ZEND_END_ARG_INFO() #define arginfo_class_DOMImplementation_hasFeature arginfo_class_DOMNode_isSupported -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocumentType, 0, 0, 3) - ZEND_ARG_INFO(0, qualifiedName) - ZEND_ARG_INFO(0, publicId) - ZEND_ARG_INFO(0, systemId) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocumentType, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, qualifiedName, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, publicId, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, systemId, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocument, 0, 0, 0) diff --git a/ext/dom/tests/DOMImplementation_createDocumentType_basic.phpt b/ext/dom/tests/DOMImplementation_createDocumentType_basic.phpt index ddce93052c..400bcce6c3 100644 --- a/ext/dom/tests/DOMImplementation_createDocumentType_basic.phpt +++ b/ext/dom/tests/DOMImplementation_createDocumentType_basic.phpt @@ -12,7 +12,20 @@ $doctype = $imp->createDocumentType("html", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"); $doc = $imp->createDocument(null, 'html', $doctype); echo $doc->saveHTML(); + +$doctype = $imp->createDocumentType("html"); +$doc = $imp->createDocument(null, 'html', $doctype); +echo $doc->saveHTML(); + +$doctype = $imp->createDocumentType("html", "", ""); +$doc = $imp->createDocument(null, 'html', $doctype); +echo $doc->saveHTML(); + ?> --EXPECT-- + + + +