From 18ea6c7bf3c0c598b96af1009711cb497b7b5ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 18 May 2021 09:57:40 +0200 Subject: [PATCH 1/3] Fix some nullable return types in ext/simplexml --- ext/simplexml/simplexml.stub.php | 10 +++++----- ext/simplexml/simplexml_arginfo.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/simplexml/simplexml.stub.php b/ext/simplexml/simplexml.stub.php index 0363c62d3fdca..484575b1db63d 100644 --- a/ext/simplexml/simplexml.stub.php +++ b/ext/simplexml/simplexml.stub.php @@ -10,7 +10,7 @@ function simplexml_import_dom(SimpleXMLElement|DOMNode $node, ?string $class_nam class SimpleXMLElement implements Stringable, Countable, RecursiveIterator { - /** @return array|false */ + /** @return array|null|false */ public function xpath(string $expression) {} /** @return bool */ @@ -31,18 +31,18 @@ public function getNamespaces(bool $recursive = false) {} /** @return array|false */ public function getDocNamespaces(bool $recursive = false, bool $fromRoot = true) {} - /** @return SimpleXMLIterator */ + /** @return SimpleXMLIterator|null */ public function children(?string $namespaceOrPrefix = null, bool $isPrefix = false) {} - /** @return SimpleXMLIterator */ + /** @return SimpleXMLIterator|null */ public function attributes(?string $namespaceOrPrefix = null, bool $isPrefix = false) {} public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = "", bool $isPrefix = false) {} - /** @return SimpleXMLElement */ + /** @return SimpleXMLElement|null */ public function addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null) {} - /** @return SimpleXMLElement */ + /** @return SimpleXMLElement|null */ public function addAttribute(string $qualifiedName, ?string $value = null, ?string $namespace = null) {} /** @return string */ diff --git a/ext/simplexml/simplexml_arginfo.h b/ext/simplexml/simplexml_arginfo.h index 72f1dc9a32a8c..ad768b1fd5e80 100644 --- a/ext/simplexml/simplexml_arginfo.h +++ b/ext/simplexml/simplexml_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 70ace711365bb5e7df3174d4cfe68fb3df34a105 */ + * Stub hash: adea3b4fd9ef87a00d0379f2772b98e96cc0e461 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_simplexml_load_file, 0, 1, SimpleXMLElement, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) From 4b63ea6ecdb968ba4e804c0feec653d7eebb454c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 18 May 2021 12:10:02 +0200 Subject: [PATCH 2/3] Additional fixes --- ext/simplexml/simplexml.stub.php | 6 +++--- ext/simplexml/simplexml_arginfo.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/simplexml/simplexml.stub.php b/ext/simplexml/simplexml.stub.php index 484575b1db63d..7ad09c32d7f38 100644 --- a/ext/simplexml/simplexml.stub.php +++ b/ext/simplexml/simplexml.stub.php @@ -31,10 +31,10 @@ public function getNamespaces(bool $recursive = false) {} /** @return array|false */ public function getDocNamespaces(bool $recursive = false, bool $fromRoot = true) {} - /** @return SimpleXMLIterator|null */ + /** @return SimpleXMLElement|null */ public function children(?string $namespaceOrPrefix = null, bool $isPrefix = false) {} - /** @return SimpleXMLIterator|null */ + /** @return SimpleXMLElement|null */ public function attributes(?string $namespaceOrPrefix = null, bool $isPrefix = false) {} public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = "", bool $isPrefix = false) {} @@ -71,7 +71,7 @@ public function next() {} /** @return bool */ public function hasChildren() {} - /** @return SimpleXMLElement|null */ + /** @return SimpleXMLIterator|null */ public function getChildren() {} } diff --git a/ext/simplexml/simplexml_arginfo.h b/ext/simplexml/simplexml_arginfo.h index ad768b1fd5e80..8b10026b0822a 100644 --- a/ext/simplexml/simplexml_arginfo.h +++ b/ext/simplexml/simplexml_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: adea3b4fd9ef87a00d0379f2772b98e96cc0e461 */ + * Stub hash: 4dc340282918e7920a2fc7c02da81193999f8509 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_simplexml_load_file, 0, 1, SimpleXMLElement, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) From dc9c9cc7a9514a651b86072b51b699fee29c8558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 18 May 2021 13:14:53 +0200 Subject: [PATCH 3/3] Fix SimpleXMLElement::getChildren() --- ext/simplexml/simplexml.stub.php | 2 +- ext/simplexml/simplexml_arginfo.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/simplexml/simplexml.stub.php b/ext/simplexml/simplexml.stub.php index 7ad09c32d7f38..d71e7c010c5ab 100644 --- a/ext/simplexml/simplexml.stub.php +++ b/ext/simplexml/simplexml.stub.php @@ -71,7 +71,7 @@ public function next() {} /** @return bool */ public function hasChildren() {} - /** @return SimpleXMLIterator|null */ + /** @return SimpleXMLElement|null */ public function getChildren() {} } diff --git a/ext/simplexml/simplexml_arginfo.h b/ext/simplexml/simplexml_arginfo.h index 8b10026b0822a..972dc4749a909 100644 --- a/ext/simplexml/simplexml_arginfo.h +++ b/ext/simplexml/simplexml_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4dc340282918e7920a2fc7c02da81193999f8509 */ + * Stub hash: 9d5e78ef2ea4e8bda025f9a9e7f0e07d2e9db702 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_simplexml_load_file, 0, 1, SimpleXMLElement, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)