From e088836bbc755a2bb1d827d4de6206222b0ca792 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 12 Apr 2020 00:25:33 +0200 Subject: [PATCH] Fix nullable types in PHPDoc --- ext/dom/document.stub.php | 2 +- ext/dom/namednodemap.stub.php | 6 +++--- ext/dom/node.stub.php | 6 +++--- ext/dom/nodelist.stub.php | 2 +- ext/fileinfo/fileinfo.stub.php | 8 +++---- ext/intl/locale/locale.stub.php | 16 +++++++------- ext/intl/timezone/timezone.stub.php | 4 ++-- ext/ldap/ldap.stub.php | 2 +- ext/phar/phar_object.stub.php | 20 ++++++++--------- ext/reflection/php_reflection.stub.php | 30 +++++++++++++------------- ext/simplexml/sxe.stub.php | 4 ++-- ext/soap/soap.stub.php | 12 +++++------ ext/xmlreader/xmlreader.stub.php | 2 +- 13 files changed, 57 insertions(+), 57 deletions(-) diff --git a/ext/dom/document.stub.php b/ext/dom/document.stub.php index 02c10c5f7a..fefb46f450 100644 --- a/ext/dom/document.stub.php +++ b/ext/dom/document.stub.php @@ -34,7 +34,7 @@ class DOMDocument implements DOMParentNode /** @return DOMText|false */ public function createTextNode(string $data) {} - /** @return ?DOMElement */ + /** @return DOMElement|null */ public function getElementById(string $elementId) {} /** @return DOMNodeList */ diff --git a/ext/dom/namednodemap.stub.php b/ext/dom/namednodemap.stub.php index 3884e99519..701960e8a6 100644 --- a/ext/dom/namednodemap.stub.php +++ b/ext/dom/namednodemap.stub.php @@ -2,13 +2,13 @@ class DOMNamedNodeMap { - /** @return ?DOMNode */ + /** @return DOMNode|null */ public function getNamedItem(string $name) {} - /** @return ?DOMNode */ + /** @return DOMNode|null */ public function getNamedItemNS(?string $namespaceURI, string $localName) {} - /** @return ?DOMNode */ + /** @return DOMNode|null */ public function item(int $index) {} /** @return int|false */ diff --git a/ext/dom/node.stub.php b/ext/dom/node.stub.php index 50b79a04d3..b3d461fd37 100644 --- a/ext/dom/node.stub.php +++ b/ext/dom/node.stub.php @@ -31,7 +31,7 @@ class DOMNode /** @return int */ public function getLineNo() {} - /** @return ?string */ + /** @return string|null */ public function getNodePath() {} /** @return bool */ @@ -52,10 +52,10 @@ class DOMNode /** @return bool */ public function isSupported(string $feature, string $version) {} - /** @return ?string */ + /** @return string|null */ public function lookupNamespaceUri(?string $prefix) {} - /** @return ?string */ + /** @return string|null */ public function lookupPrefix(string $namespaceURI) {} /** @return void */ diff --git a/ext/dom/nodelist.stub.php b/ext/dom/nodelist.stub.php index e7e2b7cce3..57123427aa 100644 --- a/ext/dom/nodelist.stub.php +++ b/ext/dom/nodelist.stub.php @@ -5,6 +5,6 @@ class DOMNodeList /** @return int|false */ public function count() {} - /** @return ?DOMNode */ + /** @return DOMNode|null */ public function item(int $index) {} } diff --git a/ext/fileinfo/fileinfo.stub.php b/ext/fileinfo/fileinfo.stub.php index 262ff2e4dd..a951e573dc 100644 --- a/ext/fileinfo/fileinfo.stub.php +++ b/ext/fileinfo/fileinfo.stub.php @@ -8,14 +8,14 @@ class finfo public function __construct(int $options = FILEINFO_NONE, string $arg = "") {} /** - * @param ?resource $context + * @param resource|null $context * @return string|false * @alias finfo_file */ public function file(string $file_name, int $options = FILEINFO_NONE, $context = null) {} /** - * @param ?resource $context + * @param resource|null $context * @return string|false * @alias finfo_buffer */ @@ -43,13 +43,13 @@ function finfo_set_flags($finfo, int $options): bool {} /** * @param resource $finfo - * @param ?resource $context + * @param resource|null $context */ function finfo_file($finfo, string $file_name, int $options = FILEINFO_NONE, $context = null): string|false {} /** * @param resource $finfo - * @param ?resource $context + * @param resource|null $context */ function finfo_buffer($finfo, string $string, int $options = FILEINFO_NONE, $context = null): string|false {} diff --git a/ext/intl/locale/locale.stub.php b/ext/intl/locale/locale.stub.php index e739f601ae..093e46f35d 100644 --- a/ext/intl/locale/locale.stub.php +++ b/ext/intl/locale/locale.stub.php @@ -8,13 +8,13 @@ class Locale /** @return bool */ public static function setDefault(string $locale) {} - /** @return ?string */ + /** @return string|null */ public static function getPrimaryLanguage(string $locale) {} - /** @return ?string */ + /** @return string|null */ public static function getScript(string $locale) {} - /** @return ?string */ + /** @return string|null */ public static function getRegion(string $locale) {} /** @return array|false|null */ @@ -38,19 +38,19 @@ class Locale /** @return string|false */ public static function composeLocale(array $subtags) {} - /** @return ?array */ + /** @return array|null */ public static function parseLocale(string $locale) {} - /** @return ?array */ + /** @return array|null */ public static function getAllVariants(string $locale) {} - /** @return ?bool */ + /** @return bool|null */ public static function filterMatches(string $langtag, string $locale, bool $canonicalize = false) {} - /** @return ?string */ + /** @return string|null */ public static function lookup(array $langtag, string $locale, bool $canonicalize = false, ?string $def = null) {} - /** @return ?string */ + /** @return string|null */ public static function canonicalize(string $locale) {} /** @return string|false */ diff --git a/ext/intl/timezone/timezone.stub.php b/ext/intl/timezone/timezone.stub.php index cf473a91f6..fad55faeee 100644 --- a/ext/intl/timezone/timezone.stub.php +++ b/ext/intl/timezone/timezone.stub.php @@ -16,13 +16,13 @@ class IntlTimeZone */ public static function createEnumeration($countryOrRawOffset = null) {} - /** @return ?IntlTimeZone */ + /** @return IntlTimeZone|null */ public static function createTimeZone(string $zoneId) {} /** @return IntlIterator|false */ public static function createTimeZoneIDEnumeration(int $zoneType, ?string $region = null, ?int $rawOffset = null) {} - /** @return ?IntlTimeZone */ + /** @return IntlTimeZone|null */ public static function fromDateTimeZone(DateTimeZone $zone) {} /** @return string|false */ diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index afe6b7e918..413d20fcf0 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -223,7 +223,7 @@ function ldap_rename_ext($link_identifier, string $dn, string $newrdn, string $n /** @param resource $link_identifier */ function ldap_get_option($link_identifier, int $option, &$retval = null): bool {} -/** @param ?resource $link_identifier */ +/** @param resource|null $link_identifier */ function ldap_set_option($link_identifier, int $option, $newval): bool {} /** diff --git a/ext/phar/phar_object.stub.php b/ext/phar/phar_object.stub.php index af7d57cabc..80a9128f11 100644 --- a/ext/phar/phar_object.stub.php +++ b/ext/phar/phar_object.stub.php @@ -27,16 +27,16 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess /** @return bool */ public function decompressFiles() {} - /** @return ?Phar */ + /** @return Phar|null */ public function compress(int $compression_type, string $file_ext = UNKNOWN) {} - /** @return ?Phar */ + /** @return Phar|null */ public function decompress(string $file_ext = UNKNOWN) {} - /** @return ?Phar */ + /** @return Phar|null */ public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {} - /** @return ?Phar */ + /** @return Phar|null */ public function convertToData(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {} /** @return bool */ @@ -54,7 +54,7 @@ class Phar extends RecursiveDirectoryIterator implements Countable, ArrayAccess /** @return bool */ public function extractTo(string $pathto, $files = null, bool $overwrite = false) {} - /** @return ?string */ + /** @return string|null */ public function getAlias() {} /** @return string */ @@ -204,16 +204,16 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc /** @return bool */ public function decompressFiles() {} - /** @return ?Phar */ + /** @return Phar|null */ public function compress(int $compression_type, string $file_ext = UNKNOWN) {} - /** @return ?Phar */ + /** @return Phar|null */ public function decompress(string $file_ext = UNKNOWN) {} - /** @return ?Phar */ + /** @return Phar|null */ public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {} - /** @return ?Phar */ + /** @return Phar|null */ public function convertToData(int $format = 9021976, int $compression_type = 9021976, string $file_ext = UNKNOWN) {} /** @return bool */ @@ -231,7 +231,7 @@ class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAcc /** @return bool */ public function extractTo(string $pathto, $files = null, bool $overwrite = false) {} - /** @return ?string */ + /** @return string|null */ public function getAlias() {} /** @return string */ diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 84d2c30779..00c7013f09 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -39,10 +39,10 @@ abstract class ReflectionFunctionAbstract implements Reflector /** @return bool */ public function isVariadic() {} - /** @return ?object */ + /** @return object|null */ public function getClosureThis() {} - /** @return ?ReflectionClass */ + /** @return ReflectionClass|null */ public function getClosureScopeClass() {} /** @return string|false */ @@ -51,7 +51,7 @@ abstract class ReflectionFunctionAbstract implements Reflector /** @return int|false */ public function getEndLine() {} - /** @return ?ReflectionExtension */ + /** @return ReflectionExtension|null */ public function getExtension() {} /** @return string|false */ @@ -90,7 +90,7 @@ abstract class ReflectionFunctionAbstract implements Reflector /** @return bool */ public function hasReturnType() {} - /** @return ?ReflectionType */ + /** @return ReflectionType|null */ public function getReturnType() {} } @@ -130,7 +130,7 @@ class ReflectionGenerator /** @return ReflectionFunctionAbstract */ public function getFunction() {} - /** @return ?object */ + /** @return object|null */ public function getThis() {} /** @return Generator */ @@ -229,7 +229,7 @@ class ReflectionClass implements Reflector /** @return string|false */ public function getDocComment() {} - /** @return ?ReflectionMethod */ + /** @return ReflectionMethod|null */ public function getConstructor() {} /** @return bool */ @@ -253,7 +253,7 @@ class ReflectionClass implements Reflector /** @return bool */ public function hasConstant(string $name) {} - /** @return ?array */ + /** @return array|null */ public function getConstants() {} /** @return ReflectionClassConstant[] */ @@ -316,7 +316,7 @@ class ReflectionClass implements Reflector */ public function isSubclassOf($class) {} - /** @return ?array */ + /** @return array|null */ public function getStaticProperties() {} /** @return mixed */ @@ -340,7 +340,7 @@ class ReflectionClass implements Reflector */ public function implementsInterface($interface) {} - /** @return ?ReflectionExtension */ + /** @return ReflectionExtension|null */ public function getExtension() {} /** @return string|false */ @@ -409,7 +409,7 @@ class ReflectionProperty implements Reflector /** @return void */ public function setAccessible(bool $visible) {} - /** @return ?ReflectionType */ + /** @return ReflectionType|null */ public function getType() {} /** @return bool */ @@ -479,16 +479,16 @@ class ReflectionParameter implements Reflector /** @return ReflectionFunctionAbstract */ public function getDeclaringFunction() {} - /** @return ?ReflectionClass */ + /** @return ReflectionClass|null */ public function getDeclaringClass() {} - /** @return ?ReflectionClass */ + /** @return ReflectionClass|null */ public function getClass() {} /** @return bool */ public function hasType() {} - /** @return ?ReflectionType */ + /** @return ReflectionType|null */ public function getType() {} /** @return bool */ @@ -515,7 +515,7 @@ class ReflectionParameter implements Reflector /** @return bool */ public function isDefaultValueConstant() {} - /** @return ?string */ + /** @return string|null */ public function getDefaultValueConstantName() {} /** @return bool */ @@ -557,7 +557,7 @@ class ReflectionExtension implements Reflector /** @return string */ public function getName() {} - /** @return ?string */ + /** @return string|null */ public function getVersion() {} /** @return ReflectionFunction[] */ diff --git a/ext/simplexml/sxe.stub.php b/ext/simplexml/sxe.stub.php index 98ea3327ba..d609e93846 100644 --- a/ext/simplexml/sxe.stub.php +++ b/ext/simplexml/sxe.stub.php @@ -8,7 +8,7 @@ class SimpleXMLIterator /** @return bool */ public function valid() {} - /** @return ?SimpleXMLElement */ + /** @return SimpleXMLElement|null */ public function current() {} /** @return string|false */ @@ -20,6 +20,6 @@ class SimpleXMLIterator /** @return bool */ public function hasChildren() {} - /** @return ?SimpleXMLIterator */ + /** @return SimpleXMLIterator|null */ public function getChildren() {} } diff --git a/ext/soap/soap.stub.php b/ext/soap/soap.stub.php index 19553b7732..a3ae6e93d3 100644 --- a/ext/soap/soap.stub.php +++ b/ext/soap/soap.stub.php @@ -71,19 +71,19 @@ class SoapClient /** @return array|null */ public function __getTypes(); - /** @return ?string */ + /** @return string|null */ public function __getLastRequest(); - /** @return ?string */ + /** @return string|null */ public function __getLastResponse(); - /** @return ?string */ + /** @return string|null */ public function __getLastRequestHeaders(); - /** @return ?string */ + /** @return string|null */ public function __getLastResponseHeaders(); - /** @return ?string */ + /** @return string|null */ public function __doRequest(string $request, string $location, string $action, int $version, int $one_way = 0); /** @return void */ @@ -95,6 +95,6 @@ class SoapClient /** @return bool */ public function __setSoapHeaders($soapheaders = null); - /** @return ?string */ + /** @return string|null */ public function __setLocation(string $new_location = ""); } diff --git a/ext/xmlreader/xmlreader.stub.php b/ext/xmlreader/xmlreader.stub.php index 5a8a108a9d..5cc08651fa 100644 --- a/ext/xmlreader/xmlreader.stub.php +++ b/ext/xmlreader/xmlreader.stub.php @@ -8,7 +8,7 @@ class XMLReader /** @return string|null|false */ public function getAttribute(string $name) {} - /** @return ?string */ + /** @return string|null */ public function getAttributeNo(int $index) {} /** @return string|null|false */ -- 2.40.0