WI-62004 Deprecations for PHP 8.1

This commit is contained in:
Kirill Smelov 2021-08-11 16:26:16 +03:00
parent ce7b3776d6
commit ff2a7b4219
10 changed files with 32 additions and 13 deletions

View File

@ -1,5 +1,6 @@
<?php
use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware;
use JetBrains\PhpStorm\Pure;
/**
@ -12,7 +13,7 @@ use JetBrains\PhpStorm\Pure;
* a letter or a digit, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_alnum(mixed $text): bool {}
function ctype_alnum(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for alphabetic character(s)
@ -24,7 +25,7 @@ function ctype_alnum(mixed $text): bool {}
* a letter from the current locale, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_alpha(mixed $text): bool {}
function ctype_alpha(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for control character(s)
@ -36,7 +37,7 @@ function ctype_alpha(mixed $text): bool {}
* a control character from the current locale, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_cntrl(mixed $text): bool {}
function ctype_cntrl(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for numeric character(s)
@ -48,7 +49,7 @@ function ctype_cntrl(mixed $text): bool {}
* <i>text</i> is a decimal digit, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_digit(mixed $text): bool {}
function ctype_digit(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for lowercase character(s)
@ -60,7 +61,7 @@ function ctype_digit(mixed $text): bool {}
* a lowercase letter in the current locale.
*/
#[Pure]
function ctype_lower(mixed $text): bool {}
function ctype_lower(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for any printable character(s) except space
@ -73,7 +74,7 @@ function ctype_lower(mixed $text): bool {}
* otherwise.
*/
#[Pure]
function ctype_graph(mixed $text): bool {}
function ctype_graph(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for printable character(s)
@ -87,7 +88,7 @@ function ctype_graph(mixed $text): bool {}
* that do not have any output or control function at all.
*/
#[Pure]
function ctype_print(mixed $text): bool {}
function ctype_print(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for any printable character which is not whitespace or an
@ -100,7 +101,7 @@ function ctype_print(mixed $text): bool {}
* is printable, but neither letter, digit or blank, <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_punct(mixed $text): bool {}
function ctype_punct(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for whitespace character(s)
@ -114,7 +115,7 @@ function ctype_punct(mixed $text): bool {}
* carriage return and form feed characters.
*/
#[Pure]
function ctype_space(mixed $text): bool {}
function ctype_space(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for uppercase character(s)
@ -126,7 +127,7 @@ function ctype_space(mixed $text): bool {}
* an uppercase letter in the current locale.
*/
#[Pure]
function ctype_upper(mixed $text): bool {}
function ctype_upper(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}
/**
* Check for character(s) representing a hexadecimal digit
@ -139,4 +140,4 @@ function ctype_upper(mixed $text): bool {}
* [A-Fa-f] , <b>FALSE</b> otherwise.
*/
#[Pure]
function ctype_xdigit(mixed $text): bool {}
function ctype_xdigit(#[LanguageLevelTypeAware(['8.1' => 'string'], default: 'mixed')] mixed $text): bool {}

View File

@ -785,6 +785,7 @@ function checkdate(int $month, int $day, int $year): bool {}
* local time if no timestamp is given. Month and weekday names and
* other language-dependent strings respect the current locale set
* with setlocale.
* @deprecated 8.1
*/
function strftime(string $format, ?int $timestamp): string|false {}
@ -800,6 +801,7 @@ function strftime(string $format, ?int $timestamp): string|false {}
* local time if no timestamp is given. Month and weekday names and
* other language dependent strings respect the current locale set
* with setlocale.
* @deprecated 8.1
*/
function gmstrftime(string $format, ?int $timestamp): string|false {}
@ -1408,6 +1410,7 @@ function date_default_timezone_get(): string {}
* @param float|null $utcOffset [optional]
* @return string|int|float|false the sunrise time in a specified format on
* success or false on failure.
* @deprecated 8.1
*/
#[Pure]
function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude, ?float $longitude, ?float $zenith, ?float $utcOffset): string|int|float|false {}
@ -1458,6 +1461,7 @@ function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?
* @param float|null $utcOffset [optional]
* @return string|int|float|false the sunset time in a specified format on
* success or false on failure.
* @deprecated 8.1
*/
#[Pure]
function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude, ?float $longitude, ?float $zenith, ?float $utcOffset): string|int|float|false {}

View File

@ -336,6 +336,7 @@ define('FILTER_UNSAFE_RAW', 516);
/**
* ID of "string" filter.
* @link https://php.net/manual/en/filter.constants.php
* @deprecated 8.1
*/
define('FILTER_SANITIZE_STRING', 513);

View File

@ -1144,7 +1144,7 @@ function imagefill(GdImage $image, int $x, int $y, int $color): bool {}
* </p>
* @return bool true on success or false on failure.
*/
function imagefilledpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
function imagefilledpolygon(GdImage $image, array $points, #[Deprecated(since: "8.1")] int $num_points_or_color, ?int $color = null): bool {}
/**
* Draw a filled rectangle
@ -2224,7 +2224,7 @@ function imagegetclip(GdImage $image): array {}
* @since 7.2
* @see imageplygon()
*/
function imageopenpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
function imageopenpolygon(GdImage $image, array $points, #[Deprecated(since: "8.1")] int $num_points_or_color, ?int $color = null): bool {}
/**
* <b>imagecreatefrombmp()</b> returns an image identifier representing the image obtained from the given filename.

View File

@ -308,6 +308,7 @@ function hash_pbkdf2(string $algo, string $password, string $salt, int $iteratio
* The key length, in bytes.
* </p>
* @return string|false the generated key as a string, or <b>FALSE</b> on error.
* @deprecated 8.1
*/
#[Pure]
function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {}
@ -320,6 +321,7 @@ function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length
* </p>
* @return int|false the size in bytes or <b>FALSE</b>, if the <i>hash</i>
* does not exist.
* @deprecated 8.1
*/
#[Pure]
function mhash_get_block_size(int $algo): int|false {}
@ -331,6 +333,7 @@ function mhash_get_block_size(int $algo): int|false {}
* The hash ID. One of the <b>MHASH_hashname</b> constants.
* </p>
* @return string|false the name of the hash or <b>FALSE</b>, if the hash does not exist.
* @deprecated 8.1
*/
#[Pure]
function mhash_get_hash_name(int $algo): string|false {}
@ -340,6 +343,7 @@ function mhash_get_hash_name(int $algo): string|false {}
* @link https://php.net/manual/en/function.mhash-count.php
* @return int the highest available hash ID. Hashes are numbered from 0 to this
* hash ID.
* @deprecated 8.1
*/
#[Pure]
function mhash_count(): int {}
@ -361,6 +365,7 @@ function mhash_count(): int {}
* </p>
* @return string|false the resulting hash (also called digest) or HMAC as a string, or
* <b>FALSE</b> on error.
* @deprecated 8.1
*/
#[Pure]
function mhash(int $algo, string $data, ?string $key): string|false {}

View File

@ -1541,6 +1541,9 @@ function imap_mutf7_to_utf8(string $string): string|false {}
*/
function imap_utf8_to_mutf7(string $string): string|false {}
/**
* @deprecated 8.1
*/
define('NIL', 0);
define('IMAP_OPENTIMEOUT', 1);
define('IMAP_READTIMEOUT', 2);

View File

@ -347,6 +347,7 @@ class mysqli
* Initializes MySQLi and returns a resource for use with mysqli_real_connect()
* @link https://php.net/manual/en/mysqli.init.php
* @return mysqli an object.
* @deprecated 8.1
*/
public function init() {}

View File

@ -516,6 +516,7 @@ function odbc_result($result_id, $field) {}
* Additional overall table formatting.
* </p>
* @return int|false the number of rows in the result or <b>FALSE</b> on error.
* @deprecated 8.1
*/
function odbc_result_all($result_id, $format = null) {}

View File

@ -264,6 +264,7 @@ function time_sleep_until(float $timestamp): bool {}
* </tr>
* </table>
* </p>
* @deprecated 8.1
*/
#[Pure]
function strptime(string $timestamp, string $format): array|false {}

View File

@ -618,6 +618,7 @@ define('FILE_NO_DEFAULT_CONTEXT', 16);
* </p>
* @since 5.2.7
* @link https://php.net/manual/en/filesystem.constants.php
* @deprecated 8.1
*/
define('FILE_TEXT', 0);
@ -628,6 +629,7 @@ define('FILE_TEXT', 0);
* </p>
* @since 5.2.7
* @link https://php.net/manual/en/filesystem.constants.php
* @deprecated 8.1
*/
define('FILE_BINARY', 0);