Declare tentative return types for ext/xmlreader

Relates to GH-6995
This commit is contained in:
Máté Kocsis committed 2021-05-25 19:14:48 +02:00
1 parent 940f599be9
commit a902622ad6
2 files changed
+78 -69

No files matched your search

+47 -47
View File
@@ -33,77 +33,77 @@ class XMLReader
public string $xmlLang;
/** @return bool */
public function close() {}
public function close() {} // TODO make the return type void
/** @return string|null */
public function getAttribute(string $name) {}
/** @tentative-return-type */
public function getAttribute(string $name): ?string {}
/** @return string|null */
public function getAttributeNo(int $index) {}
/** @tentative-return-type */
public function getAttributeNo(int $index): ?string {}
/** @return string|null */
public function getAttributeNs(string $name, string $namespace) {}
/** @tentative-return-type */
public function getAttributeNs(string $name, string $namespace): ?string {}
/** @return bool */
public function getParserProperty(int $property) {}
/** @tentative-return-type */
public function getParserProperty(int $property): bool {}
/** @return bool */
public function isValid() {}
/** @tentative-return-type */
public function isValid(): bool {}
/** @return string|null */
public function lookupNamespace(string $prefix) {}
/** @tentative-return-type */
public function lookupNamespace(string $prefix): ?string {}
/** @return bool */
public function moveToAttribute(string $name) {}
/** @tentative-return-type */
public function moveToAttribute(string $name): bool {}
/** @return bool */
public function moveToAttributeNo(int $index) {}
/** @tentative-return-type */
public function moveToAttributeNo(int $index): bool {}
/** @return bool */
public function moveToAttributeNs(string $name, string $namespace) {}
/** @tentative-return-type */
public function moveToAttributeNs(string $name, string $namespace): bool {}
/** @return bool */
public function moveToElement() {}
/** @tentative-return-type */
public function moveToElement(): bool {}
/** @return bool */
public function moveToFirstAttribute() {}
/** @tentative-return-type */
public function moveToFirstAttribute(): bool {}
/** @return bool */
public function moveToNextAttribute() {}
/** @tentative-return-type */
public function moveToNextAttribute(): bool {}
/** @return bool */
public function read() {}
/** @tentative-return-type */
public function read(): bool {}
/** @return bool */
public function next(?string $name = null) {}
/** @tentative-return-type */
public function next(?string $name = null): bool {}
/** @return bool|XMLReader */
public static function open(string $uri, ?string $encoding = null, int $flags = 0) {}
public static function open(string $uri, ?string $encoding = null, int $flags = 0) {} // TODO Return type shouldn't be dependent on the call scope
/** @return string */
public function readInnerXml() {}
/** @tentative-return-type */
public function readInnerXml(): string {}
/** @return string */
public function readOuterXml() {}
/** @tentative-return-type */
public function readOuterXml(): string {}
/** @return string */
public function readString() {}
/** @tentative-return-type */
public function readString(): string {}
/** @return bool */
public function setSchema(?string $filename) {}
/** @tentative-return-type */
public function setSchema(?string $filename): bool {}
/** @return bool */
public function setParserProperty(int $property, bool $value) {}
/** @tentative-return-type */
public function setParserProperty(int $property, bool $value): bool {}
/** @return bool */
public function setRelaxNGSchema(?string $filename) {}
/** @tentative-return-type */
public function setRelaxNGSchema(?string $filename): bool {}
/** @return bool */
public function setRelaxNGSchemaSource(?string $source) {}
/** @tentative-return-type */
public function setRelaxNGSchemaSource(?string $source): bool {}
/** @return bool|XMLReader */
public static function XML(string $source, ?string $encoding = null, int $flags = 0) {}
public static function XML(string $source, ?string $encoding = null, int $flags = 0) {} // TODO Return type shouldn't be dependent on the call scope
/** @return DOMNode|false */
public function expand(?DOMNode $baseNode = null) {}
/** @tentative-return-type */
public function expand(?DOMNode $baseNode = null): DOMNode|false {}
}
+31 -22
View File
@@ -1,47 +1,55 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 49adb3008ade3f92f9b764ead9366efc6681e46f */
* Stub hash: 1601e86ad66e337a6af7d09ec7ba703926bdb8c7 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_close, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttribute, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getAttribute, 0, 1, IS_STRING, 1)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttributeNo, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getAttributeNo, 0, 1, IS_STRING, 1)
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_getAttributeNs, 0, 0, 2)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getAttributeNs, 0, 2, IS_STRING, 1)
ZEND_ARG_TYPE_INFO(0, name, 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)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_getParserProperty, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_isValid arginfo_class_XMLReader_close
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_isValid, 0, 0, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_lookupNamespace, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_lookupNamespace, 0, 1, IS_STRING, 1)
ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_moveToAttribute arginfo_class_XMLReader_getAttribute
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_moveToAttribute, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_moveToAttributeNo arginfo_class_XMLReader_getAttributeNo
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_moveToAttributeNo, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_moveToAttributeNs arginfo_class_XMLReader_getAttributeNs
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_moveToAttributeNs, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_moveToElement arginfo_class_XMLReader_close
#define arginfo_class_XMLReader_moveToElement arginfo_class_XMLReader_isValid
#define arginfo_class_XMLReader_moveToFirstAttribute arginfo_class_XMLReader_close
#define arginfo_class_XMLReader_moveToFirstAttribute arginfo_class_XMLReader_isValid
#define arginfo_class_XMLReader_moveToNextAttribute arginfo_class_XMLReader_close
#define arginfo_class_XMLReader_moveToNextAttribute arginfo_class_XMLReader_isValid
#define arginfo_class_XMLReader_read arginfo_class_XMLReader_close
#define arginfo_class_XMLReader_read arginfo_class_XMLReader_isValid
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_next, 0, 0, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_next, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
@@ -51,24 +59,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_open, 0, 0, 1)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_readInnerXml arginfo_class_XMLReader_close
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_readInnerXml, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_readOuterXml arginfo_class_XMLReader_close
#define arginfo_class_XMLReader_readOuterXml arginfo_class_XMLReader_readInnerXml
#define arginfo_class_XMLReader_readString arginfo_class_XMLReader_close
#define arginfo_class_XMLReader_readString arginfo_class_XMLReader_readInnerXml
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_setSchema, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_setSchema, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_setParserProperty, 0, 0, 2)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_setParserProperty, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, property, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
#define arginfo_class_XMLReader_setRelaxNGSchema arginfo_class_XMLReader_setSchema
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_setRelaxNGSchemaSource, 0, 0, 1)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_XMLReader_setRelaxNGSchemaSource, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 1)
ZEND_END_ARG_INFO()
@@ -78,7 +87,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_XML, 0, 0, 1)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_expand, 0, 0, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_XMLReader_expand, 0, 0, DOMNode, MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, baseNode, DOMNode, 1, "null")
ZEND_END_ARG_INFO()