]> granicus.if.org Git - php/commitdiff
Update ext/xsl parameter names
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 7 Oct 2020 15:55:46 +0000 (17:55 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 8 Oct 2020 08:28:50 +0000 (10:28 +0200)
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.

ext/xmlreader/php_xmlreader.stub.php
ext/xmlreader/php_xmlreader_arginfo.h
ext/xmlreader/tests/015-get-errors.phpt
ext/xmlreader/tests/015-move-errors.phpt
ext/xmlwriter/php_xmlwriter.stub.php
ext/xmlwriter/php_xmlwriter_arginfo.h
ext/xsl/php_xsl.stub.php
ext/xsl/php_xsl_arginfo.h

index 6fe77a19fc52aa8984ac851c1faad8b744cc2cc9..ecad4b392b8197de0701d9a58f1ae7dc1e4eff2d 100644 (file)
@@ -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() {}
index d9f9e4cf0a51b095293306c371a950acdcc151a9..487b53f698be9614450c9d66fa94e26e7540cd94 100644 (file)
@@ -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)
index 98f4386b7cf5d54f5fa87615caffb05361606a90..7ea081c82f0bc167b55268891249baa4d31e0b75 100644 (file)
@@ -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
index 13020be770ee5f3b9a8a99ad282fde90d23cde52..303d5c63e45ea5426441aa6d83374a5a8b3e3f46 100644 (file)
@@ -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
index 981cadda85836387a12fb70fbc5a11a43cca318f..857a41774c4fdee3687af945255174b5d9dd98a2 100644 (file)
@@ -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 {}
index 2d5bccdb42ce623703b47ba64081171606fba070..3a3b52eef711c6bd5f92420503d299747f130d13 100644 (file)
@@ -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()
 
index 04cad46cbe8cce0b54d739844e3c10cb8ffca3c2..536f82ac20052b32a9ccab95ae2e16c73f06b9b4 100644 (file)
@@ -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() {}
index a776dded68695c3df4f30e70e78e520c2c5eb7db..8f7f90a053c8eef5b0a56a71c7955bf2ca516f86 100644 (file)
@@ -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