From e579a2e797896856bbde640f8135bd66217f2342 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 7 Oct 2020 17:55:46 +0200 Subject: [PATCH 1/3] Update ext/xsl parameter names --- ext/xsl/php_xsl.stub.php | 9 ++++++--- ext/xsl/php_xsl_arginfo.h | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ext/xsl/php_xsl.stub.php b/ext/xsl/php_xsl.stub.php index 04cad46cbe8cc..28d9053eb77d5 100644 --- a/ext/xsl/php_xsl.stub.php +++ b/ext/xsl/php_xsl.stub.php @@ -4,14 +4,17 @@ class XSLTProcessor { - /** @return bool */ + /** + * @param DOMDocument|SimpleXMLElement $stylesheet + * @return bool + */ public function importStylesheet(object $stylesheet) {} /** * @param DOMDocument|SimpleXMLElement $document * @return DOMDocument|false */ - public function transformToDoc(object $document, ?string $return_class = null) {} + public function transformToDoc(object $document, ?string $returnClass = null) {} /** * @param DOMDocument|SimpleXMLElement $document @@ -38,7 +41,7 @@ public function removeParameter(string $namespace, string $name) {} public function hasExsltSupport() {} /** @return void */ - public function registerPHPFunctions(array|string|null $restrict = null) {} + public function registerPHPFunctions(array|string|null $functions = null) {} /** @return bool */ public function setProfiling(?string $filename) {} diff --git a/ext/xsl/php_xsl_arginfo.h b/ext/xsl/php_xsl_arginfo.h index a776dded68695..7cf6f9245a36a 100644 --- a/ext/xsl/php_xsl_arginfo.h +++ b/ext/xsl/php_xsl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4a3997bafb6c17714ee94443837be2d2842386e2 */ + * Stub hash: 77b278a9349573a355cb3f2fe441a7a0462c33ce */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, stylesheet, IS_OBJECT, 0) @@ -7,7 +7,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_transformToDoc, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, document, IS_OBJECT, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return_class, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, returnClass, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_transformToUri, 0, 0, 2) @@ -36,7 +36,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_hasExsltSupport, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_registerPHPFunctions, 0, 0, 0) - ZEND_ARG_TYPE_MASK(0, restrict, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") + ZEND_ARG_TYPE_MASK(0, functions, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setProfiling, 0, 0, 1) From a6f3fc50ad65844b7a2c34b100597ce479c19067 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 7 Oct 2020 17:57:48 +0200 Subject: [PATCH 2/3] Use $namespace instead of $uri --- ext/xmlreader/php_xmlreader.stub.php | 4 ++-- ext/xmlreader/php_xmlreader_arginfo.h | 4 ++-- ext/xmlreader/tests/015-get-errors.phpt | 2 +- ext/xmlreader/tests/015-move-errors.phpt | 2 +- ext/xmlwriter/php_xmlwriter.stub.php | 16 ++++++++-------- ext/xmlwriter/php_xmlwriter_arginfo.h | 14 +++++++------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ext/xmlreader/php_xmlreader.stub.php b/ext/xmlreader/php_xmlreader.stub.php index 6fe77a19fc52a..ecad4b392b819 100644 --- a/ext/xmlreader/php_xmlreader.stub.php +++ b/ext/xmlreader/php_xmlreader.stub.php @@ -14,7 +14,7 @@ public function getAttribute(string $name) {} public function getAttributeNo(int $index) {} /** @return string|null */ - public function getAttributeNs(string $name, string $uri) {} + public function getAttributeNs(string $name, string $namespace) {} /** @return bool */ public function getParserProperty(int $property) {} @@ -32,7 +32,7 @@ public function moveToAttribute(string $name) {} public function moveToAttributeNo(int $index) {} /** @return bool */ - public function moveToAttributeNs(string $name, string $uri) {} + public function moveToAttributeNs(string $name, string $namespace) {} /** @return bool */ public function moveToElement() {} diff --git a/ext/xmlreader/php_xmlreader_arginfo.h b/ext/xmlreader/php_xmlreader_arginfo.h index d9f9e4cf0a51b..487b53f698be9 100644 --- a/ext/xmlreader/php_xmlreader_arginfo.h +++ b/ext/xmlreader/php_xmlreader_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b5860285a7554c75780be7989bcbdeced6b557c8 */ + * Stub hash: 0188a53f262d3f8e19b5b64d163bdee84f1be6b8 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_close, 0, 0, 0) ZEND_END_ARG_INFO() @@ -14,7 +14,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttributeNs, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getParserProperty, 0, 0, 1) diff --git a/ext/xmlreader/tests/015-get-errors.phpt b/ext/xmlreader/tests/015-get-errors.phpt index 98f4386b7cf5d..7ea081c82f0bc 100644 --- a/ext/xmlreader/tests/015-get-errors.phpt +++ b/ext/xmlreader/tests/015-get-errors.phpt @@ -46,5 +46,5 @@ $reader->close(); unlink(__DIR__.'/015-get-errors.xml'); ?> --EXPECT-- -XMLReader::getAttributeNs(): Argument #2 ($uri) cannot be empty +XMLReader::getAttributeNs(): Argument #2 ($namespace) cannot be empty ns1:num: 1 diff --git a/ext/xmlreader/tests/015-move-errors.phpt b/ext/xmlreader/tests/015-move-errors.phpt index 13020be770ee5..303d5c63e45ea 100644 --- a/ext/xmlreader/tests/015-move-errors.phpt +++ b/ext/xmlreader/tests/015-move-errors.phpt @@ -41,4 +41,4 @@ $reader->close(); unlink(__DIR__.'/015-move-errors.xml'); ?> --EXPECT-- -XMLReader::moveToAttributeNs(): Argument #2 ($uri) cannot be empty +XMLReader::moveToAttributeNs(): Argument #2 ($namespace) cannot be empty diff --git a/ext/xmlwriter/php_xmlwriter.stub.php b/ext/xmlwriter/php_xmlwriter.stub.php index 981cadda85836..857a41774c4fd 100644 --- a/ext/xmlwriter/php_xmlwriter.stub.php +++ b/ext/xmlwriter/php_xmlwriter.stub.php @@ -20,9 +20,9 @@ function xmlwriter_end_attribute(XMLWriter $writer): bool {} function xmlwriter_write_attribute(XMLWriter $writer, string $name, string $value): bool {} -function xmlwriter_start_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri): bool {} +function xmlwriter_start_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace): bool {} -function xmlwriter_write_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri, string $value): bool {} +function xmlwriter_write_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace, string $value): bool {} function xmlwriter_start_element(XMLWriter $writer, string $name): bool {} @@ -30,11 +30,11 @@ function xmlwriter_end_element(XMLWriter $writer): bool {} function xmlwriter_full_end_element(XMLWriter $writer): bool {} -function xmlwriter_start_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri): bool {} +function xmlwriter_start_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace): bool {} function xmlwriter_write_element(XMLWriter $writer, string $name, ?string $content = null): bool {} -function xmlwriter_write_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri, ?string $content = null): bool {} +function xmlwriter_write_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace, ?string $content = null): bool {} function xmlwriter_start_pi(XMLWriter $writer, string $target): bool {} @@ -116,10 +116,10 @@ public function endAttribute(): bool {} public function writeAttribute(string $name, string $value): bool {} /** @alias xmlwriter_start_attribute_ns */ - public function startAttributeNs(?string $prefix, string $name, ?string $uri): bool {} + public function startAttributeNs(?string $prefix, string $name, ?string $namespace): bool {} /** @alias xmlwriter_write_attribute_ns */ - public function writeAttributeNs(?string $prefix, string $name, ?string $uri, string $value): bool {} + public function writeAttributeNs(?string $prefix, string $name, ?string $namespace, string $value): bool {} /** @alias xmlwriter_start_element */ public function startElement(string $name): bool {} @@ -131,13 +131,13 @@ public function endElement(): bool {} public function fullEndElement(): bool {} /** @alias xmlwriter_start_element_ns */ - public function startElementNs(?string $prefix, string $name, ?string $uri): bool {} + public function startElementNs(?string $prefix, string $name, ?string $namespace): bool {} /** @alias xmlwriter_write_element */ public function writeElement(string $name, ?string $content = null): bool {} /** @alias xmlwriter_write_element_ns */ - public function writeElementNs(?string $prefix, string $name, ?string $uri, ?string $content = null): bool {} + public function writeElementNs(?string $prefix, string $name, ?string $namespace, ?string $content = null): bool {} /** @alias xmlwriter_start_pi */ public function startPi(string $target): bool {} diff --git a/ext/xmlwriter/php_xmlwriter_arginfo.h b/ext/xmlwriter/php_xmlwriter_arginfo.h index 2d5bccdb42ce6..3a3b52eef711c 100644 --- a/ext/xmlwriter/php_xmlwriter_arginfo.h +++ b/ext/xmlwriter/php_xmlwriter_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d265aff62d6dcd195c65e6205cc4cac063f5f237 */ + * Stub hash: 891054e4aaf1d24b0965828de8287392b6a389a3 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xmlwriter_open_uri, 0, 1, XMLWriter, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) @@ -41,14 +41,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_start_attribute_ns, 0, ZEND_ARG_OBJ_INFO(0, writer, XMLWriter, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_write_attribute_ns, 0, 5, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, writer, XMLWriter, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -70,7 +70,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_write_element_ns, 0, 4 ZEND_ARG_OBJ_INFO(0, writer, XMLWriter, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -208,13 +208,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startAttributeNs, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeAttributeNs, 0, 4, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -234,7 +234,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeElementNs, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null") ZEND_END_ARG_INFO() From 29e901d0f4232dc7417189b9433a7170dcbf0109 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 8 Oct 2020 09:54:56 +0200 Subject: [PATCH 3/3] $securityPrefs -> $preferences --- ext/xsl/php_xsl.stub.php | 2 +- ext/xsl/php_xsl_arginfo.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/xsl/php_xsl.stub.php b/ext/xsl/php_xsl.stub.php index 28d9053eb77d5..536f82ac20052 100644 --- a/ext/xsl/php_xsl.stub.php +++ b/ext/xsl/php_xsl.stub.php @@ -47,7 +47,7 @@ public function registerPHPFunctions(array|string|null $functions = null) {} public function setProfiling(?string $filename) {} /** @return int */ - public function setSecurityPrefs(int $securityPrefs) {} + public function setSecurityPrefs(int $preferences) {} /** @return int */ public function getSecurityPrefs() {} diff --git a/ext/xsl/php_xsl_arginfo.h b/ext/xsl/php_xsl_arginfo.h index 7cf6f9245a36a..8f7f90a053c8e 100644 --- a/ext/xsl/php_xsl_arginfo.h +++ b/ext/xsl/php_xsl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 77b278a9349573a355cb3f2fe441a7a0462c33ce */ + * Stub hash: a119247725ff61dbd615cb86ee6201ee6603ba51 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, stylesheet, IS_OBJECT, 0) @@ -44,7 +44,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setProfiling, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setSecurityPrefs, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, securityPrefs, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, preferences, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_class_XSLTProcessor_getSecurityPrefs arginfo_class_XSLTProcessor_hasExsltSupport