]> granicus.if.org Git - php/commitdiff
Fix stub for DomImplementation::createDocumentType()
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 10 Feb 2020 09:48:18 +0000 (10:48 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 10 Feb 2020 09:48:18 +0000 (10:48 +0100)
ext/dom/dom.stub.php
ext/dom/dom_arginfo.h
ext/dom/tests/DOMImplementation_createDocumentType_basic.phpt

index 36b478b73c72c8bb0da43b527fec2aa9fee9525d..d88fb7f4c49085ad081b1f451d26b642ddc055ef 100644 (file)
@@ -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) {}
index 6e58060bd87b2c41ea2924ce54a272a22060f90d..eda6659f9e03db384c5ddbbaa750b15e6cb8f76e 100644 (file)
@@ -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)
index ddce93052ce8a4ac17d1adfb68b55c694bd97694..400bcce6c34a0fc5bab176830c104c5125dd061e 100644 (file)
@@ -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--
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html></html>
+<!DOCTYPE html>
+<html></html>
+<!DOCTYPE html>
+<html></html>