Skip to content

Commit 24d9527

Browse files
committed
SimpleXMLElement::addAttribute() is a void function
Closes GH-7033.
1 parent dcdac65 commit 24d9527

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ext/simplexml/simplexml.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function __construct(string $data, int $options = 0, bool $dataIsURL = fa
4242
/** @return SimpleXMLElement|null */
4343
public function addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null) {}
4444

45-
/** @return SimpleXMLElement|null */
46-
public function addAttribute(string $qualifiedName, ?string $value = null, ?string $namespace = null) {}
45+
/** @return void */
46+
public function addAttribute(string $qualifiedName, string $value, ?string $namespace = null) {}
4747

4848
/** @return string */
4949
public function getName() {}

ext/simplexml/simplexml_arginfo.h

Lines changed: 6 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: 9d5e78ef2ea4e8bda025f9a9e7f0e07d2e9db702 */
2+
* Stub hash: 03981bac1d9aef20ccf0adf36f75496c3da8e605 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_simplexml_load_file, 0, 1, SimpleXMLElement, MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -67,7 +67,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_addChild, 0, 0, 1)
6767
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, namespace, IS_STRING, 1, "null")
6868
ZEND_END_ARG_INFO()
6969

70-
#define arginfo_class_SimpleXMLElement_addAttribute arginfo_class_SimpleXMLElement_addChild
70+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_addAttribute, 0, 0, 2)
71+
ZEND_ARG_TYPE_INFO(0, qualifiedName, IS_STRING, 0)
72+
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
73+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, namespace, IS_STRING, 1, "null")
74+
ZEND_END_ARG_INFO()
7175

7276
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleXMLElement_getName, 0, 0, 0)
7377
ZEND_END_ARG_INFO()

0 commit comments

Comments
 (0)