diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-09 12:29:50 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-09 12:29:50 +0100 |
commit | e32d5e8fe79360daa6d75f496776d91cf9d32852 (patch) | |
tree | 7dad25979417494947c24bfd094cbc34f52a3f36 | |
parent | cfb94b22d549b68dd4618c04c889a190529e0ee9 (diff) | |
parent | 3549f48edc914db041d81ae207400971d1c6c43c (diff) | |
download | php-git-e32d5e8fe79360daa6d75f496776d91cf9d32852.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Make createDocument() $namespace nullable
-rw-r--r-- | ext/dom/domimplementation.c | 2 | ||||
-rw-r--r-- | ext/dom/php_dom.stub.php | 2 | ||||
-rw-r--r-- | ext/dom/php_dom_arginfo.h | 4 | ||||
-rw-r--r-- | ext/dom/tests/DOMImplementation_createDocument_basic.phpt | 1 |
4 files changed, 5 insertions, 4 deletions
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index b195af5549..24b04f2b68 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -127,7 +127,7 @@ PHP_METHOD(DOMImplementation, createDocument) char *prefix = NULL, *localname = NULL; dom_object *doctobj; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssO!", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!sO!", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) { RETURN_THROWS(); } diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index c1310a2399..8f28056a19 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -112,7 +112,7 @@ class DOMImplementation public function createDocumentType(string $qualifiedName, string $publicId = "", string $systemId = "") {} /** @return DOMDocument|false */ - public function createDocument(string $namespace = "", string $qualifiedName = "", ?DOMDocumentType $doctype = null) {} + public function createDocument(?string $namespace = null, string $qualifiedName = "", ?DOMDocumentType $doctype = null) {} } class DOMDocumentFragment extends DOMNode implements DOMParentNode diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index 53f3e98624..592e713c05 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5d6877f7b7474a39a710ffde69122cd029663f26 */ + * Stub hash: 506911ba27d7f57bc66fcba93ea0c284689d9527 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 1) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0) @@ -106,7 +106,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocumentType, 0, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DOMImplementation_createDocument, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, namespace, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, namespace, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, qualifiedName, IS_STRING, 0, "\"\"") ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, doctype, DOMDocumentType, 1, "null") ZEND_END_ARG_INFO() diff --git a/ext/dom/tests/DOMImplementation_createDocument_basic.phpt b/ext/dom/tests/DOMImplementation_createDocument_basic.phpt index e501cd29e3..23a8e04b24 100644 --- a/ext/dom/tests/DOMImplementation_createDocument_basic.phpt +++ b/ext/dom/tests/DOMImplementation_createDocument_basic.phpt @@ -6,6 +6,7 @@ include('skipif.inc'); ?> --FILE-- <?php +declare(strict_types=1); $x = new DOMImplementation(); $doc = $x->createDocument(null, 'html'); echo $doc->saveHTML(); |