Skip to content

Commit 1fba220

Browse files
committed
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.
1 parent c05898d commit 1fba220

File tree

8 files changed

+32
-29
lines changed

8 files changed

+32
-29
lines changed

ext/xmlreader/php_xmlreader.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function getAttribute(string $name) {}
1414
public function getAttributeNo(int $index) {}
1515

1616
/** @return string|null */
17-
public function getAttributeNs(string $name, string $uri) {}
17+
public function getAttributeNs(string $name, string $namespace) {}
1818

1919
/** @return bool */
2020
public function getParserProperty(int $property) {}
@@ -32,7 +32,7 @@ public function moveToAttribute(string $name) {}
3232
public function moveToAttributeNo(int $index) {}
3333

3434
/** @return bool */
35-
public function moveToAttributeNs(string $name, string $uri) {}
35+
public function moveToAttributeNs(string $name, string $namespace) {}
3636

3737
/** @return bool */
3838
public function moveToElement() {}

ext/xmlreader/php_xmlreader_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: b5860285a7554c75780be7989bcbdeced6b557c8 */
2+
* Stub hash: 0188a53f262d3f8e19b5b64d163bdee84f1be6b8 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_close, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -14,7 +14,7 @@ ZEND_END_ARG_INFO()
1414

1515
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttributeNs, 0, 0, 2)
1616
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
17-
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0)
17+
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0)
1818
ZEND_END_ARG_INFO()
1919

2020
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getParserProperty, 0, 0, 1)

ext/xmlreader/tests/015-get-errors.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ $reader->close();
4646
unlink(__DIR__.'/015-get-errors.xml');
4747
?>
4848
--EXPECT--
49-
XMLReader::getAttributeNs(): Argument #2 ($uri) cannot be empty
49+
XMLReader::getAttributeNs(): Argument #2 ($namespace) cannot be empty
5050
ns1:num: 1

ext/xmlreader/tests/015-move-errors.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ $reader->close();
4141
unlink(__DIR__.'/015-move-errors.xml');
4242
?>
4343
--EXPECT--
44-
XMLReader::moveToAttributeNs(): Argument #2 ($uri) cannot be empty
44+
XMLReader::moveToAttributeNs(): Argument #2 ($namespace) cannot be empty

ext/xmlwriter/php_xmlwriter.stub.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ function xmlwriter_end_attribute(XMLWriter $writer): bool {}
2020

2121
function xmlwriter_write_attribute(XMLWriter $writer, string $name, string $value): bool {}
2222

23-
function xmlwriter_start_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri): bool {}
23+
function xmlwriter_start_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace): bool {}
2424

25-
function xmlwriter_write_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri, string $value): bool {}
25+
function xmlwriter_write_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace, string $value): bool {}
2626

2727
function xmlwriter_start_element(XMLWriter $writer, string $name): bool {}
2828

2929
function xmlwriter_end_element(XMLWriter $writer): bool {}
3030

3131
function xmlwriter_full_end_element(XMLWriter $writer): bool {}
3232

33-
function xmlwriter_start_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri): bool {}
33+
function xmlwriter_start_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace): bool {}
3434

3535
function xmlwriter_write_element(XMLWriter $writer, string $name, ?string $content = null): bool {}
3636

37-
function xmlwriter_write_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri, ?string $content = null): bool {}
37+
function xmlwriter_write_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $namespace, ?string $content = null): bool {}
3838

3939
function xmlwriter_start_pi(XMLWriter $writer, string $target): bool {}
4040

@@ -116,10 +116,10 @@ public function endAttribute(): bool {}
116116
public function writeAttribute(string $name, string $value): bool {}
117117

118118
/** @alias xmlwriter_start_attribute_ns */
119-
public function startAttributeNs(?string $prefix, string $name, ?string $uri): bool {}
119+
public function startAttributeNs(?string $prefix, string $name, ?string $namespace): bool {}
120120

121121
/** @alias xmlwriter_write_attribute_ns */
122-
public function writeAttributeNs(?string $prefix, string $name, ?string $uri, string $value): bool {}
122+
public function writeAttributeNs(?string $prefix, string $name, ?string $namespace, string $value): bool {}
123123

124124
/** @alias xmlwriter_start_element */
125125
public function startElement(string $name): bool {}
@@ -131,13 +131,13 @@ public function endElement(): bool {}
131131
public function fullEndElement(): bool {}
132132

133133
/** @alias xmlwriter_start_element_ns */
134-
public function startElementNs(?string $prefix, string $name, ?string $uri): bool {}
134+
public function startElementNs(?string $prefix, string $name, ?string $namespace): bool {}
135135

136136
/** @alias xmlwriter_write_element */
137137
public function writeElement(string $name, ?string $content = null): bool {}
138138

139139
/** @alias xmlwriter_write_element_ns */
140-
public function writeElementNs(?string $prefix, string $name, ?string $uri, ?string $content = null): bool {}
140+
public function writeElementNs(?string $prefix, string $name, ?string $namespace, ?string $content = null): bool {}
141141

142142
/** @alias xmlwriter_start_pi */
143143
public function startPi(string $target): bool {}

ext/xmlwriter/php_xmlwriter_arginfo.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: d265aff62d6dcd195c65e6205cc4cac063f5f237 */
2+
* Stub hash: 891054e4aaf1d24b0965828de8287392b6a389a3 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xmlwriter_open_uri, 0, 1, XMLWriter, MAY_BE_FALSE)
55
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,
4141
ZEND_ARG_OBJ_INFO(0, writer, XMLWriter, 0)
4242
ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1)
4343
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
44-
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1)
44+
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1)
4545
ZEND_END_ARG_INFO()
4646

4747
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_write_attribute_ns, 0, 5, _IS_BOOL, 0)
4848
ZEND_ARG_OBJ_INFO(0, writer, XMLWriter, 0)
4949
ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1)
5050
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
51-
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1)
51+
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1)
5252
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
5353
ZEND_END_ARG_INFO()
5454

@@ -70,7 +70,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_write_element_ns, 0, 4
7070
ZEND_ARG_OBJ_INFO(0, writer, XMLWriter, 0)
7171
ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1)
7272
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
73-
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1)
73+
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1)
7474
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null")
7575
ZEND_END_ARG_INFO()
7676

@@ -208,13 +208,13 @@ ZEND_END_ARG_INFO()
208208
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startAttributeNs, 0, 3, _IS_BOOL, 0)
209209
ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1)
210210
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
211-
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1)
211+
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1)
212212
ZEND_END_ARG_INFO()
213213

214214
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeAttributeNs, 0, 4, _IS_BOOL, 0)
215215
ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1)
216216
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
217-
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1)
217+
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1)
218218
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
219219
ZEND_END_ARG_INFO()
220220

@@ -234,7 +234,7 @@ ZEND_END_ARG_INFO()
234234
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_writeElementNs, 0, 3, _IS_BOOL, 0)
235235
ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1)
236236
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
237-
ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1)
237+
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 1)
238238
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null")
239239
ZEND_END_ARG_INFO()
240240

ext/xsl/php_xsl.stub.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
class XSLTProcessor
66
{
7-
/** @return bool */
7+
/**
8+
* @param DOMDocument|SimpleXMLElement $stylesheet
9+
* @return bool
10+
*/
811
public function importStylesheet(object $stylesheet) {}
912

1013
/**
1114
* @param DOMDocument|SimpleXMLElement $document
1215
* @return DOMDocument|false
1316
*/
14-
public function transformToDoc(object $document, ?string $return_class = null) {}
17+
public function transformToDoc(object $document, ?string $returnClass = null) {}
1518

1619
/**
1720
* @param DOMDocument|SimpleXMLElement $document
@@ -38,13 +41,13 @@ public function removeParameter(string $namespace, string $name) {}
3841
public function hasExsltSupport() {}
3942

4043
/** @return void */
41-
public function registerPHPFunctions(array|string|null $restrict = null) {}
44+
public function registerPHPFunctions(array|string|null $functions = null) {}
4245

4346
/** @return bool */
4447
public function setProfiling(?string $filename) {}
4548

4649
/** @return int */
47-
public function setSecurityPrefs(int $securityPrefs) {}
50+
public function setSecurityPrefs(int $preferences) {}
4851

4952
/** @return int */
5053
public function getSecurityPrefs() {}

ext/xsl/php_xsl_arginfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 4a3997bafb6c17714ee94443837be2d2842386e2 */
2+
* Stub hash: a119247725ff61dbd615cb86ee6201ee6603ba51 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, stylesheet, IS_OBJECT, 0)
66
ZEND_END_ARG_INFO()
77

88
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_transformToDoc, 0, 0, 1)
99
ZEND_ARG_TYPE_INFO(0, document, IS_OBJECT, 0)
10-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return_class, IS_STRING, 1, "null")
10+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, returnClass, IS_STRING, 1, "null")
1111
ZEND_END_ARG_INFO()
1212

1313
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_transformToUri, 0, 0, 2)
@@ -36,15 +36,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_hasExsltSupport, 0, 0, 0)
3636
ZEND_END_ARG_INFO()
3737

3838
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_registerPHPFunctions, 0, 0, 0)
39-
ZEND_ARG_TYPE_MASK(0, restrict, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
39+
ZEND_ARG_TYPE_MASK(0, functions, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null")
4040
ZEND_END_ARG_INFO()
4141

4242
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setProfiling, 0, 0, 1)
4343
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 1)
4444
ZEND_END_ARG_INFO()
4545

4646
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setSecurityPrefs, 0, 0, 1)
47-
ZEND_ARG_TYPE_INFO(0, securityPrefs, IS_LONG, 0)
47+
ZEND_ARG_TYPE_INFO(0, preferences, IS_LONG, 0)
4848
ZEND_END_ARG_INFO()
4949

5050
#define arginfo_class_XSLTProcessor_getSecurityPrefs arginfo_class_XSLTProcessor_hasExsltSupport

0 commit comments

Comments
 (0)