summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-10-07 17:55:46 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-10-08 10:28:50 +0200
commit1fba22072596c34b32fa09986107bde3b4ab946d (patch)
tree445fe48367cd972359577d6d564c06239f340edf
parentc05898d6c6ed0346a2f703753b8cf0885689b3ee (diff)
downloadphp-git-1fba22072596c34b32fa09986107bde3b4ab946d.tar.gz
Update ext/xsl parameter names
Additionally normalize to using $namespace rather than $uri for namespace parameters, including in XMLReader and XMLWriter. I went with that one as it is currently used by DOM, SimpleXML and XSL -- and our DOM parameter names follow the DOM specification. Closes GH-6295.
-rw-r--r--ext/xmlreader/php_xmlreader.stub.php4
-rw-r--r--ext/xmlreader/php_xmlreader_arginfo.h4
-rw-r--r--ext/xmlreader/tests/015-get-errors.phpt2
-rw-r--r--ext/xmlreader/tests/015-move-errors.phpt2
-rw-r--r--ext/xmlwriter/php_xmlwriter.stub.php16
-rw-r--r--ext/xmlwriter/php_xmlwriter_arginfo.h14
-rw-r--r--ext/xsl/php_xsl.stub.php11
-rw-r--r--ext/xsl/php_xsl_arginfo.h8
8 files changed, 32 insertions, 29 deletions
diff --git a/ext/xmlreader/php_xmlreader.stub.php b/ext/xmlreader/php_xmlreader.stub.php
index 6fe77a19fc..ecad4b392b 100644
--- a/ext/xmlreader/php_xmlreader.stub.php
+++ b/ext/xmlreader/php_xmlreader.stub.php
@@ -14,7 +14,7 @@ class XMLReader
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 @@ class XMLReader
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 d9f9e4cf0a..487b53f698 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 98f4386b7c..7ea081c82f 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 13020be770..303d5c63e4 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 981cadda85..857a41774c 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 @@ class XMLWriter
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 @@ class XMLWriter
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 2d5bccdb42..3a3b52eef7 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()
diff --git a/ext/xsl/php_xsl.stub.php b/ext/xsl/php_xsl.stub.php
index 04cad46cbe..536f82ac20 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,13 +41,13 @@ class XSLTProcessor
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) {}
/** @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 a776dded68..8f7f90a053 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: a119247725ff61dbd615cb86ee6201ee6603ba51 */
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)
@@ -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