From 016afa5d6494a18a95822437ab529e57088a07eb Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Wed, 31 Mar 2021 19:54:32 +0300 Subject: [PATCH] WI-59548 mark stubs functions as mayDependOnGlobalScope --- Core/Core.php | 8 ++++---- curl/curl.php | 10 +++++----- date/date.php | 2 +- gmp/gmp.php | 6 +++--- intl/intl.php | 36 ++++++++++++++++++------------------ libxml/libxml.php | 4 ++-- pcntl/pcntl.php | 4 ++-- pcre/pcre.php | 4 ++-- posix/posix.php | 6 +++--- 9 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Core/Core.php b/Core/Core.php index a0952ad3..84d0319e 100755 --- a/Core/Core.php +++ b/Core/Core.php @@ -500,7 +500,7 @@ function class_alias(string $class, string $alias, bool $autoload = true): bool * the returned array. *

*/ -#[Pure] +#[Pure(true)] function get_included_files(): array {} /** @@ -508,7 +508,7 @@ function get_included_files(): array {} * @link https://php.net/manual/en/function.get-required-files.php * @return string[] */ -#[Pure] +#[Pure(true)] function get_required_files(): array {} /** @@ -694,7 +694,7 @@ function restore_exception_handler(): bool {} * the appendices. *

*/ -#[Pure] +#[Pure(true)] function get_declared_classes(): array {} /** @@ -881,7 +881,7 @@ function get_extension_funcs(string $extension): array|false {} *

* @return array */ -#[Pure] +#[Pure(true)] function get_defined_constants(bool $categorize = false): array {} /** diff --git a/curl/curl.php b/curl/curl.php index 7849b7ac..ea0dfb52 100644 --- a/curl/curl.php +++ b/curl/curl.php @@ -2295,7 +2295,7 @@ function curl_exec(#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "r * "starttransfer_time" * "redirect_time" */ -#[Pure] +#[Pure(true)] function curl_getinfo(#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle, ?int $option): mixed {} /** @@ -2305,7 +2305,7 @@ function curl_getinfo(#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: * @return string the error message or '' (the empty string) if no * error occurred. */ -#[Pure] +#[Pure(true)] function curl_error(#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle): string {} /** @@ -2315,7 +2315,7 @@ function curl_error(#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: " * @return int the error number or 0 (zero) if no error * occurred. */ -#[Pure] +#[Pure(true)] function curl_errno(#[LanguageLevelTypeAware(["8.0" => "CurlHandle"], default: "resource")] $handle): int {} /** @@ -2532,7 +2532,7 @@ function curl_multi_close(#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], * @return int * @since 7.1 */ -#[Pure] +#[Pure(true)] function curl_multi_errno(#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], default: "resource")] $multi_handle): int {} /** @@ -2541,7 +2541,7 @@ function curl_multi_errno(#[LanguageLevelTypeAware(["8.0" => "CurlMultiHandle"], * @return int * @since 7.1 */ -#[Pure] +#[Pure(true)] function curl_share_errno(#[LanguageLevelTypeAware(["8.0" => "CurlShareHandle"], default: "resource")] $share_handle): int {} /** diff --git a/date/date.php b/date/date.php index 73804607..88f5139a 100644 --- a/date/date.php +++ b/date/date.php @@ -989,7 +989,7 @@ function date_parse_from_format(string $format, string $datetime): array {} "error_count" => "int", "errors" => "string[]", ])] -#[Pure] +#[Pure(true)] function date_get_last_errors(): array|false {} /** diff --git a/gmp/gmp.php b/gmp/gmp.php index ce0aa96c..a5b358a3 100644 --- a/gmp/gmp.php +++ b/gmp/gmp.php @@ -391,7 +391,7 @@ function gmp_prob_prime(GMP|string|int $num, int $repetitions = 10): int {} * or a numeric string provided that it is possible to convert the latter to a number.

* @return GMP A random GMP number. */ -#[Pure] +#[Pure(true)] function gmp_random_bits(int $bits): GMP {} /** @@ -401,7 +401,7 @@ function gmp_random_bits(int $bits): GMP {} * @param GMP|string|int $max

A GMP number representing the upper bound for the random number

* @return GMP A random GMP number. */ -#[Pure] +#[Pure(true)] function gmp_random_range(GMP|string|int $min, GMP|string|int $max): GMP {} /** @@ -511,7 +511,7 @@ function gmp_sign(GMP|string|int $num): int {} * @removed 8.0 */ #[Deprecated(reason: "Use see gmp_random_bits() or see gmp_random_range() instead", since: "7.2")] -#[Pure] +#[Pure(true)] function gmp_random($limiter = 20) {} /** diff --git a/intl/intl.php b/intl/intl.php index 953b346e..d7eed4e0 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -3558,7 +3558,7 @@ function collator_get_locale(Collator $object, int $type = null): string|false { * @param Collator $object * @return int|false Error code returned by the last Collator API function call. */ -#[Pure] +#[Pure(true)] function collator_get_error_code(Collator $object): int|false {} /** @@ -3821,7 +3821,7 @@ function numfmt_get_locale(NumberFormatter $formatter, int $type = null): string * @param NumberFormatter $formatter * @return int error code from last formatter call. */ -#[Pure] +#[Pure(true)] function numfmt_get_error_code(NumberFormatter $formatter): int {} /** @@ -3831,7 +3831,7 @@ function numfmt_get_error_code(NumberFormatter $formatter): int {} * @param NumberFormatter $formatter * @return string error message from last formatter call. */ -#[Pure] +#[Pure(true)] function numfmt_get_error_message(NumberFormatter $formatter): string {} /** @@ -4242,7 +4242,7 @@ function msgfmt_get_locale(MessageFormatter $formatter): string {} * @param MessageFormatter $formatter * @return int The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. */ -#[Pure] +#[Pure(true)] function msgfmt_get_error_code(MessageFormatter $formatter): int {} /** @@ -4252,7 +4252,7 @@ function msgfmt_get_error_code(MessageFormatter $formatter): int {} * @param MessageFormatter $formatter * @return string Description of the last error. */ -#[Pure] +#[Pure(true)] function msgfmt_get_error_message(MessageFormatter $formatter): string {} /** @@ -4568,7 +4568,7 @@ function datefmt_localtime(IntlDateFormatter $formatter, string $string, &$offse * @param IntlDateFormatter $formatter * @return int The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. */ -#[Pure] +#[Pure(true)] function datefmt_get_error_code(IntlDateFormatter $formatter): int {} /** @@ -4578,7 +4578,7 @@ function datefmt_get_error_code(IntlDateFormatter $formatter): int {} * @param IntlDateFormatter $formatter * @return string Description of the last error. */ -#[Pure] +#[Pure(true)] function datefmt_get_error_message(IntlDateFormatter $formatter): string {} /** @@ -4913,7 +4913,7 @@ function intlcal_get_keyword_values_for_locale(string $keyword, string $locale, * @return float A float representing a number of milliseconds since the epoch, not counting leap seconds. * @since 5.5 */ -#[Pure] +#[Pure(true)] function intlcal_get_now(): float {} /** @@ -5729,7 +5729,7 @@ function intlcal_to_date_time(IntlCalendar $calendar): DateTime|false {} * @return int|false An ICU error code indicating either success, failure or a warning. * @since 5.5 */ -#[Pure] +#[Pure(true)] function intlcal_get_error_code(IntlCalendar $calendar): int|false {} /** @@ -5742,7 +5742,7 @@ function intlcal_get_error_code(IntlCalendar $calendar): int|false {} * @return string|false The error message associated with last error that occurred in a function call on this object, or a string indicating the non-existance of an error. * @since 5.5 */ -#[Pure] +#[Pure(true)] function intlcal_get_error_message(IntlCalendar $calendar): string|false {} /** @@ -5858,7 +5858,7 @@ function intltz_get_equivalent_id(string $timezoneId, int $offset): string|false * @return int|false * @since 5.5 */ -#[Pure] +#[Pure(true)] function intltz_get_error_code(IntlTimeZone $timezone): int|false {} /** @@ -5871,7 +5871,7 @@ function intltz_get_error_code(IntlTimeZone $timezone): int|false {} * @return string|false * @since 5.5 */ -#[Pure] +#[Pure(true)] function intltz_get_error_message(IntlTimeZone $timezone): string|false {} /** @@ -6063,7 +6063,7 @@ function resourcebundle_locales(string $bundle): array|false {} * @param $bundle * @return int error code from last bundle object call. */ -#[Pure] +#[Pure(true)] function resourcebundle_get_error_code(ResourceBundle $bundle): int {} /** @@ -6073,7 +6073,7 @@ function resourcebundle_get_error_code(ResourceBundle $bundle): int {} * @param $bundle * @return string error message from last bundle object's call. */ -#[Pure] +#[Pure(true)] function resourcebundle_get_error_message(ResourceBundle $bundle): string {} /** @@ -6172,7 +6172,7 @@ function transliterator_transliterate(Transliterator|string $transliterator, str * or FALSE if none exists, or on failure. * @since 5.4 */ -#[Pure] +#[Pure(true)] function transliterator_get_error_code(Transliterator $transliterator): int|false {} /** @@ -6184,7 +6184,7 @@ function transliterator_get_error_code(Transliterator $transliterator): int|fals * or FALSE if none exists, or on failure. * @since 5.4 */ -#[Pure] +#[Pure(true)] function transliterator_get_error_message(Transliterator $transliterator): string|false {} /** @@ -6193,7 +6193,7 @@ function transliterator_get_error_message(Transliterator $transliterator): strin * @link https://php.net/manual/en/function.intl-get-error-code.php * @return int Error code returned by the last API function call. */ -#[Pure] +#[Pure(true)] function intl_get_error_code(): int {} /** @@ -6202,7 +6202,7 @@ function intl_get_error_code(): int {} * @link https://php.net/manual/en/function.intl-get-error-message.php * @return string Description of an error occurred in the last API function call. */ -#[Pure] +#[Pure(true)] function intl_get_error_message(): string {} /** diff --git a/libxml/libxml.php b/libxml/libxml.php index b1bb0c41..6a10a82f 100644 --- a/libxml/libxml.php +++ b/libxml/libxml.php @@ -90,7 +90,7 @@ function libxml_use_internal_errors(?bool $use_errors = false): bool {} * @return LibXMLError|false a LibXMLError object if there is any error in the * buffer, FALSE otherwise. */ -#[Pure] +#[Pure(true)] function libxml_get_last_error(): LibXMLError|false {} /** @@ -106,7 +106,7 @@ function libxml_clear_errors(): void {} * @return LibXMLError[] an array with LibXMLError objects if there are any * errors in the buffer, or an empty array otherwise. */ -#[Pure] +#[Pure(true)] function libxml_get_errors(): array {} /** diff --git a/pcntl/pcntl.php b/pcntl/pcntl.php index 9b38a205..5af81462 100644 --- a/pcntl/pcntl.php +++ b/pcntl/pcntl.php @@ -297,7 +297,7 @@ function pcntl_alarm(int $seconds): int {} * @return int error code. * @since 5.3.4 */ -#[Pure] +#[Pure(true)] function pcntl_get_last_error(): int {} /** @@ -306,7 +306,7 @@ function pcntl_get_last_error(): int {} * @return int error code. * @since 5.3.4 */ -#[Pure] +#[Pure(true)] function pcntl_errno(): int {} /** diff --git a/pcre/pcre.php b/pcre/pcre.php index ff557aed..26a7d57a 100644 --- a/pcre/pcre.php +++ b/pcre/pcre.php @@ -483,7 +483,7 @@ function preg_grep(string $pattern, array $array, int $flags = 0): array|false { * PREG_BAD_UTF8_ERROR * PREG_BAD_UTF8_OFFSET_ERROR (since PHP 5.3.0) */ -#[Pure] +#[Pure(true)] function preg_last_error(): int {} /** @@ -492,7 +492,7 @@ function preg_last_error(): int {} * @return string one of the error messages or "No error" if there is no error. * @since 8.0 */ -#[Pure] +#[Pure(true)] function preg_last_error_msg(): string {} /** diff --git a/posix/posix.php b/posix/posix.php index 3b14217f..93733247 100644 --- a/posix/posix.php +++ b/posix/posix.php @@ -268,7 +268,7 @@ function posix_isatty($file_descriptor): bool {} * On error, returns FALSE and sets errno which can be checked with * posix_get_last_error. */ -#[Pure] +#[Pure(true)] function posix_getcwd(): string|false {} /** @@ -674,14 +674,14 @@ function posix_getrlimit(): array|false {} * @return int the errno (error number) set by the last posix function that * failed. If no errors exist, 0 is returned. */ -#[Pure] +#[Pure(true)] function posix_get_last_error(): int {} /** * Alias of posix_get_last_error * @link https://php.net/manual/en/function.posix-errno.php */ -#[Pure] +#[Pure(true)] function posix_errno(): int {} /**