From bba4b6c8f97cd94a74e4aa879f6efdd48a9e9302 Mon Sep 17 00:00:00 2001 From: Steven Lehn Date: Wed, 9 Mar 2022 16:38:08 -0600 Subject: [PATCH 001/419] Update doc comment on pdflib::fit_table based on pdflib documentation. Replace broken link to php.net with link to pdflib documentation. --- pdflib/PDFlib.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pdflib/PDFlib.php b/pdflib/PDFlib.php index 2923d29de..c61d1c2be 100644 --- a/pdflib/PDFlib.php +++ b/pdflib/PDFlib.php @@ -781,16 +781,16 @@ public function fit_image($image, $x, $y, $optlist) {} public function fit_pdi_page($page, $x, $y, $optlist) {} /** - * @param int $table - * @param float $llx - * @param float $lly - * @param float $urx - * @param float $ury - * @param string $optlist - * - * @return string - * - * @link https://secure.php.net/manual/en/function.pdf-fit-table.php + * @param int $table A valid table handle retrieved with a call to PDF_add_table_cell() + * @param float $llx X Coordinate of the lower left corner of the target rectangle for the table instance (the fitbox) in user coordinates. + * @param float $lly Y Coordinate of the lower left corner of the target rectangle for the table instance (the fitbox) in user coordinates. + * @param float $urx X Coordinate of the upper right corner of the target rectangle for the table instance (the fitbox) in user coordinates. + * @param float $ury Y Coordinate of the upper right corner of the target rectangle for the table instance (the fitbox) in user coordinates. + * @param string $optlist An option list specifying filling details according to Table 5.18. + * + * @return string A string which specifies the reason for returning from the function + * + * @link https://www.pdflib.com/fileadmin/pdflib/pdf/manuals/PDFlib-9.3.0-API-reference.pdf */ public function fit_table($table, $llx, $lly, $urx, $ury, $optlist) {} From 71e32425a5a23bb4035d019d6e87de337649e188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Wed, 2 Mar 2022 21:20:18 +0100 Subject: [PATCH 002/419] Adding Redis retry & backoff constants and params Retry and backoff options described https://github.com/phpredis/phpredis/#retry-and-backoff The underscore param name version from https://github.com/phpredis/phpredis/#connect-open --- redis/Redis.php | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index ca367e32d..d548a0c53 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -25,6 +25,10 @@ class Redis public const OPT_COMPRESSION = 7; public const OPT_REPLY_LITERAL = 8; public const OPT_COMPRESSION_LEVEL = 9; + public const OPT_MAX_RETRIES = 11; + public const OPT_BACKOFF_ALGORITHM = 12; + public const OPT_BACKOFF_BASE = 13; + public const OPT_BACKOFF_CAP = 14; /** * Cluster options @@ -92,6 +96,18 @@ class Redis public const REDIS_HASH = 5; public const REDIS_STREAM = 6; + /** + * Backoff algorithms + * @since 5.3.5 + */ + public const BACKOFF_ALGORITHM_DEFAULT = 0; + public const BACKOFF_ALGORITHM_DECORRELATED_JITTER = 1; + public const BACKOFF_ALGORITHM_FULL_JITTER = 2; + public const BACKOFF_ALGORITHM_EQUAL_JITTER = 3; + public const BACKOFF_ALGORITHM_EXPONENTIAL = 4; + public const BACKOFF_ALGORITHM_UNIFORM = 5; + public const BACKOFF_ALGORITHM_CONSTANT = 6; + /** * Creates a Redis client * @@ -102,12 +118,12 @@ public function __construct() {} /** * Connects to a Redis instance. * - * @param string $host can be a host, or the path to a unix domain socket - * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) - * @param null $reserved should be null if $retryInterval is specified - * @param int $retryInterval retry interval in milliseconds. - * @param float $readTimeout value in seconds (optional, default is 0 meaning unlimited) + * @param string $host can be a host, or the path to a unix domain socket + * @param int $port optional + * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) + * @param null $reserved should be null if $retryInterval is specified + * @param int $retry_interval retry interval in milliseconds. + * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) * * @return bool TRUE on success, FALSE on error * @@ -124,8 +140,8 @@ public function connect( $port = 6379, $timeout = 0.0, $reserved = null, - $retryInterval = 0, - $readTimeout = 0.0 + $retry_interval = 0, + $read_timeout = 0.0 ) {} /** From a5301003feda3a8b4f09c397f5f6fd606490e4d2 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:05:21 +0100 Subject: [PATCH 003/419] Remove Swoole SIG- and PRIO- pcntl constants redefinitions. --- swoole/constants.php | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/swoole/constants.php b/swoole/constants.php index 7713ed29a..171feed0c 100644 --- a/swoole/constants.php +++ b/swoole/constants.php @@ -220,41 +220,6 @@ define('SWOOLE_SEM', 4); define('SWOOLE_RWLOCK', 1); define('SWOOLE_SPINLOCK', 5); -define('SIGHUP', 1); -define('SIGINT', 2); -define('SIGQUIT', 3); -define('SIGILL', 4); -define('SIGTRAP', 5); -define('SIGABRT', 6); -define('SIGBUS', 7); -define('SIGFPE', 8); -define('SIGKILL', 9); -define('SIGUSR1', 10); -define('SIGSEGV', 11); -define('SIGUSR2', 12); -define('SIGPIPE', 13); -define('SIGALRM', 14); -define('SIGTERM', 15); -define('SIGSTKFLT', 16); -define('SIGCHLD', 17); -define('SIGCONT', 18); -define('SIGSTOP', 19); -define('SIGTSTP', 20); -define('SIGTTIN', 21); -define('SIGTTOU', 22); -define('SIGURG', 23); -define('SIGXCPU', 24); -define('SIGXFSZ', 25); -define('SIGVTALRM', 26); -define('SIGPROF', 27); -define('SIGWINCH', 28); -define('SIGIO', 29); -define('SIGPWR', 30); -define('SIGSYS', 31); -define('SIG_IGN', 1); -define('PRIO_PROCESS', 0); -define('PRIO_PGRP', 1); -define('PRIO_USER', 2); define('SWOOLE_TIMER_MIN_MS', 1); define('SWOOLE_TIMER_MIN_SEC', 0.001); define('SWOOLE_TIMER_MAX_MS', 9223372036854775807); From 74dbb14763826511208343efa2372a807fba40dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vieilledent?= Date: Mon, 14 Mar 2022 17:37:02 +0100 Subject: [PATCH 004/419] Update Blackfire stup Add: - `startTransaction()` - `stopTransaction()` --- blackfire/blackfire.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/blackfire/blackfire.php b/blackfire/blackfire.php index 94ca2372c..9256096d4 100644 --- a/blackfire/blackfire.php +++ b/blackfire/blackfire.php @@ -120,4 +120,18 @@ public function setTransactionName(string $transactionName) {} * @return void */ public function ignoreTransaction() {} + + /** + * Manually starts a transaction. Useful for CLI/Consumer monitoring. + * + * @return void + */ + public function startTransaction() {} + + /** + * Manually stops a transaction. Useful for CLI/Consumer monitoring. + * + * @return void + */ + public function stopTransaction() {} } From 02aab85665c216e4366d707eadc6977ebb196528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vieilledent?= Date: Mon, 14 Mar 2022 17:54:10 +0100 Subject: [PATCH 005/419] Fix CS --- blackfire/blackfire.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blackfire/blackfire.php b/blackfire/blackfire.php index 9256096d4..1663cec18 100644 --- a/blackfire/blackfire.php +++ b/blackfire/blackfire.php @@ -120,14 +120,14 @@ public function setTransactionName(string $transactionName) {} * @return void */ public function ignoreTransaction() {} - + /** * Manually starts a transaction. Useful for CLI/Consumer monitoring. * * @return void */ public function startTransaction() {} - + /** * Manually stops a transaction. Useful for CLI/Consumer monitoring. * From e669bf52c9c68b5375e38d3ac14e4b17d2eefc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vieilledent?= Date: Tue, 15 Mar 2022 09:45:40 +0100 Subject: [PATCH 006/419] Fix CS from PDFLib --- pdflib/PDFlib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdflib/PDFlib.php b/pdflib/PDFlib.php index c61d1c2be..4012e18f0 100644 --- a/pdflib/PDFlib.php +++ b/pdflib/PDFlib.php @@ -787,7 +787,7 @@ public function fit_pdi_page($page, $x, $y, $optlist) {} * @param float $urx X Coordinate of the upper right corner of the target rectangle for the table instance (the fitbox) in user coordinates. * @param float $ury Y Coordinate of the upper right corner of the target rectangle for the table instance (the fitbox) in user coordinates. * @param string $optlist An option list specifying filling details according to Table 5.18. - * + * * @return string A string which specifies the reason for returning from the function * * @link https://www.pdflib.com/fileadmin/pdflib/pdf/manuals/PDFlib-9.3.0-API-reference.pdf From 458643517b28c6aac1fe7923a1bcf786b76334b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vieilledent?= Date: Tue, 15 Mar 2022 12:12:16 +0100 Subject: [PATCH 007/419] Transaction related transactions are static --- blackfire/blackfire.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blackfire/blackfire.php b/blackfire/blackfire.php index 1663cec18..c5bf55503 100644 --- a/blackfire/blackfire.php +++ b/blackfire/blackfire.php @@ -112,26 +112,26 @@ public function createSubProfileQuery() {} * * @return void */ - public function setTransactionName(string $transactionName) {} + public static function setTransactionName(string $transactionName) {} /** * Disables Blackfire Monitoring instrumentation for a transaction. * * @return void */ - public function ignoreTransaction() {} + public static function ignoreTransaction() {} /** * Manually starts a transaction. Useful for CLI/Consumer monitoring. * * @return void */ - public function startTransaction() {} + public static function startTransaction() {} /** * Manually stops a transaction. Useful for CLI/Consumer monitoring. * * @return void */ - public function stopTransaction() {} + public static function stopTransaction() {} } From 25c2ba4791d7c08e62aae0793336694ea4fd424a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?= Date: Sun, 13 Mar 2022 21:59:35 +0100 Subject: [PATCH 008/419] Internal classes should not be part of PhpStormStubsMap --- PhpStormStubsMap.php | 2 -- tests/Tools/generate-stub-map | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index d6567b124..42692789b 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -530,7 +530,6 @@ final class PhpStormStubsMap 'ImagickPixelIteratorException' => 'imagick/imagick.php', 'InfiniteIterator' => 'SPL/SPL.php', 'InflateContext' => 'zlib/zlib.php', - 'IntBackedEnum' => 'Core/Core_c.php', 'InternalIterator' => 'Core/Core_c.php', 'IntlBreakIterator' => 'intl/intl.php', 'IntlCalendar' => 'intl/intl.php', @@ -919,7 +918,6 @@ final class PhpStormStubsMap 'Stomp' => 'stomp/stomp.php', 'StompException' => 'stomp/stomp.php', 'StompFrame' => 'stomp/stomp.php', - 'StringBackedEnum' => 'Core/Core_c.php', 'Stringable' => 'Core/Core_c.php', 'Svn' => 'svn/svn.php', 'SvnNode' => 'svn/svn.php', diff --git a/tests/Tools/generate-stub-map b/tests/Tools/generate-stub-map index 0214dec08..df26dc024 100644 --- a/tests/Tools/generate-stub-map +++ b/tests/Tools/generate-stub-map @@ -27,6 +27,7 @@ use function preg_match; use function sprintf; use function str_replace; use function strlen; +use function strpos; use function strtolower; use function substr; use function var_export; @@ -113,6 +114,10 @@ use const PHP_EOL; public function enterNode(Node $node): ?int { if ($node instanceof Node\Stmt\ClassLike) { + if ($node->getDocComment() !== null && strpos($node->getDocComment()->getText(), '@internal') !== false) { + return NodeTraverser::DONT_TRAVERSE_CHILDREN; + } + $this->classNames[] = $node->namespacedName->toString(); return NodeTraverser::DONT_TRAVERSE_CHILDREN; From 9d68370f56653d7f42ad621eb7001ab01d648d3d Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Tue, 15 Mar 2022 15:59:37 +0100 Subject: [PATCH 009/419] [phpstorm-stubs] minor fixes --- SPL/SPL_c1.php | 4 ++-- iconv/iconv.php | 2 +- tests/BaseStubsTest.php | 3 +-- tests/Model/PHPDocElement.php | 3 ++- tests/TestData/mutedProblems.json | 3 ++- tests/Tools/generate-stub-map | 7 +++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 9446b3b34..54ac9cbef 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -1503,7 +1503,7 @@ class SplMinHeap extends SplHeap * @param TValue $value2

* The value of the second node being compared. *

- * @return void Result of the comparison, positive integer if value1 is lower than value2, 0 if they are equal, negative integer otherwise. + * @return int Result of the comparison, positive integer if value1 is lower than value2, 0 if they are equal, negative integer otherwise. *

*

* Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position. @@ -1612,7 +1612,7 @@ class SplMaxHeap extends SplHeap * @param TValue $value2

* The value of the second node being compared. *

- * @return void Result of the comparison, positive integer if value1 is greater than value2, 0 if they are equal, negative integer otherwise. + * @return int Result of the comparison, positive integer if value1 is greater than value2, 0 if they are equal, negative integer otherwise. *

*

* Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position. diff --git a/iconv/iconv.php b/iconv/iconv.php index 5cd45372e..229d102c2 100644 --- a/iconv/iconv.php +++ b/iconv/iconv.php @@ -419,7 +419,7 @@ function iconv_mime_decode_headers(string $headers, int $mode = 0, ?string $enco * string * @link https://php.net/manual/en/iconv.constants.php */ -define('ICONV_IMPL', "unknown"); +define('ICONV_IMPL', "libiconv"); /** * string diff --git a/tests/BaseStubsTest.php b/tests/BaseStubsTest.php index 9b9029c20..bb6d1b6e6 100644 --- a/tests/BaseStubsTest.php +++ b/tests/BaseStubsTest.php @@ -90,8 +90,7 @@ public static function getStringRepresentationOfDefaultParameterValue(mixed $def $value = "null"; } elseif (is_array($defaultValue) || $defaultValue instanceof Array_) { $value = '[]'; - } - else { + } else { $value = strval($defaultValue); } return $value; diff --git a/tests/Model/PHPDocElement.php b/tests/Model/PHPDocElement.php index 3210ae39a..91cba38a5 100644 --- a/tests/Model/PHPDocElement.php +++ b/tests/Model/PHPDocElement.php @@ -73,7 +73,8 @@ trait PHPDocElement public $hasInternalMetaTag = false; public $templateTypes = null; - protected function collectTags(Node $node) { + protected function collectTags(Node $node) + { if ($node->getDocComment() !== null) { try { $text = $node->getDocComment()->getText(); diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index fe3c4268a..32732ef4b 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -977,7 +977,8 @@ { "description": "parameter mismatch", "versions": [ - 8.0, 8.1 + 8.0, + 8.1 ] } ] diff --git a/tests/Tools/generate-stub-map b/tests/Tools/generate-stub-map index df26dc024..07a4c18b8 100644 --- a/tests/Tools/generate-stub-map +++ b/tests/Tools/generate-stub-map @@ -97,8 +97,7 @@ use const PHP_EOL; $phpStormStubsDirectory = __DIR__ . '/../../'; - $fileVisitor = new class() extends NodeVisitorAbstract - { + $fileVisitor = new class() extends NodeVisitorAbstract { /** @var string[] */ private $classNames = []; @@ -248,10 +247,10 @@ use const PHP_EOL; } } - $mapWithRelativeFilePaths = array_map(static function (array $files) use ($phpStormStubsDirectory) : array { + $mapWithRelativeFilePaths = array_map(static function (array $files) use ($phpStormStubsDirectory): array { ksort($files); - return array_map(static function (string $filePath) use ($phpStormStubsDirectory) : string { + return array_map(static function (string $filePath) use ($phpStormStubsDirectory): string { return str_replace('\\', '/', substr($filePath, strlen($phpStormStubsDirectory))); }, $files); }, $map); From 90461cd8f895b0112b2804b1a8cc578b4af27f24 Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Tue, 22 Feb 2022 18:36:30 +0100 Subject: [PATCH 010/419] Language injection for common function args --- dom/dom_c.php | 5 +++-- pcre/pcre.php | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dom/dom_c.php b/dom/dom_c.php index b6f8c9eeb..75c9348ce 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -5,6 +5,7 @@ use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; use JetBrains\PhpStorm\Internal\TentativeType; +use JetBrains\PhpStorm\Language; /** * The DOMNode class @@ -2363,7 +2364,7 @@ public function registerNamespace( */ #[TentativeType] public function query( - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $expression, + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] #[Language('XPath')] $expression, #[LanguageLevelTypeAware(['8.0' => 'DOMNode|null'], default: '')] $contextNode = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $registerNodeNS = true ): mixed {} @@ -2388,7 +2389,7 @@ public function query( */ #[TentativeType] public function evaluate( - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $expression, + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] #[Language('XPath')] $expression, #[LanguageLevelTypeAware(['8.0' => 'DOMNode|null'], default: '')] $contextNode = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $registerNodeNS = true ): mixed {} diff --git a/pcre/pcre.php b/pcre/pcre.php index 10b274212..7797ecc3e 100644 --- a/pcre/pcre.php +++ b/pcre/pcre.php @@ -3,6 +3,7 @@ // Start of pcre v. use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; +use JetBrains\PhpStorm\Language; use JetBrains\PhpStorm\Pure; /** @@ -157,7 +158,7 @@ * matches given subject, 0 if it does not, or FALSE * if an error occurred. */ -function preg_match(string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0): int|false {} +function preg_match(#[Language('PhpRegExp')] string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0): int|false {} /** * Perform a global regular expression match @@ -216,7 +217,7 @@ function preg_match(string $pattern, string $subject, &$matches, int $flags = 0, * or FALSE if an error occurred. */ #[LanguageLevelTypeAware(['8.0' => 'int|false'], default: 'int|false|null')] -function preg_match_all(string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0) {} +function preg_match_all(#[Language('PhpRegExp')] string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0) {} /** * Perform a regular expression search and replace @@ -396,7 +397,7 @@ function preg_replace_callback( *

If matches are found, the new subject will be returned, otherwise subject will be returned unchanged.

*/ function preg_replace_callback_array( - array $pattern, + #[Language('PhpRegExp')] array $pattern, array|string $subject, int $limit = -1, &$count, @@ -449,7 +450,7 @@ function preg_filter(array|string $pattern, array|string $replacement, array|str * if an error occurred. */ #[Pure] -function preg_split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array|false {} +function preg_split(#[Language('PhpRegExp')] string $pattern, string $subject, int $limit = -1, int $flags = 0): array|false {} /** * Quote regular expression characters @@ -486,7 +487,7 @@ function preg_quote(string $str, ?string $delimiter = null): string {} * input array or false when pattern cannot be compiled. */ #[Pure] -function preg_grep(string $pattern, array $array, int $flags = 0): array|false {} +function preg_grep(#[Language('PhpRegExp')] string $pattern, array $array, int $flags = 0): array|false {} /** * Returns the error code of the last PCRE regex execution From ecd1c9e9a8930e197342a618c2730a2fb9922071 Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Tue, 15 Mar 2022 16:20:37 +0100 Subject: [PATCH 011/419] Revert regexp change --- pcre/pcre.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pcre/pcre.php b/pcre/pcre.php index 7797ecc3e..10b274212 100644 --- a/pcre/pcre.php +++ b/pcre/pcre.php @@ -3,7 +3,6 @@ // Start of pcre v. use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; -use JetBrains\PhpStorm\Language; use JetBrains\PhpStorm\Pure; /** @@ -158,7 +157,7 @@ * matches given subject, 0 if it does not, or FALSE * if an error occurred. */ -function preg_match(#[Language('PhpRegExp')] string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0): int|false {} +function preg_match(string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0): int|false {} /** * Perform a global regular expression match @@ -217,7 +216,7 @@ function preg_match(#[Language('PhpRegExp')] string $pattern, string $subject, & * or FALSE if an error occurred. */ #[LanguageLevelTypeAware(['8.0' => 'int|false'], default: 'int|false|null')] -function preg_match_all(#[Language('PhpRegExp')] string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0) {} +function preg_match_all(string $pattern, string $subject, &$matches, int $flags = 0, int $offset = 0) {} /** * Perform a regular expression search and replace @@ -397,7 +396,7 @@ function preg_replace_callback( *

If matches are found, the new subject will be returned, otherwise subject will be returned unchanged.

*/ function preg_replace_callback_array( - #[Language('PhpRegExp')] array $pattern, + array $pattern, array|string $subject, int $limit = -1, &$count, @@ -450,7 +449,7 @@ function preg_filter(array|string $pattern, array|string $replacement, array|str * if an error occurred. */ #[Pure] -function preg_split(#[Language('PhpRegExp')] string $pattern, string $subject, int $limit = -1, int $flags = 0): array|false {} +function preg_split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array|false {} /** * Quote regular expression characters @@ -487,7 +486,7 @@ function preg_quote(string $str, ?string $delimiter = null): string {} * input array or false when pattern cannot be compiled. */ #[Pure] -function preg_grep(#[Language('PhpRegExp')] string $pattern, array $array, int $flags = 0): array|false {} +function preg_grep(string $pattern, array $array, int $flags = 0): array|false {} /** * Returns the error code of the last PCRE regex execution From 0642c17bda2621d6527e1be86c6e27483cad069d Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 16 Feb 2022 18:25:12 +0400 Subject: [PATCH 012/419] Create new PhpArray stub --- redis/Redis.php | 187 ------------------------------------- redis/RedisArray.php | 213 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+), 187 deletions(-) create mode 100644 redis/RedisArray.php diff --git a/redis/Redis.php b/redis/Redis.php index d548a0c53..03ca215fe 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -4643,190 +4643,3 @@ public function sAddArray($key, array $values) {} } class RedisException extends Exception {} - -/** - * @mixin \Redis - */ -class RedisArray -{ - /** - * Constructor - * - * @param string|string[] $hosts Name of the redis array from redis.ini or array of hosts to construct the array with - * @param null|array $opts Array of options - * - * @link https://github.com/nicolasff/phpredis/blob/master/arrays.markdown - */ - public function __construct($hosts, ?array $opts = null) {} - - /** - * @return array list of hosts for the selected array - */ - public function _hosts() {} - - /** - * @return string the name of the function used to extract key parts during consistent hashing - */ - public function _function() {} - - /** - * @param string $key The key for which you want to lookup the host - * - * @return string the host to be used for a certain key - */ - public function _target($key) {} - - /** - * @param string $host The host you want to retrieve the instance for - * - * @return Redis a redis instance connected to a specific node - */ - public function _instance($host) {} - - /** - * Use this function when a new node is added and keys need to be rehashed. - */ - public function _rehash() {} - - /** - * Returns an associative array of strings and integers, with the following keys: - * - redis_version - * - redis_git_sha1 - * - redis_git_dirty - * - redis_build_id - * - redis_mode - * - os - * - arch_bits - * - multiplexing_api - * - atomicvar_api - * - gcc_version - * - process_id - * - run_id - * - tcp_port - * - uptime_in_seconds - * - uptime_in_days - * - hz - * - lru_clock - * - executable - * - config_file - * - connected_clients - * - client_longest_output_list - * - client_biggest_input_buf - * - blocked_clients - * - used_memory - * - used_memory_human - * - used_memory_rss - * - used_memory_rss_human - * - used_memory_peak - * - used_memory_peak_human - * - used_memory_peak_perc - * - used_memory_peak - * - used_memory_overhead - * - used_memory_startup - * - used_memory_dataset - * - used_memory_dataset_perc - * - total_system_memory - * - total_system_memory_human - * - used_memory_lua - * - used_memory_lua_human - * - maxmemory - * - maxmemory_human - * - maxmemory_policy - * - mem_fragmentation_ratio - * - mem_allocator - * - active_defrag_running - * - lazyfree_pending_objects - * - mem_fragmentation_ratio - * - loading - * - rdb_changes_since_last_save - * - rdb_bgsave_in_progress - * - rdb_last_save_time - * - rdb_last_bgsave_status - * - rdb_last_bgsave_time_sec - * - rdb_current_bgsave_time_sec - * - rdb_last_cow_size - * - aof_enabled - * - aof_rewrite_in_progress - * - aof_rewrite_scheduled - * - aof_last_rewrite_time_sec - * - aof_current_rewrite_time_sec - * - aof_last_bgrewrite_status - * - aof_last_write_status - * - aof_last_cow_size - * - changes_since_last_save - * - aof_current_size - * - aof_base_size - * - aof_pending_rewrite - * - aof_buffer_length - * - aof_rewrite_buffer_length - * - aof_pending_bio_fsync - * - aof_delayed_fsync - * - loading_start_time - * - loading_total_bytes - * - loading_loaded_bytes - * - loading_loaded_perc - * - loading_eta_seconds - * - total_connections_received - * - total_commands_processed - * - instantaneous_ops_per_sec - * - total_net_input_bytes - * - total_net_output_bytes - * - instantaneous_input_kbps - * - instantaneous_output_kbps - * - rejected_connections - * - maxclients - * - sync_full - * - sync_partial_ok - * - sync_partial_err - * - expired_keys - * - evicted_keys - * - keyspace_hits - * - keyspace_misses - * - pubsub_channels - * - pubsub_patterns - * - latest_fork_usec - * - migrate_cached_sockets - * - slave_expires_tracked_keys - * - active_defrag_hits - * - active_defrag_misses - * - active_defrag_key_hits - * - active_defrag_key_misses - * - role - * - master_replid - * - master_replid2 - * - master_repl_offset - * - second_repl_offset - * - repl_backlog_active - * - repl_backlog_size - * - repl_backlog_first_byte_offset - * - repl_backlog_histlen - * - master_host - * - master_port - * - master_link_status - * - master_last_io_seconds_ago - * - master_sync_in_progress - * - slave_repl_offset - * - slave_priority - * - slave_read_only - * - master_sync_left_bytes - * - master_sync_last_io_seconds_ago - * - master_link_down_since_seconds - * - connected_slaves - * - min-slaves-to-write - * - min-replicas-to-write - * - min_slaves_good_slaves - * - used_cpu_sys - * - used_cpu_user - * - used_cpu_sys_children - * - used_cpu_user_children - * - cluster_enabled - * - * @link https://redis.io/commands/info - * @return array - * @example - *
-     * $redis->info();
-     * 
- */ - public function info() {} -} diff --git a/redis/RedisArray.php b/redis/RedisArray.php new file mode 100644 index 000000000..94ea0b525 --- /dev/null +++ b/redis/RedisArray.php @@ -0,0 +1,213 @@ + + * @link https://github.com/akalongman/phpstorm-stubs + */ +class RedisArray +{ + /** + * Constructor + * + * @param string|string[] $hosts Name of the redis array from redis.ini or array of hosts to construct the array with + * @param null|array $opts Array of options + * + * @link https://github.com/phpredis/phpredis/blob/develop/redis_array.stub.php + */ + public function __construct(string|array $hosts, ?array $opts = null) {} + + /** + * @return bool|array returns a list of points on continuum; may be useful with custom distributor function. + */ + public function _continuum(): bool|array {} + + /** + * @return bool|array returns a custom distributor function. + */ + public function _distributor(): bool|callable {} + + /** + * @return bool|callable the name of the function used to extract key parts during consistent hashing. + */ + public function _function(): bool|callable {} + + /** + * @return bool|array list of hosts for the selected array or false + */ + public function _hosts(): bool|array {} + + /** + * @param string $host The host you want to retrieve the instance for + * + * @return bool|null|\Redis a redis instance connected to a specific node + */ + public function _instance(string $host): bool|null|Redis {} + + /** + * Use this function when a new node is added and keys need to be rehashed. + * + * @return bool|null rehash result + */ + public function _rehash(callable $fn = null): bool|null {} + + /** + * @param string $key The key for which you want to lookup the host + * + * @return bool|string|null the host to be used for a certain key + */ + public function _target(string $key): bool|string|null {} + + /** + * @param string $host Host + * @param int $mode \Redis::MULTI|\Redis::PIPELINE + * + * @return bool|string|null the host to be used for a certain key + */ + public function multi(string $host, int $mode = Redis::MULTI): bool|RedisArray {} + + /** + * Returns a hosts array of associative array of strings and integers, with the following keys: + * - redis_version + * - redis_git_sha1 + * - redis_git_dirty + * - redis_build_id + * - redis_mode + * - os + * - arch_bits + * - multiplexing_api + * - atomicvar_api + * - gcc_version + * - process_id + * - run_id + * - tcp_port + * - uptime_in_seconds + * - uptime_in_days + * - hz + * - lru_clock + * - executable + * - config_file + * - connected_clients + * - client_longest_output_list + * - client_biggest_input_buf + * - blocked_clients + * - used_memory + * - used_memory_human + * - used_memory_rss + * - used_memory_rss_human + * - used_memory_peak + * - used_memory_peak_human + * - used_memory_peak_perc + * - used_memory_peak + * - used_memory_overhead + * - used_memory_startup + * - used_memory_dataset + * - used_memory_dataset_perc + * - total_system_memory + * - total_system_memory_human + * - used_memory_lua + * - used_memory_lua_human + * - maxmemory + * - maxmemory_human + * - maxmemory_policy + * - mem_fragmentation_ratio + * - mem_allocator + * - active_defrag_running + * - lazyfree_pending_objects + * - mem_fragmentation_ratio + * - loading + * - rdb_changes_since_last_save + * - rdb_bgsave_in_progress + * - rdb_last_save_time + * - rdb_last_bgsave_status + * - rdb_last_bgsave_time_sec + * - rdb_current_bgsave_time_sec + * - rdb_last_cow_size + * - aof_enabled + * - aof_rewrite_in_progress + * - aof_rewrite_scheduled + * - aof_last_rewrite_time_sec + * - aof_current_rewrite_time_sec + * - aof_last_bgrewrite_status + * - aof_last_write_status + * - aof_last_cow_size + * - changes_since_last_save + * - aof_current_size + * - aof_base_size + * - aof_pending_rewrite + * - aof_buffer_length + * - aof_rewrite_buffer_length + * - aof_pending_bio_fsync + * - aof_delayed_fsync + * - loading_start_time + * - loading_total_bytes + * - loading_loaded_bytes + * - loading_loaded_perc + * - loading_eta_seconds + * - total_connections_received + * - total_commands_processed + * - instantaneous_ops_per_sec + * - total_net_input_bytes + * - total_net_output_bytes + * - instantaneous_input_kbps + * - instantaneous_output_kbps + * - rejected_connections + * - maxclients + * - sync_full + * - sync_partial_ok + * - sync_partial_err + * - expired_keys + * - evicted_keys + * - keyspace_hits + * - keyspace_misses + * - pubsub_channels + * - pubsub_patterns + * - latest_fork_usec + * - migrate_cached_sockets + * - slave_expires_tracked_keys + * - active_defrag_hits + * - active_defrag_misses + * - active_defrag_key_hits + * - active_defrag_key_misses + * - role + * - master_replid + * - master_replid2 + * - master_repl_offset + * - second_repl_offset + * - repl_backlog_active + * - repl_backlog_size + * - repl_backlog_first_byte_offset + * - repl_backlog_histlen + * - master_host + * - master_port + * - master_link_status + * - master_last_io_seconds_ago + * - master_sync_in_progress + * - slave_repl_offset + * - slave_priority + * - slave_read_only + * - master_sync_left_bytes + * - master_sync_last_io_seconds_ago + * - master_link_down_since_seconds + * - connected_slaves + * - min-slaves-to-write + * - min-replicas-to-write + * - min_slaves_good_slaves + * - used_cpu_sys + * - used_cpu_user + * - used_cpu_sys_children + * - used_cpu_user_children + * - cluster_enabled + * + * @link https://redis.io/commands/info + * @return bool|array + * @example + *
+     * $redis->info();
+     * 
+ */ + public function info(): bool|array {} +} From e1d6b91a0450878092fd6c12dbed352fabd07ecf Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Fri, 18 Feb 2022 18:35:03 +0400 Subject: [PATCH 013/419] Update class dock block --- redis/RedisArray.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/redis/RedisArray.php b/redis/RedisArray.php index 94ea0b525..f5fc74b8d 100644 --- a/redis/RedisArray.php +++ b/redis/RedisArray.php @@ -5,8 +5,7 @@ * * @mixin \Redis * - * @author Avtandil Kikabidze - * @link https://github.com/akalongman/phpstorm-stubs + * @link https://github.com/phpredis/phpredis/blob/develop/redis_array.stub.php */ class RedisArray { @@ -15,8 +14,6 @@ class RedisArray * * @param string|string[] $hosts Name of the redis array from redis.ini or array of hosts to construct the array with * @param null|array $opts Array of options - * - * @link https://github.com/phpredis/phpredis/blob/develop/redis_array.stub.php */ public function __construct(string|array $hosts, ?array $opts = null) {} From 1da9555a9d07b69b10e59f09aef56e43133ae6f8 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 15 Mar 2022 19:33:27 +0400 Subject: [PATCH 014/419] Update stubs map --- PhpStormStubsMap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 42692789b..c071ca3e2 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -767,7 +767,7 @@ final class PhpStormStubsMap 'RecursiveRegexIterator' => 'SPL/SPL.php', 'RecursiveTreeIterator' => 'SPL/SPL.php', 'Redis' => 'redis/Redis.php', - 'RedisArray' => 'redis/Redis.php', + 'RedisArray' => 'redis/RedisArray.php', 'RedisCluster' => 'redis/RedisCluster.php', 'RedisClusterException' => 'redis/RedisCluster.php', 'RedisException' => 'redis/Redis.php', From 769a039fc531070f83d1de27e6e7ff7937b3b074 Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Wed, 23 Feb 2022 07:38:35 +0100 Subject: [PATCH 015/419] Set docker workerdir, rename phpunit xml for dist, remove unecessary cli arg --- .github/workflows/main.yml | 2 +- .github/workflows/testLinks.yml | 2 +- README.md | 2 +- phpunit.xml => phpunit.xml.dist | 0 runTests.sh | 2 +- tests/DockerImages/testRunner/Dockerfile | 4 +++- 6 files changed, 7 insertions(+), 5 deletions(-) rename phpunit.xml => phpunit.xml.dist (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a60316cb..6de1d8421 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: PHP_VERSION: ${{matrix.php}} - name: Run Tests - run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit --configuration /opt/project/phpstorm-stubs/phpunit.xml --testsuite PHP_${{matrix.php}} + run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner vendor/bin/phpunit --testsuite PHP_${{matrix.php}} env: PHP_VERSION: ${{matrix.php}} additional: diff --git a/.github/workflows/testLinks.yml b/.github/workflows/testLinks.yml index f227b6de8..92eae5cc3 100644 --- a/.github/workflows/testLinks.yml +++ b/.github/workflows/testLinks.yml @@ -23,6 +23,6 @@ jobs: PHP_VERSION: '8.0' - name: Run Tests - run: docker-compose -f docker-compose.yml run -e CHECK_LINKS=true test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit --configuration /opt/project/phpstorm-stubs/phpunit.xml --testsuite PhpDoc + run: docker-compose -f docker-compose.yml run -e CHECK_LINKS=true test_runner vendor/bin/phpunit --testsuite PhpDoc env: PHP_VERSION: '8.0' diff --git a/README.md b/README.md index 81d2fd82a..c23ac8a17 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The set of extensions enabled by default in PhpStorm can change anytime without ### How to run tests 1. Execute `docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs --ignore-platform-reqs` -2. Execute `docker-compose -f docker-compose.yml run -e PHP_VERSION=8.0 test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit --configuration /opt/project/phpstorm-stubs/phpunit.xml --testsuite PHP_8.0` +2. Execute `docker-compose -f docker-compose.yml run -e PHP_VERSION=8.0 test_runner vendor/bin/phpunit --testsuite PHP_8.0` ### How to update stub map Execute `docker-compose -f docker-compose.yml run test_runner /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/generate-stub-map` and commit the resulting `PhpStormStubsMap.php` diff --git a/phpunit.xml b/phpunit.xml.dist similarity index 100% rename from phpunit.xml rename to phpunit.xml.dist diff --git a/runTests.sh b/runTests.sh index b728f154e..322321069 100755 --- a/runTests.sh +++ b/runTests.sh @@ -12,7 +12,7 @@ do echo "Dumping reflection data to file $SCRIPT_DIR/ReflectionData.json for PHP_$i..." docker-compose -f docker-compose.yml run -e PHP_VERSION="$i" php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionData.json echo "Running tests agains PHP_$i..." - docker-compose -f docker-compose.yml run -e PHP_VERSION="$i" test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit --configuration /opt/project/phpstorm-stubs/phpunit.xml --testsuite PHP_"$i" + docker-compose -f docker-compose.yml run -e PHP_VERSION="$i" test_runner vendor/bin/phpunit --testsuite PHP_"$i" echo "Removing file $SCRIPT_DIR/ReflectionData.json with reflection data for PHP_$i..." rm -f "$SCRIPT_DIR/ReflectionData.json" done diff --git a/tests/DockerImages/testRunner/Dockerfile b/tests/DockerImages/testRunner/Dockerfile index e15898615..fc6b6ed8c 100644 --- a/tests/DockerImages/testRunner/Dockerfile +++ b/tests/DockerImages/testRunner/Dockerfile @@ -3,4 +3,6 @@ FROM php:8.1-apache RUN echo 'memory_limit = 1024M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini COPY --from=composer /usr/bin/composer /usr/bin/composer -RUN apt-get update && apt-get -y install git zip unzip \ No newline at end of file +RUN apt-get update && apt-get -y install git zip unzip + +WORKDIR /opt/project/phpstorm-stubs From a64f089caf79916aea2c1ac8864ee2d7b41498b3 Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Wed, 23 Feb 2022 08:57:38 +0100 Subject: [PATCH 016/419] Rename base test class to make it obvious that it is not a test and that it is a parent/base class --- ...StubsTest.php => AbstractBaseStubsTestCase.php} | 2 +- tests/BaseClassesTest.php | 2 +- tests/BaseConstantsTest.php | 2 +- tests/BaseFunctionsTest.php | 8 ++++---- tests/StubsCompositeMixedReturnTypeTest.php | 2 +- tests/StubsConstantsAndParametersValuesTest.php | 10 +++++----- tests/StubsForbiddenTypeHintsTest.php | 2 +- tests/StubsMetaExpectedArgumentsTest.php | 2 +- tests/StubsMetaInternalTagTest.php | 2 +- tests/StubsParameterNamesTest.php | 2 +- tests/StubsPhp81Tests.php | 6 +++--- tests/StubsPhpDocTest.php | 2 +- tests/StubsReflectionClassesTest.php | 2 +- tests/StubsStructureTest.php | 2 +- tests/StubsTypeHintsTest.php | 14 +++++++------- 15 files changed, 30 insertions(+), 30 deletions(-) rename tests/{BaseStubsTest.php => AbstractBaseStubsTestCase.php} (99%) diff --git a/tests/BaseStubsTest.php b/tests/AbstractBaseStubsTestCase.php similarity index 99% rename from tests/BaseStubsTest.php rename to tests/AbstractBaseStubsTestCase.php index bb6d1b6e6..a62e5b8f3 100644 --- a/tests/BaseStubsTest.php +++ b/tests/AbstractBaseStubsTestCase.php @@ -26,7 +26,7 @@ use function property_exists; use function strval; -abstract class BaseStubsTest extends TestCase +abstract class AbstractBaseStubsTestCase extends TestCase { public static function setUpBeforeClass(): void { diff --git a/tests/BaseClassesTest.php b/tests/BaseClassesTest.php index 83b8f2b15..29f449a6f 100644 --- a/tests/BaseClassesTest.php +++ b/tests/BaseClassesTest.php @@ -12,7 +12,7 @@ use StubTests\Model\PhpVersions; use StubTests\TestData\Providers\PhpStormStubsSingleton; -class BaseClassesTest extends BaseStubsTest +class BaseClassesTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionClassesTestDataProviders::classWithParentProvider diff --git a/tests/BaseConstantsTest.php b/tests/BaseConstantsTest.php index bd9b22095..fada4d637 100644 --- a/tests/BaseConstantsTest.php +++ b/tests/BaseConstantsTest.php @@ -10,7 +10,7 @@ use StubTests\Model\PHPInterface; use StubTests\TestData\Providers\PhpStormStubsSingleton; -class BaseConstantsTest extends BaseStubsTest +class BaseConstantsTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionConstantsProvider::constantProvider diff --git a/tests/BaseFunctionsTest.php b/tests/BaseFunctionsTest.php index ea216b160..29efa1c77 100644 --- a/tests/BaseFunctionsTest.php +++ b/tests/BaseFunctionsTest.php @@ -15,7 +15,7 @@ use StubTests\TestData\Providers\EntitiesFilter; use StubTests\TestData\Providers\PhpStormStubsSingleton; -class BaseFunctionsTest extends BaseStubsTest +class BaseFunctionsTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionFunctionsProvider::allFunctionsProvider @@ -25,7 +25,7 @@ public function testFunctionsExist(PHPFunction $function): void { $functionName = $function->name; $stubFunction = PhpStormStubsSingleton::getPhpStormStubs()->getFunction($functionName); - $params = BaseStubsTest::getParameterRepresentation($function); + $params = AbstractBaseStubsTestCase::getParameterRepresentation($function); static::assertNotEmpty($stubFunction, "Missing function: function $functionName($params){}"); } @@ -61,8 +61,8 @@ public function testFunctionsParametersAmount(PHPFunction $function) $function->parameters, $uniqueParameterNames, "Parameter number mismatch for function $functionName. - Expected: " . BaseStubsTest::getParameterRepresentation($function) . "\n" . - 'Actual: ' . BaseStubsTest::getParameterRepresentation($stubFunction) + Expected: " . AbstractBaseStubsTestCase::getParameterRepresentation($function) . "\n" . + 'Actual: ' . AbstractBaseStubsTestCase::getParameterRepresentation($stubFunction) ); } diff --git a/tests/StubsCompositeMixedReturnTypeTest.php b/tests/StubsCompositeMixedReturnTypeTest.php index 271a9cf32..dcfed7b08 100644 --- a/tests/StubsCompositeMixedReturnTypeTest.php +++ b/tests/StubsCompositeMixedReturnTypeTest.php @@ -4,7 +4,7 @@ use StubTests\Model\PHPFunction; -class StubsCompositeMixedReturnTypeTest extends BaseStubsTest +class StubsCompositeMixedReturnTypeTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubsCompositeMixedProvider::expectedFunctionsMixedFalseReturnProvider diff --git a/tests/StubsConstantsAndParametersValuesTest.php b/tests/StubsConstantsAndParametersValuesTest.php index 901e4a487..6498e3240 100644 --- a/tests/StubsConstantsAndParametersValuesTest.php +++ b/tests/StubsConstantsAndParametersValuesTest.php @@ -13,7 +13,7 @@ use StubTests\Model\PHPParameter; use StubTests\TestData\Providers\PhpStormStubsSingleton; -class StubsConstantsAndParametersValuesTest extends BaseStubsTest +class StubsConstantsAndParametersValuesTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionConstantsProvider::constantValuesProvider @@ -41,8 +41,8 @@ public function testFunctionsDefaultParametersValue(PHPFunction $function, PHPPa $stubParameters = array_filter($phpstormFunction->parameters, fn (PHPParameter $stubParameter) => $stubParameter->indexInSignature === $parameter->indexInSignature); /** @var PHPParameter $stubOptionalParameter */ $stubOptionalParameter = array_pop($stubParameters); - $reflectionValue = BaseStubsTest::getStringRepresentationOfDefaultParameterValue($parameter->defaultValue); - $stubValue = BaseStubsTest::getStringRepresentationOfDefaultParameterValue($stubOptionalParameter->defaultValue); + $reflectionValue = AbstractBaseStubsTestCase::getStringRepresentationOfDefaultParameterValue($parameter->defaultValue); + $stubValue = AbstractBaseStubsTestCase::getStringRepresentationOfDefaultParameterValue($stubOptionalParameter->defaultValue); self::assertEquals( $reflectionValue, $stubValue, @@ -70,8 +70,8 @@ public function testMethodsDefaultParametersValue(PHPClass|PHPInterface $class, $stubParameters = array_filter($phpstormFunction->parameters, fn (PHPParameter $stubParameter) => $stubParameter->indexInSignature === $parameter->indexInSignature); /** @var PHPParameter $stubOptionalParameter */ $stubOptionalParameter = array_pop($stubParameters); - $reflectionValue = BaseStubsTest::getStringRepresentationOfDefaultParameterValue($parameter->defaultValue); - $stubValue = BaseStubsTest::getStringRepresentationOfDefaultParameterValue($stubOptionalParameter->defaultValue, $class); + $reflectionValue = AbstractBaseStubsTestCase::getStringRepresentationOfDefaultParameterValue($parameter->defaultValue); + $stubValue = AbstractBaseStubsTestCase::getStringRepresentationOfDefaultParameterValue($stubOptionalParameter->defaultValue, $class); self::assertEquals( $reflectionValue, $stubValue, diff --git a/tests/StubsForbiddenTypeHintsTest.php b/tests/StubsForbiddenTypeHintsTest.php index e1ddf0efe..fa1201fd7 100644 --- a/tests/StubsForbiddenTypeHintsTest.php +++ b/tests/StubsForbiddenTypeHintsTest.php @@ -9,7 +9,7 @@ use StubTests\Model\PHPParameter; use StubTests\Parsers\ParserUtils; -class StubsForbiddenTypeHintsTest extends BaseStubsTest +class StubsForbiddenTypeHintsTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubMethodsProvider::methodsForNullableReturnTypeHintTestsProvider diff --git a/tests/StubsMetaExpectedArgumentsTest.php b/tests/StubsMetaExpectedArgumentsTest.php index 34c1b7d8c..a5728d760 100644 --- a/tests/StubsMetaExpectedArgumentsTest.php +++ b/tests/StubsMetaExpectedArgumentsTest.php @@ -28,7 +28,7 @@ use function str_starts_with; use function substr; -class StubsMetaExpectedArgumentsTest extends BaseStubsTest +class StubsMetaExpectedArgumentsTest extends AbstractBaseStubsTestCase { /** * @var ExpectedFunctionArgumentsInfo[] diff --git a/tests/StubsMetaInternalTagTest.php b/tests/StubsMetaInternalTagTest.php index a3170cb42..a39378a58 100644 --- a/tests/StubsMetaInternalTagTest.php +++ b/tests/StubsMetaInternalTagTest.php @@ -13,7 +13,7 @@ use function array_filter; use function array_pop; -class StubsMetaInternalTagTest extends BaseStubsTest +class StubsMetaInternalTagTest extends AbstractBaseStubsTestCase { /** * @var string[] diff --git a/tests/StubsParameterNamesTest.php b/tests/StubsParameterNamesTest.php index b68ce34f0..1251bb9ed 100644 --- a/tests/StubsParameterNamesTest.php +++ b/tests/StubsParameterNamesTest.php @@ -12,7 +12,7 @@ use StubTests\Model\PHPParameter; use StubTests\TestData\Providers\PhpStormStubsSingleton; -class StubsParameterNamesTest extends BaseStubsTest +class StubsParameterNamesTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::functionParametersProvider diff --git a/tests/StubsPhp81Tests.php b/tests/StubsPhp81Tests.php index bdab566d5..8e18e2789 100644 --- a/tests/StubsPhp81Tests.php +++ b/tests/StubsPhp81Tests.php @@ -9,7 +9,7 @@ use StubTests\Model\PHPProperty; use StubTests\TestData\Providers\PhpStormStubsSingleton; -class StubsPhp81Tests extends BaseStubsTest +class StubsPhp81Tests extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionPropertiesProvider::classReadonlyPropertiesProvider @@ -50,7 +50,7 @@ public function testTentativeReturnTypeHints(PHPClass|PHPInterface $class, PHPMe self::convertNullableTypesToUnion($listOfTypes, $unifiedStubsAttributesReturnTypes[$languageVersion]); } } - $conditionToCompareWithSignature = BaseStubsTest::isReflectionTypesMatchSignature( + $conditionToCompareWithSignature = AbstractBaseStubsTestCase::isReflectionTypesMatchSignature( $unifiedReflectionReturnTypes, $unifiedStubsReturnTypes ); @@ -60,7 +60,7 @@ public function testTentativeReturnTypeHints(PHPClass|PHPInterface $class, PHPMe $unifiedStubsAttributesReturnTypes[getenv('PHP_VERSION')] : $unifiedStubsAttributesReturnTypes['default']; } - $conditionToCompareWithAttribute = BaseStubsTest::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); + $conditionToCompareWithAttribute = AbstractBaseStubsTestCase::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); $testCondition = $conditionToCompareWithSignature || $conditionToCompareWithAttribute; self::assertTrue( $testCondition, diff --git a/tests/StubsPhpDocTest.php b/tests/StubsPhpDocTest.php index c9e0917e9..0fa0f4410 100644 --- a/tests/StubsPhpDocTest.php +++ b/tests/StubsPhpDocTest.php @@ -19,7 +19,7 @@ use StubTests\Parsers\ParserUtils; use function trim; -class StubsPhpDocTest extends BaseStubsTest +class StubsPhpDocTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubConstantsProvider::classConstantProvider diff --git a/tests/StubsReflectionClassesTest.php b/tests/StubsReflectionClassesTest.php index 711fdad4a..18aa14beb 100644 --- a/tests/StubsReflectionClassesTest.php +++ b/tests/StubsReflectionClassesTest.php @@ -10,7 +10,7 @@ /** * Class to test typehints of some Reflection* classes as reflection for these classes returns null. */ -class StubsReflectionClassesTest extends BaseStubsTest +class StubsReflectionClassesTest extends AbstractBaseStubsTestCase { /** * @throws Exception|RuntimeException diff --git a/tests/StubsStructureTest.php b/tests/StubsStructureTest.php index dfa85d843..49e5b1fde 100644 --- a/tests/StubsStructureTest.php +++ b/tests/StubsStructureTest.php @@ -6,7 +6,7 @@ use RecursiveIteratorIterator; use StubTests\TestData\Providers\Stubs\PhpCoreStubsProvider; -class StubsStructureTest extends BaseStubsTest +class StubsStructureTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Stubs\StubsTestDataProviders::stubsDirectoriesProvider diff --git a/tests/StubsTypeHintsTest.php b/tests/StubsTypeHintsTest.php index 158e8eede..018fa00c0 100644 --- a/tests/StubsTypeHintsTest.php +++ b/tests/StubsTypeHintsTest.php @@ -14,7 +14,7 @@ use StubTests\TestData\Providers\PhpStormStubsSingleton; use StubTests\TestData\Providers\ReflectionStubsSingleton; -class StubsTypeHintsTest extends BaseStubsTest +class StubsTypeHintsTest extends AbstractBaseStubsTestCase { /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionFunctionsProvider::allFunctionsProvider @@ -35,7 +35,7 @@ public function testFunctionsReturnTypeHints(PHPFunction $function) $unifiedStubsAttributesReturnTypes[$languageVersion] = []; self::convertNullableTypesToUnion($listOfTypes, $unifiedStubsAttributesReturnTypes[$languageVersion]); } - $conditionToCompareWithSignature = BaseStubsTest::isReflectionTypesMatchSignature( + $conditionToCompareWithSignature = AbstractBaseStubsTestCase::isReflectionTypesMatchSignature( $unifiedReflectionReturnTypes, $unifiedStubsReturnTypes ); @@ -45,7 +45,7 @@ public function testFunctionsReturnTypeHints(PHPFunction $function) $unifiedStubsAttributesReturnTypes[getenv('PHP_VERSION')] : $unifiedStubsAttributesReturnTypes['default']; } - $conditionToCompareWithAttribute = BaseStubsTest::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); + $conditionToCompareWithAttribute = AbstractBaseStubsTestCase::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); $testCondition = $conditionToCompareWithSignature || $conditionToCompareWithAttribute; self::assertTrue($testCondition, "Function $functionName has invalid return type. Reflection function has return type " . implode('|', $function->returnTypesFromSignature) . ' but stubs has return type ' . @@ -102,7 +102,7 @@ public function testMethodsReturnTypeHints(PHPClass|PHPInterface $class, PHPMeth self::convertNullableTypesToUnion($listOfTypes, $unifiedStubsAttributesReturnTypes[$languageVersion]); } } - $conditionToCompareWithSignature = BaseStubsTest::isReflectionTypesMatchSignature( + $conditionToCompareWithSignature = AbstractBaseStubsTestCase::isReflectionTypesMatchSignature( $unifiedReflectionReturnTypes, $unifiedStubsReturnTypes ); @@ -112,7 +112,7 @@ public function testMethodsReturnTypeHints(PHPClass|PHPInterface $class, PHPMeth $unifiedStubsAttributesReturnTypes[getenv('PHP_VERSION')] : $unifiedStubsAttributesReturnTypes['default']; } - $conditionToCompareWithAttribute = BaseStubsTest::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); + $conditionToCompareWithAttribute = AbstractBaseStubsTestCase::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); $testCondition = $conditionToCompareWithSignature || $conditionToCompareWithAttribute; self::assertTrue($testCondition, "Method $class->name::$functionName has invalid return type. Reflection method has return type " . implode('|', $method->returnTypesFromSignature) . ' but stubs has return type ' . @@ -246,13 +246,13 @@ private static function compareTypeHintsWithReflection(PHPParameter $parameter, self::convertNullableTypesToUnion($listOfTypes, $unifiedStubsAttributesParameterTypes[$languageVersion]); } $typesFromAttribute = []; - $testCondition = BaseStubsTest::isReflectionTypesMatchSignature($unifiedReflectionParameterTypes, $unifiedStubsParameterTypes); + $testCondition = AbstractBaseStubsTestCase::isReflectionTypesMatchSignature($unifiedReflectionParameterTypes, $unifiedStubsParameterTypes); if (!$testCondition) { if (!empty($unifiedStubsAttributesParameterTypes)) { $typesFromAttribute = !empty($unifiedStubsAttributesParameterTypes[getenv('PHP_VERSION')]) ? $unifiedStubsAttributesParameterTypes[getenv('PHP_VERSION')] : $unifiedStubsAttributesParameterTypes['default']; - $testCondition = BaseStubsTest::isReflectionTypesExistInAttributes($unifiedReflectionParameterTypes, $typesFromAttribute); + $testCondition = AbstractBaseStubsTestCase::isReflectionTypesExistInAttributes($unifiedReflectionParameterTypes, $typesFromAttribute); } } self::assertTrue($testCondition, "Type mismatch $functionName: \$$parameter->name \n From 18f458f79d53a00ed677c86909918bb33e8fcfea Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Wed, 23 Feb 2022 09:16:58 +0100 Subject: [PATCH 017/419] Remove more unnecessary dir args --- .github/workflows/main.yml | 8 ++++---- .github/workflows/testLinks.yml | 2 +- .github/workflows/testPeclExtensions.yml | 10 +++++----- CONTRIBUTING.md | 2 +- README.md | 4 ++-- runTests.sh | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6de1d8421..03846cd64 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,12 +20,12 @@ jobs: PHP_VERSION: ${{matrix.php}} - name: Composer Install - run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer update -d /opt/project/phpstorm-stubs + run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer update env: PHP_VERSION: ${{matrix.php}} - name: Dump Reflection To File - run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionData.json + run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json env: PHP_VERSION: ${{matrix.php}} @@ -41,10 +41,10 @@ jobs: uses: actions/checkout@v2 - name: Composer Install - run: docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs + run: docker-compose -f docker-compose.yml run test_runner composer install - name: Test Stubs Map run: ./tests/Tools/check-stub-map - name: run cs fixer - run: docker-compose -f docker-compose.yml run test_runner composer cs -d /opt/project/phpstorm-stubs + run: docker-compose -f docker-compose.yml run test_runner composer cs diff --git a/.github/workflows/testLinks.yml b/.github/workflows/testLinks.yml index 92eae5cc3..2cc556a8a 100644 --- a/.github/workflows/testLinks.yml +++ b/.github/workflows/testLinks.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v2 - name: Composer Install - run: docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs + run: docker-compose -f docker-compose.yml run test_runner composer install env: PHP_VERSION: '8.0' diff --git a/.github/workflows/testPeclExtensions.yml b/.github/workflows/testPeclExtensions.yml index 2a346e0da..35f48771d 100644 --- a/.github/workflows/testPeclExtensions.yml +++ b/.github/workflows/testPeclExtensions.yml @@ -18,18 +18,18 @@ jobs: PHP_VERSION: '8.0' - name: Composer Install - run: docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs + run: docker-compose -f docker-compose.yml run test_runner composer install - name: Dump Reflection With Pecl To File - run: docker-compose -f docker-compose.yml run pecl_extensions /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionDataPecl.json + run: docker-compose -f docker-compose.yml run pecl_extensions /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionDataPecl.json - name: Dump Reflection Without Pecl To File - run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionData.json + run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json - name: Build Reflection Data With Pecl Only - run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-pecl-to-file.php + run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-pecl-to-file.php - name: Run Tests - run: docker-compose -f docker-compose.yml run -e PHP_VERSION='8.0' test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit /opt/project/phpstorm-stubs/tests/ + run: docker-compose -f docker-compose.yml run -e PHP_VERSION='8.0' test_runner vendor/bin/phpunit tests/ env: PHP_VERSION: '8.0' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2643e32e..33d2e566e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ Please check our [issue tracker] for issues corresponding to the problem you're * Please avoid any unnecessary changes e.g., spacing, line endings, HTML formatting. Remember, these files are NOT for human consumption. We want to preserve meaningful history. * Please try to match existing style for any particular file - formatting, spacing, naming conventions. * Please add corresponding @since tags -* Please run `docker-compose -f docker-compose.yml run test_runner composer cs -d /opt/project/phpstorm-stubs` to check the code style and `docker-compose -f docker-compose.yml run test_runner composer cs-fix -d /opt/project/phpstorm-stubs` to fix it +* Please run `docker-compose -f docker-compose.yml run test_runner composer cs` to check the code style and `docker-compose -f docker-compose.yml run test_runner composer cs-fix` to fix it ## Typehints In Signature * Please ensure that typehints in signature match types returned by reflection. If reflection doesn't return any type please add such typehints via PhpDoc diff --git a/README.md b/README.md index c23ac8a17..6aaed5d64 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,11 @@ Have a full copy of the .git repo within an IDE and provide its path in `Setting The set of extensions enabled by default in PhpStorm can change anytime without prior notice. To learn how to view the enabled extensions, look [here](https://blog.jetbrains.com/phpstorm/2017/03/per-project-php-extension-settings-in-phpstorm-2017-1/). ### How to run tests -1. Execute `docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs --ignore-platform-reqs` +1. Execute `docker-compose -f docker-compose.yml run test_runner composer install --ignore-platform-reqs` 2. Execute `docker-compose -f docker-compose.yml run -e PHP_VERSION=8.0 test_runner vendor/bin/phpunit --testsuite PHP_8.0` ### How to update stub map -Execute `docker-compose -f docker-compose.yml run test_runner /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/generate-stub-map` and commit the resulting `PhpStormStubsMap.php` +Execute `docker-compose -f docker-compose.yml run test_runner /usr/local/bin/php tests/Tools/generate-stub-map` and commit the resulting `PhpStormStubsMap.php` ### License [Apache 2] diff --git a/runTests.sh b/runTests.sh index 322321069..718dcc51a 100755 --- a/runTests.sh +++ b/runTests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash echo "Installing composer packages..." -docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs --ignore-platform-reqs +docker-compose -f docker-compose.yml run test_runner composer install --ignore-platform-reqs phpVersions=("7.1" "7.2" "7.3" "7.4" "8.0" "8.1") for i in "${phpVersions[@]}" do @@ -10,7 +10,7 @@ do echo "Building docker container for PHP_$i..." docker-compose -f docker-compose.yml build echo "Dumping reflection data to file $SCRIPT_DIR/ReflectionData.json for PHP_$i..." - docker-compose -f docker-compose.yml run -e PHP_VERSION="$i" php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionData.json + docker-compose -f docker-compose.yml run -e PHP_VERSION="$i" php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json echo "Running tests agains PHP_$i..." docker-compose -f docker-compose.yml run -e PHP_VERSION="$i" test_runner vendor/bin/phpunit --testsuite PHP_"$i" echo "Removing file $SCRIPT_DIR/ReflectionData.json with reflection data for PHP_$i..." From 0d093a0fe6eb39467616bc038779303282c98589 Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Wed, 23 Feb 2022 19:04:43 +0100 Subject: [PATCH 018/419] Set workdir of all docker images --- tests/DockerImages/7.0/Dockerfile | 2 ++ tests/DockerImages/7.1/Dockerfile | 2 ++ tests/DockerImages/7.2/Dockerfile | 2 ++ tests/DockerImages/7.3/Dockerfile | 2 ++ tests/DockerImages/7.4/Dockerfile | 2 ++ tests/DockerImages/8.0/Dockerfile | 2 ++ tests/DockerImages/8.1/Dockerfile | 2 ++ tests/DockerImages/peclExtensions/Dockerfile | 2 ++ 8 files changed, 16 insertions(+) diff --git a/tests/DockerImages/7.0/Dockerfile b/tests/DockerImages/7.0/Dockerfile index 1239269fa..a87b4db5b 100644 --- a/tests/DockerImages/7.0/Dockerfile +++ b/tests/DockerImages/7.0/Dockerfile @@ -9,3 +9,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/7.1/Dockerfile b/tests/DockerImages/7.1/Dockerfile index 8c6b7c017..1360f1cb8 100644 --- a/tests/DockerImages/7.1/Dockerfile +++ b/tests/DockerImages/7.1/Dockerfile @@ -10,3 +10,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/7.2/Dockerfile b/tests/DockerImages/7.2/Dockerfile index 9c8fd03ac..be9c61db2 100644 --- a/tests/DockerImages/7.2/Dockerfile +++ b/tests/DockerImages/7.2/Dockerfile @@ -10,3 +10,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/7.3/Dockerfile b/tests/DockerImages/7.3/Dockerfile index 99884e7c7..593d08f2f 100644 --- a/tests/DockerImages/7.3/Dockerfile +++ b/tests/DockerImages/7.3/Dockerfile @@ -10,3 +10,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/7.4/Dockerfile b/tests/DockerImages/7.4/Dockerfile index 9f3867fff..1fc15674a 100644 --- a/tests/DockerImages/7.4/Dockerfile +++ b/tests/DockerImages/7.4/Dockerfile @@ -10,3 +10,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/8.0/Dockerfile b/tests/DockerImages/8.0/Dockerfile index ab3ad1e69..6e612e3b1 100644 --- a/tests/DockerImages/8.0/Dockerfile +++ b/tests/DockerImages/8.0/Dockerfile @@ -10,3 +10,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/8.1/Dockerfile b/tests/DockerImages/8.1/Dockerfile index e7be4a2d5..50de63ade 100644 --- a/tests/DockerImages/8.1/Dockerfile +++ b/tests/DockerImages/8.1/Dockerfile @@ -10,3 +10,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/peclExtensions/Dockerfile b/tests/DockerImages/peclExtensions/Dockerfile index 682a8861a..5b9bef4d8 100644 --- a/tests/DockerImages/peclExtensions/Dockerfile +++ b/tests/DockerImages/peclExtensions/Dockerfile @@ -48,3 +48,5 @@ RUN pecl install gnupg RUN docker-php-ext-enable gnupg RUN pecl install uopz RUN docker-php-ext-enable uopz + +WORKDIR /opt/project/phpstorm-stubs From 928cd0645bcc8eb7aa9250bfcfc0362015fd5586 Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Wed, 23 Feb 2022 19:08:55 +0100 Subject: [PATCH 019/419] Minor change --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 0408b4d4a..bc8b7a41d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ rest-client.private.env.json .idea/workspace.xml .idea/shelf +# PHPUnit +phpunit.xml + # Composer vendor composer.lock From 74630bcacf46d51aa90848397e92cf006fe81415 Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Sat, 5 Mar 2022 12:13:25 +0100 Subject: [PATCH 020/419] Convert stub map check into a phpunit test and add it to tests runner --- .github/workflows/main.yml | 2 +- phpunit.xml.dist | 3 +++ runTests.sh | 2 ++ tests/CheckStubMapTest.php | 41 +++++++++++++++++++++++++++++++++++ tests/Tools/check-stub-map | 17 --------------- tests/Tools/generate-stub-map | 2 +- 6 files changed, 48 insertions(+), 19 deletions(-) create mode 100644 tests/CheckStubMapTest.php delete mode 100755 tests/Tools/check-stub-map diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03846cd64..8ddb30ac8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,7 +44,7 @@ jobs: run: docker-compose -f docker-compose.yml run test_runner composer install - name: Test Stubs Map - run: ./tests/Tools/check-stub-map + run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Check_Stub_Map - name: run cs fixer run: docker-compose -f docker-compose.yml run test_runner composer cs diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 54a12fec3..6b60fec5c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -73,5 +73,8 @@ tests/StubsPhpDocTest.php + + tests/CheckStubMapTest.php + diff --git a/runTests.sh b/runTests.sh index 718dcc51a..d80a0324e 100755 --- a/runTests.sh +++ b/runTests.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash echo "Installing composer packages..." docker-compose -f docker-compose.yml run test_runner composer install --ignore-platform-reqs +echo "Checking stub map..." +docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Check_Stub_Map phpVersions=("7.1" "7.2" "7.3" "7.4" "8.0" "8.1") for i in "${phpVersions[@]}" do diff --git a/tests/CheckStubMapTest.php b/tests/CheckStubMapTest.php new file mode 100644 index 000000000..2b4726649 --- /dev/null +++ b/tests/CheckStubMapTest.php @@ -0,0 +1,41 @@ +assertFileEquals( + $this->newMapFile, + $this->oldMapFile, + 'The commited stub map is not up to date. Please regenerate it using ./generate-stub-map' + ); + } + + protected function setUp(): void + { + parent::setUp(); + + $this->newMapFile = tempnam(__DIR__ . '/../', 'stub'); + $generator = escapeshellarg(__DIR__ . '/Tools/generate-stub-map'); + $newStubMap = escapeshellarg($this->newMapFile); + exec("php $generator $newStubMap", $output, $exitCode); + if ($exitCode) { + $this->fail("PHP script $generator exited with code $exitCode: " . implode("\n", $output)); + } + } + + protected function tearDown(): void + { + parent::tearDown(); + + unlink($this->newMapFile); + } +} diff --git a/tests/Tools/check-stub-map b/tests/Tools/check-stub-map deleted file mode 100755 index 62b4619c4..000000000 --- a/tests/Tools/check-stub-map +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuox pipefail - -scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -readonly CURRENT_FILE_HASH=$(md5sum "$scriptPath/../../PhpStormStubsMap.php" | awk '{ print $1 }') - -# Generate the stub map again -php "$scriptPath/generate-stub-map" - -readonly NEW_FILE_HASH=$(md5sum "$scriptPath/../../PhpStormStubsMap.php" | awk '{ print $1 }') - -if [[ "${CURRENT_FILE_HASH}" != "${NEW_FILE_HASH}" ]]; then - echo "The commited stub map is not up to date. Please regenerate it using ./generate-stub-map"; - cat "$scriptPath/../../PhpStormStubsMap.php" - exit 1; -fi diff --git a/tests/Tools/generate-stub-map b/tests/Tools/generate-stub-map index 07a4c18b8..c1e406d46 100644 --- a/tests/Tools/generate-stub-map +++ b/tests/Tools/generate-stub-map @@ -36,7 +36,7 @@ use const PHP_EOL; (function (): void { require __DIR__ . '/../../vendor/autoload.php'; - $mapFile = __DIR__ . '/../../PhpStormStubsMap.php'; + $mapFile = $GLOBALS['argv'][1] ?? __DIR__ . '/../../PhpStormStubsMap.php'; class InvalidConstantNode extends RuntimeException { From 765606d88d48bb73f8459d9ad31deff865c91ae6 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Thu, 24 Mar 2022 17:21:53 +0100 Subject: [PATCH 021/419] Add missing methods and constants of DIO based on #1349 --- PhpStormStubsMap.php | 38 ++++++++++ dio/dio.php | 172 ++++++++++++++++++++++++++++++------------- dio/dio_d.php | 141 +++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+), 51 deletions(-) create mode 100644 dio/dio_d.php diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index c071ca3e2..df73d6553 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -2042,8 +2042,10 @@ final class PhpStormStubsMap 'dio_close' => 'dio/dio.php', 'dio_fcntl' => 'dio/dio.php', 'dio_open' => 'dio/dio.php', + 'dio_raw' => 'dio/dio.php', 'dio_read' => 'dio/dio.php', 'dio_seek' => 'dio/dio.php', + 'dio_serial' => 'dio/dio.php', 'dio_stat' => 'dio/dio.php', 'dio_tcsetattr' => 'dio/dio.php', 'dio_truncate' => 'dio/dio.php', @@ -7327,6 +7329,18 @@ final class PhpStormStubsMap 'FT_PEEK' => 'imap/imap.php', 'FT_PREFETCHTEXT' => 'imap/imap.php', 'FT_UID' => 'imap/imap.php', + 'F_DUPFD' => 'dio/dio_d.php', + 'F_GETFD' => 'dio/dio_d.php', + 'F_GETFL' => 'dio/dio_d.php', + 'F_GETLK' => 'dio/dio_d.php', + 'F_GETOWN' => 'dio/dio_d.php', + 'F_RDLCK' => 'dio/dio_d.php', + 'F_SETFL' => 'dio/dio_d.php', + 'F_SETLK' => 'dio/dio_d.php', + 'F_SETLKW' => 'dio/dio_d.php', + 'F_SETOWN' => 'dio/dio_d.php', + 'F_UNLCK' => 'dio/dio_d.php', + 'F_WRLCK' => 'dio/dio_d.php', 'Frame' => 'winbinder/winbinder.php', 'GD_BUNDLED' => 'gd/gd.php', 'GD_EXTRA_VERSION' => 'gd/gd.php', @@ -10345,6 +10359,18 @@ final class PhpStormStubsMap 'OP_SECURE' => 'imap/imap.php', 'OP_SHORTCACHE' => 'imap/imap.php', 'OP_SILENT' => 'imap/imap.php', + 'O_APPEND' => 'dio/dio_d.php', + 'O_ASYNC' => 'dio/dio_d.php', + 'O_CREAT' => 'dio/dio_d.php', + 'O_EXCL' => 'dio/dio_d.php', + 'O_NDELAY' => 'dio/dio_d.php', + 'O_NOCTTY' => 'dio/dio_d.php', + 'O_NONBLOCK' => 'dio/dio_d.php', + 'O_RDONLY' => 'dio/dio_d.php', + 'O_RDWR' => 'dio/dio_d.php', + 'O_SYNC' => 'dio/dio_d.php', + 'O_TRUNC' => 'dio/dio_d.php', + 'O_WRONLY' => 'dio/dio_d.php', 'PASSWORD_ARGON2I' => 'standard/password.php', 'PASSWORD_ARGON2ID' => 'standard/password.php', 'PASSWORD_ARGON2_DEFAULT_MEMORY_COST' => 'standard/password.php', @@ -12456,6 +12482,18 @@ final class PhpStormStubsMap 'S_FILES' => 'Core/Core_d.php', 'S_INCLUDE' => 'Core/Core_d.php', 'S_INTERNAL' => 'Core/Core_d.php', + 'S_IRGRP' => 'dio/dio_d.php', + 'S_IROTH' => 'dio/dio_d.php', + 'S_IRUSR' => 'dio/dio_d.php', + 'S_IRWXG' => 'dio/dio_d.php', + 'S_IRWXO' => 'dio/dio_d.php', + 'S_IRWXU' => 'dio/dio_d.php', + 'S_IWGRP' => 'dio/dio_d.php', + 'S_IWOTH' => 'dio/dio_d.php', + 'S_IWUSR' => 'dio/dio_d.php', + 'S_IXGRP' => 'dio/dio_d.php', + 'S_IXOTH' => 'dio/dio_d.php', + 'S_IXUSR' => 'dio/dio_d.php', 'S_MAIL' => 'Core/Core_d.php', 'S_MEMORY' => 'Core/Core_d.php', 'S_MISC' => 'Core/Core_d.php', diff --git a/dio/dio.php b/dio/dio.php index 6a81cf376..fdad08aba 100644 --- a/dio/dio.php +++ b/dio/dio.php @@ -12,117 +12,145 @@ * dio_tcsetattr — Sets terminal attributes and baud rate for a serial port * dio_truncate — Truncates file descriptor fd to offset bytes * dio_write — Writes data to fd with optional truncation at length + * dio_raw - Opens a raw direct IO stream. + * dio_serial - Opens a serial direct IO stream. */ /** + * Closes the file descriptor given by fd. + * * dio_close ( resource $fd ) : void - * The function dio_close() closes the file descriptor fd. + * * @link https://www.php.net/manual/en/function.dio-close.php * @param resource $fd The file descriptor returned by dio_open() * @return void */ -function dio_close($fd) {} +function dio_close($fd) : void {} /** - * dio_fcntl ( resource $fd , int $cmd [, mixed $args ] ) : mixed * The dio_fcntl() function performs the operation specified by cmd on the file descriptor fd. + * + * dio_fcntl ( resource $fd , int $cmd [, mixed $args ] ) : mixed + * * Some commands require additional arguments args to be supplied. * @link https://www.php.net/manual/en/function.dio-fcntl.php * @param resource $fd The file descriptor returned by dio_open(). * @param int $cmd The file descriptor returned by dio_open(). * @param mixed ...$args args is an associative array, when cmd is F_SETLK or F_SETLLW, with the following keys: - * start - offset where lock begins - * length - size of locked area. zero means to end of file - * whence - Where l_start is relative to: can be SEEK_SET, SEEK_END and SEEK_CUR - * type - type of lock: can be F_RDLCK (read lock), F_WRLCK (write lock) or F_UNLCK (unlock) + *
    + *
  • "start" - offset where lock begins
  • + *
  • "length" - size of locked area. zero means to end of file
  • + *
  • "whence" - Where l_start is relative to: can be SEEK_SET, SEEK_END and SEEK_CUR
  • + *
  • "type" - type of lock: can be F_RDLCK (read lock), F_WRLCK (write lock) or F_UNLCK (unlock)
  • + *
* @return mixed Returns the result of the C call. */ function dio_fcntl($fd, int $cmd, ...$args) {} /** + * Opens a file (creating it if necessary) at a lower level than theC library input/ouput stream functions allow + * * dio_open ( string $filename , int $flags [, int $mode = 0 ] ) : resource - * The function dio_close() closes the file descriptor fd. + * * @link https://www.php.net/manual/en/function.dio-open.php * @param string $filename The pathname of the file to open. - * @param int $flags - * The flags parameter is a bitwise-ORed value comprising flags from the following list. This value must include one of O_RDONLY, O_WRONLY, or O_RDWR. Additionally, it may include any combination of the other flags from this list. - * O_RDONLY - opens the file for read access. - * O_WRONLY - opens the file for write access. - * O_RDWR - opens the file for both reading and writing. - * O_CREAT - creates the file, if it doesn't already exist. - * O_EXCL - if both O_CREAT and O_EXCL are set and the file already exists, dio_open() will fail. - * O_TRUNC - if the file exists and is opened for write access, the file will be truncated to zero length. - * O_APPEND - write operations write data at the end of the file. - * O_NONBLOCK - sets non blocking mode. - * O_NOCTTY - prevent the OS from assigning the opened file as the process's controlling terminal when opening a TTY device file. - * @param int $mode If flags contains O_CREAT, mode will set the permissions of the file (creation permissions). mode is required for correct operation when O_CREAT is specified in flags and is ignored otherwise. - * The actual permissions assigned to the created file will be affected by the process's umask setting as per usual. + * @param int $flags The flags parameter is a bitwise-ORed value comprising flags from the following list. + *
    + *
  • O_RDONLY - opens the file for read access.
  • + *
  • O_WRONLY - opens the file for write access.
  • + *
  • O_RDWR - opens the file for both reading and writing.
  • + *
  • O_CREAT - creates the file, if it doesn't already exist.
  • + *
  • O_EXCL - if both O_CREAT and O_EXCL are set and the file already exists, dio_open() will fail.
  • + *
  • O_TRUNC - if the file exists and is opened for write access, the file will be truncated to zero length.
  • + *
  • O_APPEND - write operations write data at the end of the file.
  • + *
  • O_NONBLOCK - sets non blocking mode.
  • + *
  • O_NOCTTY - prevent the OS from assigning the opened file as the process's controllingterminal when opening a TTY device file.
  • + *
+ * @param int $mode If flags contains O_CREAT, mode will set the permissions of the file (creation permissions). * @return resource|false A file descriptor or FALSE on error. */ function dio_open(string $filename, int $flags, int $mode = 0) {} /** + * Reads bytes from a file descriptor. + * * dio_read ( resource $fd [, int $len = 1024 ] ) : string - * The function dio_read() reads and returns len bytes from file with descriptor fd. + * * @param resource $fd The file descriptor returned by dio_open(). - * @param int $len The number of bytes to read. If not specified, dio_read() reads 1K sized block. - * @return int The bytes read from fd. + * @param int $len The number of bytes to read. If not specified, dio_read() reads 1k sized block. + * @return string The bytes read from fd. * @link https://www.php.net/manual/en/function.dio-read.php */ -function dio_read($fd, int $len = 1024) {} +function dio_read($fd, int $len = 1024) { } /** - * dio_seek — Seeks to pos on fd from whence + * Seeks to pos on fd from whence + * + * dio_seek ( resource $fd , int $pos [, int $whence = SEEK_SET ] ): int + * * @param resource $fd The file descriptor returned by dio_open(). * @param int $pos The new position. * @param int $whence Specifies how the position pos should be interpreted: - * SEEK_SET (default) - specifies that pos is specified from the beginning of the file. - * SEEK_CUR - Specifies that pos is a count of characters from the current file position. This count may be positive or negative. - * SEEK_END - Specifies that pos is a count of characters from the end of the file. A negative count specifies a position within the current extent of the file; a positive count specifies a position past the current end. If you set the position past the current end, and actually write data, you will extend the file with zeros up to that position. + *
    + *
  • SEEK_SET - (Default) Specifies that pos is specified from the beginning of the file.
  • + *
  • SEEK_CUR - Specifies that pos is a count of characters from the current file position. This count may be positive or negative.
  • + *
  • SEEK_END - Specifies that pos is a count of characters from the end of the file.
  • + *
* @return int * @link https://www.php.net/manual/en/function.dio-seek.php */ function dio_seek($fd, int $pos, int $whence = SEEK_SET) {} /** - * dio_stat — Gets stat information about the file descriptor fd - * @param resource $fd + * Gets stat information about the file descriptor fd + * + * dio_stat ( resource $fd ) : array + * + * @param resource $fd The file descriptor returned by dio_open(). * @return array|null Returns an associative array with the following keys: - * "device" - device - * "inode" - inode - * "mode" - mode - * "nlink" - number of hard links - * "uid" - user id - * "gid" - group id - * "device_type" - device type (if inode device) - * "size" - total size in bytes - * "blocksize" - blocksize - * "blocks" - number of blocks allocated - * "atime" - time of last access - * "mtime" - time of last modification - * "ctime" - time of last change + *
    + *
  • "device" - device
  • + *
  • "inode" - inode
  • + *
  • "mode" - mode
  • + *
  • "nlink" - number of hard links
  • + *
  • "uid" - user id
  • + *
  • "gid" - group id
  • + *
  • "device_type" - device type (if inode device)
  • + *
  • "size" - total size in bytes
  • + *
  • "blocksize" - blocksize
  • + *
  • "blocks" - number of blocks allocated
  • + *
  • "atime" - time of last access
  • + *
  • "mtime" - time of last modification
  • + *
  • "ctime" - time of last change
  • + *
* On error dio_stat() returns NULL. * @link https://www.php.net/manual/en/function.dio-stat.php */ function dio_stat($fd) {} /** + * Sets terminal attributes and baud rate for a serial port + * * dio_tcsetattr ( resource $fd , array $options ) : bool - * dio_tcsetattr — Sets terminal attributes and baud rate for a serial port + * * @param resource $fd The file descriptor returned by dio_open(). * @param array $options The currently available options are: - * 'baud' - baud rate of the port - can be 38400,19200,9600,4800,2400,1800, 1200,600,300,200,150,134,110,75 or 50, default value is 9600. - * 'bits' - data bits - can be 8,7,6 or 5. Default value is 8. - * 'stop' - stop bits - can be 1 or 2. Default value is 1. - * 'parity' - can be 0,1 or 2. Default value is 0. + *
    + *
  • "baud" - baud rate of the port - can be 38400, 19200, 9600, 4800, 2400, 1800, 1200, 600, 300, 200, 150, 134, 110, 75 or 50, default value is 9600.
  • + *
  • "bits" - data bits - can be 8,7,6 or 5. Default value is 8.
  • + *
  • "stop" - stop bits - can be 1 or 2. Default value is 1.
  • + *
  • "parity" - can be 0,1 or 2. Default value is 0.
  • + *
* @return void * @link https://www.php.net/manual/en/function.dio-tcsetattr.php */ function dio_tcsetattr($fd, array $options) {} /** + * Truncates a file to at most offset bytes in size. + * * dio_truncate ( resource $fd , int $offset ) : bool - * dio_truncate() truncates a file to at most offset bytes in size. + * * If the file previously was larger than this size, the extra data is lost. * If the file previously was shorter, it is unspecified whether the file is left unchanged or is extended. * In the latter case the extended part reads as zero bytes. @@ -134,8 +162,10 @@ function dio_tcsetattr($fd, array $options) {} function dio_truncate($fd, int $offset) {} /** + * Writes data to fd with optional truncation at length + * * dio_write ( resource $fd , string $data [, int $len = 0 ] ) : int - * dio_write — Writes data to fd with optional truncation at length + * * @link https://www.php.net/manual/en/function.dio-write.php * @param resource $fd The file descriptor returned by dio_open(). * @param string $data The written data. @@ -143,3 +173,43 @@ function dio_truncate($fd, int $offset) {} * @return int Returns the number of bytes written to fd. */ function dio_write($fd, string $data, int $len = 0) {} + +/** + * Opens a raw direct IO stream. + * + * dio_raw ( string filename , string mode [, array options] ) : ?resource + * + * @param string $filename The pathname of the file to open. + * @param string $mode The mode parameter specifies the type of access you require to the stream (as fopen()). + * @param array|null $options The currently available options are: + *
    + *
  • "data_rate" - baud rate of the port - can be 75, 110, 134, 150, 300, 600, 1200, 1800, 2400, 4800, 7200, 9600, 14400, 19200, 38400, 57600, 115200, 56000, 128000 or 256000 default value is 9600.
  • + *
  • "data_bits" - can be 8, 7, 6 or 5. Default value is 8.
  • + *
  • "stop_bits" - can be 1 or 2. Default value is 1.
  • + *
  • "parity" - can be 0, 1 or 2. Default value is 0.
  • + *
  • "flow_control" - can be 0 or 1. Default value is 1.
  • + *
  • "is_canonical" - can be 0 or 1. Default value is 1.
  • + *
+ * @return resource|null A stream resource or null on error. + */ +function dio_raw(string $filename, string $mode, ?array $options) {} + +/** + * Opens a serial direct IO stream. + * + * dio_serial ( string $filename , string $mode [, array $options = null] ) : ?resource + * + * @param string $filename The pathname of the file to open. + * @param string $mode The mode parameter specifies the type of access you require to the stream (as fopen()). + * @param array|null $options The currently available options are: + *
    + *
  • "data_rate" - baud rate of the port - can be 75, 110, 134, 150, 300, 600, 1200, 1800, 2400, 4800, 7200, 9600, 14400, 19200, 38400, 57600, 115200, 56000, 128000 or 256000 default value is 9600.
  • + *
  • "data_bits" - can be 8, 7, 6 or 5. Default value is 8.
  • + *
  • "stop_bits" - can be 1 or 2. Default value is 1.
  • + *
  • "parity" - can be 0, 1 or 2. Default value is 0.
  • + *
  • "flow_control" - can be 0 or 1. Default value is 1.
  • + *
  • "is_canonical" - can be 0 or 1. Default value is 1.
  • + *
+ * @return resource|null A stream resource or null on error. + */ +function dio_serial(string $filename, string $mode, ?array $options) {} diff --git a/dio/dio_d.php b/dio/dio_d.php new file mode 100644 index 000000000..c396a5c91 --- /dev/null +++ b/dio/dio_d.php @@ -0,0 +1,141 @@ + Date: Thu, 24 Mar 2022 18:25:38 +0100 Subject: [PATCH 022/419] CS Fixer fixes --- dio/dio.php | 4 ++-- dio/dio_d.php | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dio/dio.php b/dio/dio.php index fdad08aba..4bf112b00 100644 --- a/dio/dio.php +++ b/dio/dio.php @@ -25,7 +25,7 @@ * @param resource $fd The file descriptor returned by dio_open() * @return void */ -function dio_close($fd) : void {} +function dio_close($fd): void {} /** * The dio_fcntl() function performs the operation specified by cmd on the file descriptor fd. @@ -81,7 +81,7 @@ function dio_open(string $filename, int $flags, int $mode = 0) {} * @return string The bytes read from fd. * @link https://www.php.net/manual/en/function.dio-read.php */ -function dio_read($fd, int $len = 1024) { } +function dio_read($fd, int $len = 1024) {} /** * Seeks to pos on fd from whence diff --git a/dio/dio_d.php b/dio/dio_d.php index c396a5c91..97c47e79f 100644 --- a/dio/dio_d.php +++ b/dio/dio_d.php @@ -41,9 +41,6 @@ * F_WRLCK - */ -/** - */ - /** * O_RDONLY - opens the file for read access. */ From 9b04acc83c0e45c32866aac4555dfb80909ae6f9 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Mon, 28 Mar 2022 16:35:49 +0200 Subject: [PATCH 023/419] added new GD functions --- gd/gd.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gd/gd.php b/gd/gd.php index c7292c2d4..1fe888ee7 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -862,6 +862,15 @@ function imagesetstyle(GdImage $image, array $style): bool {} */ function imagecreatefrompng(string $filename): GdImage|false {} +/** + * Create a new image from file or URL + * @link https://www.php.net/manual/function.imagecreatefromavif.php + * @param string $filename Path to the AVIF raster image. + * @return GdImage|false returns an image object representing the image obtained from the given filename + * @since 8.1.0 + */ +function imagecreatefromavif(string $filename): GdImage|false {} + /** * Create a new image from file or URL * @link https://php.net/manual/en/function.imagecreatefromgif.php @@ -2904,6 +2913,19 @@ function imagegetinterpolation(GdImage $image): int {} * @since 8.1 */ define('IMG_WEBP_LOSSLESS', 101); + +/** + * Outputs or saves a AVIF Raster image from the given image + * @link https://www.php.net/manual/function.imageavif.php + * @param GdImage $image A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor(). + * @param resource|string|null $file The path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or null, the raw image stream will be output directly. + * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, larger file). If -1 is provided, the default value 30 is used. + * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) to 10 (fast, larger file). If -1 is provided, the default value 6 is used. + * @return bool Returns true on success or false on failure. However, if libgd fails to output the image, this function returns true. + * @sine 8.1.0 + */ +function imageavif(GdImage $image, string|null $file = null, int $quality = -1, int $speed = -1): bool {} + /** * Return an image containing the affine tramsformed src image, using an optional clipping area * @link https://secure.php.net/manual/en/function.imageaffine.php From aa9ea181d703814bbd3d258873b0a784593f33d6 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Mon, 28 Mar 2022 16:48:54 +0200 Subject: [PATCH 024/419] fixed typos --- gd/gd.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gd/gd.php b/gd/gd.php index 1fe888ee7..a0a5b53c8 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -867,7 +867,7 @@ function imagecreatefrompng(string $filename): GdImage|false {} * @link https://www.php.net/manual/function.imagecreatefromavif.php * @param string $filename Path to the AVIF raster image. * @return GdImage|false returns an image object representing the image obtained from the given filename - * @since 8.1.0 + * @since 8.1 */ function imagecreatefromavif(string $filename): GdImage|false {} @@ -2922,7 +2922,7 @@ function imagegetinterpolation(GdImage $image): int {} * @param int $quality quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, larger file). If -1 is provided, the default value 30 is used. * @param int $speed speed is optional, and ranges from 0 (slow, smaller file) to 10 (fast, larger file). If -1 is provided, the default value 6 is used. * @return bool Returns true on success or false on failure. However, if libgd fails to output the image, this function returns true. - * @sine 8.1.0 + * @since 8.1 */ function imageavif(GdImage $image, string|null $file = null, int $quality = -1, int $speed = -1): bool {} From 4b53de38a1e06cc8b0e6fc2e3c4770d161568b3d Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:11:42 +0200 Subject: [PATCH 025/419] updated stubs map --- PhpStormStubsMap.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index df73d6553..3a60e4512 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -2932,6 +2932,7 @@ final class PhpStormStubsMap 'imagealphablending' => 'gd/gd.php', 'imageantialias' => 'gd/gd.php', 'imagearc' => 'gd/gd.php', + 'imageavif' => 'gd/gd.php', 'imagebmp' => 'gd/gd.php', 'imagechar' => 'gd/gd.php', 'imagecharup' => 'gd/gd.php', @@ -2958,6 +2959,7 @@ final class PhpStormStubsMap 'imagecopyresampled' => 'gd/gd.php', 'imagecopyresized' => 'gd/gd.php', 'imagecreate' => 'gd/gd.php', + 'imagecreatefromavif' => 'gd/gd.php', 'imagecreatefrombmp' => 'gd/gd.php', 'imagecreatefromgd' => 'gd/gd.php', 'imagecreatefromgd2' => 'gd/gd.php', From de420f6463dbf431e7fa1c187ac8d31ceaa74ea9 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 31 Mar 2022 10:36:47 +0200 Subject: [PATCH 026/419] [phpstorm-stubs] remove redundant compatibility fix --- Core/Core_c.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index d2abb7aff..b4f6ebe0e 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -43,7 +43,7 @@ interface IteratorAggregate extends Traversable /** * Retrieve an external iterator * @link https://php.net/manual/en/iteratoraggregate.getiterator.php - * @return Traversable|TValue[] An instance of an object implementing Iterator or + * @return Traversable An instance of an object implementing Iterator or * Traversable * @throws Exception on failure. */ From 690203c46d1cb2128a370c6c4f2cf6c2c69711b2 Mon Sep 17 00:00:00 2001 From: Vasek Purchart Date: Wed, 30 Mar 2022 16:19:44 +0200 Subject: [PATCH 027/419] fix DOMNode & DOMElement property types --- dom/dom_c.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dom/dom_c.php b/dom/dom_c.php index 75c9348ce..9db0a1f57 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -22,7 +22,7 @@ class DOMNode public $nodeName; /** - * @var string + * @var string|null * The value of this node, depending on its type * @link https://php.net/manual/en/class.domnode.php#domnode.props.nodevalue */ @@ -119,7 +119,7 @@ class DOMNode public $prefix; /** - * @var string + * @var string|null * Returns the local part of the qualified name of this node. * @link https://php.net/manual/en/class.domnode.php#domnode.props.localname */ @@ -1597,35 +1597,35 @@ public function __construct( class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode { /** - * @var DOMElement|null + * @var DOMNode|null * The parent of this node. If there is no such node, this returns NULL. * @link https://php.net/manual/en/class.domnode.php#domnode.props.parentnode */ public $parentNode; /** - * @var DOMElement|null + * @var DOMNode|null * The first child of this node. If there is no such node, this returns NULL. * @link https://php.net/manual/en/class.domnode.php#domnode.props.firstchild */ public $firstChild; /** - * @var DOMElement|null + * @var DOMNode|null * The last child of this node. If there is no such node, this returns NULL. * @link https://php.net/manual/en/class.domnode.php#domnode.props.lastchild */ public $lastChild; /** - * @var DOMElement|null + * @var DOMNode|null * The node immediately preceding this node. If there is no such node, this returns NULL. * @link https://php.net/manual/en/class.domnode.php#domnode.props.previoussibling */ public $previousSibling; /** - * @var DOMElement|null + * @var DOMNode|null * The node immediately following this node. If there is no such node, this returns NULL. * @link https://php.net/manual/en/class.domnode.php#domnode.props.nextsibling */ From 83e5ea92c3f3c77721f5525ab55e88df4e956713 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 31 Mar 2022 16:08:49 +0200 Subject: [PATCH 028/419] Revert "[phpstorm-stubs] remove redundant compatibility fix" This reverts commit fa229846721f4844c5ddcc4176f0b19b8d2a5e45. Filled WI-65964 --- Core/Core_c.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index b4f6ebe0e..d2abb7aff 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -43,7 +43,7 @@ interface IteratorAggregate extends Traversable /** * Retrieve an external iterator * @link https://php.net/manual/en/iteratoraggregate.getiterator.php - * @return Traversable An instance of an object implementing Iterator or + * @return Traversable|TValue[] An instance of an object implementing Iterator or * Traversable * @throws Exception on failure. */ From 385f4627a8aae0d47b5496e87638354e3bdb30d4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 1 Apr 2022 15:02:14 +0200 Subject: [PATCH 029/419] mark enum methods as pure --- Core/Core_c.php | 7 +++++++ Reflection/ReflectionEnumBackedCase.php | 1 + Reflection/ReflectionEnumUnitCase.php | 2 ++ 3 files changed, 10 insertions(+) diff --git a/Core/Core_c.php b/Core/Core_c.php index d2abb7aff..7530b0cb8 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -905,6 +905,7 @@ interface UnitEnum /** * @return static[] */ + #[Pure] public static function cases(): array; } @@ -919,12 +920,14 @@ interface BackedEnum extends UnitEnum * @param int|string $value * @return static */ + #[Pure] public static function from(int|string $value): static; /** * @param int|string $value * @return static|null */ + #[Pure] public static function tryFrom(int|string $value): ?static; } @@ -942,12 +945,14 @@ interface IntBackedEnum extends BackedEnum * @param int $value * @return static */ + #[Pure] public static function from(int $value): static; /** * @param int $value * @return static|null */ + #[Pure] public static function tryFrom(int $value): ?static; } @@ -961,8 +966,10 @@ interface StringBackedEnum extends BackedEnum { public readonly string $value; + #[Pure] public static function from(string $value): static; + #[Pure] public static function tryFrom(string $value): ?static; } diff --git a/Reflection/ReflectionEnumBackedCase.php b/Reflection/ReflectionEnumBackedCase.php index 4db1bbc1a..4409ba0a2 100644 --- a/Reflection/ReflectionEnumBackedCase.php +++ b/Reflection/ReflectionEnumBackedCase.php @@ -8,5 +8,6 @@ class ReflectionEnumBackedCase extends ReflectionEnumUnitCase { public function __construct(object|string $class, string $constant) {} + #[Pure] public function getBackingValue(): int|string {} } diff --git a/Reflection/ReflectionEnumUnitCase.php b/Reflection/ReflectionEnumUnitCase.php index 8875b3264..3b403e234 100644 --- a/Reflection/ReflectionEnumUnitCase.php +++ b/Reflection/ReflectionEnumUnitCase.php @@ -8,10 +8,12 @@ class ReflectionEnumUnitCase extends ReflectionClassConstant { public function __construct(object|string $class, string $constant) {} + #[Pure] public function getValue(): UnitEnum {} /** * @return ReflectionEnum */ + #[Pure] public function getEnum(): ReflectionEnum {} } From 4de5df7ca4230977dcf66ff31d21cdd3e42cb5a0 Mon Sep 17 00:00:00 2001 From: Daniel Reiche Date: Wed, 6 Apr 2022 11:05:35 +0200 Subject: [PATCH 030/419] add throws statements to indicate possible RedisException's --- redis/Redis.php | 428 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 428 insertions(+) diff --git a/redis/Redis.php b/redis/Redis.php index 03ca215fe..3c7d33128 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -127,6 +127,8 @@ public function __construct() {} * * @return bool TRUE on success, FALSE on error * + * @throws RedisException + * * @example *
      * $redis->connect('127.0.0.1', 6379);
@@ -155,6 +157,8 @@ public function connect(
      * @param float  $readTimeout   value in seconds (optional, default is 0 meaning unlimited)
      *
      * @return bool TRUE on success, FALSE on error
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->connect(%parametersList%)')]
     public function open(
@@ -170,6 +174,8 @@ public function open(
      * A method to determine if a phpredis object thinks it's connected to a server
      *
      * @return bool Returns TRUE if phpredis thinks it's connected and FALSE if not
+     *
+     * @throws RedisException
      */
     public function isConnected() {}
 
@@ -177,6 +183,8 @@ public function isConnected() {}
      * Retrieve our host or unix socket that we're connected to
      *
      * @return string|false The host or unix socket we're connected to or FALSE if we're not connected
+     *
+     * @throws RedisException
      */
     public function getHost() {}
 
@@ -184,6 +192,8 @@ public function getHost() {}
      * Get the port we're connected to
      *
      * @return int|false Returns the port we're connected to or FALSE if we're not connected
+     *
+     * @throws RedisException
      */
     public function getPort() {}
 
@@ -192,6 +202,8 @@ public function getPort() {}
      *
      * @return int|bool Returns the database number (int) phpredis thinks it's pointing to
      * or FALSE if we're not connected
+     *
+     * @throws RedisException
      */
     public function getDbNum() {}
 
@@ -199,6 +211,8 @@ public function getDbNum() {}
      * Get the (write) timeout in use for phpredis
      *
      * @return float|false The timeout (DOUBLE) specified in our connect call or FALSE if we're not connected
+     *
+     * @throws RedisException
      */
     public function getTimeout() {}
 
@@ -207,6 +221,8 @@ public function getTimeout() {}
      *
      * @return float|bool Returns the read timeout (which can be set using setOption and Redis::OPT_READ_TIMEOUT)
      * or FALSE if we're not connected
+     *
+     * @throws RedisException
      */
     public function getReadTimeout() {}
 
@@ -217,6 +233,8 @@ public function getReadTimeout() {}
      * (which will only be set if connected with pconnect),
      * NULL if we're not using a persistent ID,
      * and FALSE if we're not connected
+     *
+     * @throws RedisException
      */
     public function getPersistentID() {}
 
@@ -225,6 +243,8 @@ public function getPersistentID() {}
      *
      * @return string|null|bool Returns the password used to authenticate a phpredis session or NULL if none was used,
      * and FALSE if we're not connected
+     *
+     * @throws RedisException
      */
     public function getAuth() {}
 
@@ -250,6 +270,8 @@ public function getAuth() {}
      *
      * @return bool TRUE on success, FALSE on ertcnror.
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * $redis->pconnect('127.0.0.1', 6379);
@@ -285,6 +307,8 @@ public function pconnect(
      * @param float  $readTimeout
      *
      * @return bool
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->pconnect(%parametersList%)')]
     public function popen(
@@ -304,6 +328,8 @@ public function popen(
      * @since >= 4.2 Closing a persistent connection requires PhpRedis
      *
      * @return bool TRUE on success, FALSE on error
+     *
+     * @throws RedisException
      */
     public function close() {}
 
@@ -317,6 +343,8 @@ public function close() {}
      *
      * @return bool TRUE on success and FALSE on failure
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/swapdb
      * @since >= 4.0
      * @example
@@ -335,6 +363,8 @@ public function swapdb(int $db1, int $db2) {}
      *
      * @return bool TRUE on success, FALSE on error
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);        // don't serialize data
@@ -363,6 +393,8 @@ public function setOption($option, $value) {}
      *
      * @return mixed|null Parameter value
      *
+     * @throws RedisException
+     *
      * @see setOption()
      * @example
      * // return option value
@@ -389,6 +421,8 @@ public function ping($message = null) {}
      *
      * @return string|Redis Returns message or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/echo
      */
     public function echo($message) {}
@@ -401,6 +435,8 @@ public function echo($message) {}
      * @return string|mixed|false|Redis If key didn't exist, FALSE is returned or Redis if in multi mode
      * Otherwise, the value related to this key is returned
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/get
      * @example
      * 
@@ -451,6 +487,8 @@ public function get($key) {}
      *
      * @return bool|Redis TRUE if the command is successful or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link     https://redis.io/commands/set
      */
     public function set($key, $value, $timeout = null) {}
@@ -464,6 +502,8 @@ public function set($key, $value, $timeout = null) {}
      *
      * @return bool|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/setex
      * @example $redis->setex('key', 3600, 'value'); // sets key → value, with 1h TTL.
      */
@@ -479,6 +519,8 @@ public function setex($key, $expire, $value) {}
      *
      * @return bool|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/psetex
      * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL.
      */
@@ -492,6 +534,8 @@ public function psetex($key, $expire, $value) {}
      *
      * @return bool|array|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/setnx
      * @example
      * 
@@ -509,6 +553,8 @@ public function setnx($key, $value) {}
      *
      * @return int|Redis Number of keys deleted or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/del
      * @example
      * 
@@ -529,6 +575,8 @@ public function del($key1, ...$otherKeys) {}
      * @param   string          $key3
      *
      * @return int|Redis Number of keys deleted or Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: "%class%->del(%parametersList%)")]
     public function delete($key1, $key2 = null, $key3 = null) {}
@@ -543,6 +591,8 @@ public function delete($key1, $key2 = null, $key3 = null) {}
      *
      * @return int|Redis Number of keys unlinked or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/unlink
      * @example
      * 
@@ -568,6 +618,8 @@ public function unlink($key1, $key2 = null, $key3 = null) {}
      * @return static|Redis returns the Redis instance and enters multi-mode or Redis if in multi mode
      * Once in multi-mode, all subsequent method calls return the same object until exec() is called.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/multi
      * @example
      * 
@@ -595,6 +647,8 @@ public function multi($mode = Redis::MULTI) {}
      * Pay attention, that Pipeline is not a transaction, so you can get unexpected
      * results in case of big pipelines and small read/write timeouts.
      *
+     * @throws RedisException
+     *
      * @link   https://redis.io/topics/pipelining
      * @example
      * 
@@ -619,12 +673,16 @@ public function pipeline() {}
     /**
      * @return void|array|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @see multi()
      * @link https://redis.io/commands/exec
      */
     public function exec() {}
 
     /**
+     * @throws RedisException
+     *
      * @see multi()
      * @link https://redis.io/commands/discard
      */
@@ -637,6 +695,8 @@ public function discard() {}
      *
      * @return void|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/watch
      * @example
      * 
@@ -651,6 +711,8 @@ public function discard() {}
     public function watch($key) {}
 
     /**
+     * @throws RedisException
+     *
      * @see watch()
      * @link    https://redis.io/commands/unwatch
      */
@@ -667,6 +729,8 @@ public function unwatch() {}
      *
      * @return mixed|null|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/subscribe
      * @example
      * 
@@ -699,6 +763,8 @@ public function subscribe($channels, $callback) {}
      *                     The callback will get four arguments ($redis, $pattern, $channel, $message)
      * @return mixed|Redis       Any non-null return value in the callback will be returned to the caller or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/psubscribe
      * @example
      * 
@@ -721,6 +787,8 @@ public function psubscribe($patterns, $callback) {}
      *
      * @return int|Redis Number of clients that received the message or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/publish
      * @example $redis->publish('chan-1', 'hello, world!'); // send message.
      */
@@ -740,6 +808,8 @@ public function publish($channel, $message) {}
      *               values are their counts.
      *   - numpat    Integer return containing the number active pattern subscriptions
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/pubsub
      * @example
      * 
@@ -756,6 +826,8 @@ public function pubsub($keyword, $argument) {}
      *
      * @param array $channels an array of channels to usubscribe
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/unsubscribe
      */
     public function unsubscribe($channels = null) {}
@@ -765,6 +837,8 @@ public function unsubscribe($channels = null) {}
      *
      * @param array $patterns   an array of glob-style patterns to unsubscribe
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/punsubscribe
      */
     public function punsubscribe($patterns = null) {}
@@ -780,6 +854,8 @@ public function punsubscribe($patterns = null) {}
      *
      * @return int|bool|Redis The number of keys tested that do exist or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/exists
      * @link https://github.com/phpredis/phpredis#exists
      * @example
@@ -801,6 +877,8 @@ public function exists($key) {}
      *
      * @return int|Redis the new value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/incr
      * @example
      * 
@@ -820,6 +898,8 @@ public function incr($key) {}
      *
      * @return float|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/incrbyfloat
      * @example
      * 
@@ -839,6 +919,8 @@ public function incrByFloat($key, $increment) {}
      *
      * @return int|Redis the new value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/incrby
      * @example
      * 
@@ -858,6 +940,8 @@ public function incrBy($key, $value) {}
      *
      * @return int|Redis the new value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/decr
      * @example
      * 
@@ -877,6 +961,8 @@ public function decr($key) {}
      *
      * @return int|Redis the new value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/decrby
      * @example
      * 
@@ -898,6 +984,8 @@ public function decrBy($key, $value) {}
      *
      * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/lpush
      * @example
      * 
@@ -924,6 +1012,8 @@ public function lPush($key, ...$value1) {}
      *
      * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/rpush
      * @example
      * 
@@ -948,6 +1038,8 @@ public function rPush($key, ...$value1) {}
      *
      * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/lpushx
      * @example
      * 
@@ -969,6 +1061,8 @@ public function lPushx($key, $value) {}
      *
      * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/rpushx
      * @example
      * 
@@ -989,6 +1083,8 @@ public function rPushx($key, $value) {}
      *
      * @return  mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/lpop
      * @example
      * 
@@ -1007,6 +1103,8 @@ public function lPop($key) {}
      *
      * @return  mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/rpop
      * @example
      * 
@@ -1029,6 +1127,8 @@ public function rPop($key) {}
      *
      * @return array|Redis ['listName', 'element'] or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/blpop
      * @example
      * 
@@ -1072,6 +1172,8 @@ public function blPop($keys, $timeout) {}
      *
      * @return array|Redis ['listName', 'element'] or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/brpop
      * @example
      * 
@@ -1112,6 +1214,8 @@ public function brPop(array $keys, $timeout) {}
      * @return int|bool|Redis The size of the list identified by Key exists or Redis if in multi mode
      * bool FALSE if the data type identified by Key is not list
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/llen
      * @example
      * 
@@ -1131,6 +1235,8 @@ public function lLen($key) {}
      * @param string $key
      *
      * @return int|Redis The size of the list identified by Key exists or Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->lLen(%parametersList%)')]
     public function lSize($key) {}
@@ -1145,6 +1251,8 @@ public function lSize($key) {}
      *
      * @return mixed|bool|Redis the element at this index or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * Bool FALSE if the key identifies a non-string data type, or no value corresponds to this index in the list Key.
      *
      * @link    https://redis.io/commands/lindex
@@ -1166,6 +1274,8 @@ public function lIndex($key, $index) {}
      * @param string $key
      * @param int $index
      * @return mixed|bool|Redis the element at this index or Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->lIndex(%parametersList%)')]
     public function lGet($key, $index) {}
@@ -1180,6 +1290,8 @@ public function lGet($key, $index) {}
      * @return bool|Redis TRUE if the new value is setted or Redis if in multi mode
      * FALSE if the index is out of range, or data type identified by key is not a list.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/lset
      * @example
      * 
@@ -1204,6 +1316,8 @@ public function lSet($key, $index, $value) {}
      *
      * @return array|Redis containing the values in specified range or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/lrange
      * @example
      * 
@@ -1222,6 +1336,8 @@ public function lRange($key, $start, $end) {}
      * @param int       $start
      * @param int       $end
      * @return array|Redis returns Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->lRange(%parametersList%)')]
     public function lGetRange($key, $start, $end) {}
@@ -1235,6 +1351,8 @@ public function lGetRange($key, $start, $end) {}
      *
      * @return array|false|Redis Bool return FALSE if the key identify a non-list value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link        https://redis.io/commands/ltrim
      * @example
      * 
@@ -1254,6 +1372,8 @@ public function lTrim($key, $start, $stop) {}
      * @param string    $key
      * @param int       $start
      * @param int       $stop
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->lTrim(%parametersList%)')]
     public function listTrim($key, $start, $stop) {}
@@ -1270,6 +1390,8 @@ public function listTrim($key, $start, $stop) {}
      * @return int|bool|Redis the number of elements to remove or Redis if in multi mode
      * bool FALSE if the value identified by key is not a list.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/lrem
      * @example
      * 
@@ -1292,6 +1414,8 @@ public function lRem($key, $value, $count) {}
      * @param string $key
      * @param string $value
      * @param int $count
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->lRem(%parametersList%)')]
     public function lRemove($key, $value, $count) {}
@@ -1308,6 +1432,8 @@ public function lRemove($key, $value, $count) {}
      *
      * @return int|Redis The number of the elements in the list, -1 if the pivot didn't exists or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/linsert
      * @example
      * 
@@ -1338,6 +1464,8 @@ public function lInsert($key, $position, $pivot, $value) {}
      * @return int|bool|Redis The number of elements added to the set or Redis if in multi mode
      * If this value is already in the set, FALSE is returned
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sadd
      * @example
      * 
@@ -1355,6 +1483,8 @@ public function sAdd($key, ...$value1) {}
      *
      * @return int|Redis The number of elements removed from the set or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/srem
      * @example
      * 
@@ -1374,6 +1504,8 @@ public function sRem($key, ...$member1) {}
      *
      * @param   string  $key
      * @param   string|mixed  ...$member1
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->sRem(%parametersList%)')]
     public function sRemove($key, ...$member1) {}
@@ -1388,6 +1520,8 @@ public function sRemove($key, ...$member1) {}
      * @return bool|Redis If the operation is successful, return TRUE or Redis if in multi mode
      * If the srcKey and/or dstKey didn't exist, and/or the member didn't exist in srcKey, FALSE is returned.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/smove
      * @example
      * 
@@ -1410,6 +1544,8 @@ public function sMove($srcKey, $dstKey, $member) {}
      *
      * @return bool|Redis TRUE if value is a member of the set at key key, FALSE otherwise or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sismember
      * @example
      * 
@@ -1428,6 +1564,8 @@ public function sIsMember($key, $value) {}
      *
      * @param string       $key
      * @param string|mixed $value
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->sIsMember(%parametersList%)')]
     public function sContains($key, $value) {}
@@ -1439,6 +1577,8 @@ public function sContains($key, $value) {}
      *
      * @return int|Redis the cardinality of the set identified by key, 0 if the set doesn't exist or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/scard
      * @example
      * 
@@ -1460,6 +1600,8 @@ public function sCard($key) {}
      * @return string|mixed|array|bool|Redis "popped" values or Redis if in multi mode
      * bool FALSE if set identified by key is empty or doesn't exist.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/spop
      * @example
      * 
@@ -1491,6 +1633,8 @@ public function sPop($key, $count = 1) {}
      * @return string|mixed|array|bool|Redis value(s) from the set or Redis if in multi mode
      * bool FALSE if set identified by key is empty or doesn't exist and count argument isn't passed.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/srandmember
      * @example
      * 
@@ -1523,6 +1667,8 @@ public function sRandMember($key, $count = 1) {}
      * @return array|false|Redis contain the result of the intersection between those keys or Redis if in multi mode
      * If the intersection between the different sets is empty, the return value will be empty array.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sinter
      * @example
      * 
@@ -1558,6 +1704,8 @@ public function sInter($key1, ...$otherKeys) {}
      *
      * @return int|false|Redis The cardinality of the resulting set, or FALSE in case of a missing key or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sinterstore
      * @example
      * 
@@ -1595,6 +1743,8 @@ public function sInterStore($dstKey, $key1, ...$otherKeys) {}
      *
      * @return array|Redis string[] The union of all these sets or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sunionstore
      * @example
      * 
@@ -1630,6 +1780,8 @@ public function sUnion($key1, ...$otherKeys) {}
      *
      * @return int|Redis Any number of keys corresponding to sets in redis or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sunionstore
      * @example
      * 
@@ -1668,6 +1820,8 @@ public function sUnionStore($dstKey, $key1, ...$otherKeys) {}
      *
      * @return array|Redis string[] The difference of the first set will all the others or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sdiff
      * @example
      * 
@@ -1702,6 +1856,8 @@ public function sDiff($key1, ...$otherKeys) {}
      *
      * @return int|false|Redis The cardinality of the resulting set, or FALSE in case of a missing key or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sdiffstore
      * @example
      * 
@@ -1736,6 +1892,8 @@ public function sDiffStore($dstKey, $key1, ...$otherKeys) {}
      *
      * @return array|Redis An array of elements, the contents of the set or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/smembers
      * @example
      * 
@@ -1764,6 +1922,8 @@ public function sMembers($key) {}
      *
      * @param  string  $key
      * @return array|Redis   An array of elements, the contents of the set or Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->sMembers(%parametersList%)')]
     public function sGetMembers($key) {}
@@ -1778,6 +1938,8 @@ public function sGetMembers($key) {}
      *
      * @return array|false|Redis PHPRedis will return an array of keys or FALSE when we're done iterating or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sscan
      * @example
      * 
@@ -1799,6 +1961,8 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) {}
      *
      * @return string|mixed|Redis A string (mixed, if used serializer), the previous value located at this key or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/getset
      * @example
      * 
@@ -1814,6 +1978,8 @@ public function getSet($key, $value) {}
      *
      * @return string|Redis an existing key in redis or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/randomkey
      * @example
      * 
@@ -1830,6 +1996,8 @@ public function randomKey() {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/select
      * @example
      * 
@@ -1850,6 +2018,8 @@ public function select($dbIndex) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/move
      * @example
      * 
@@ -1870,6 +2040,8 @@ public function move($key, $dbIndex) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/rename
      * @example
      * 
@@ -1886,6 +2058,8 @@ public function rename($srcKey, $dstKey) {}
      *
      * @param   string  $srcKey
      * @param   string  $dstKey
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->rename(%parametersList%)')]
     public function renameKey($srcKey, $dstKey) {}
@@ -1901,6 +2075,8 @@ public function renameKey($srcKey, $dstKey) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/renamenx
      * @example
      * 
@@ -1920,6 +2096,8 @@ public function renameNx($srcKey, $dstKey) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/expire
      * @example
      * 
@@ -1939,6 +2117,8 @@ public function expire($key, $ttl) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/pexpire
      * @example
      * 
@@ -1956,6 +2136,8 @@ public function pExpire($key, $ttl) {}
      * @param   string  $key
      * @param   int     $ttl
      * @return  bool|Redis returns Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->expire(%parametersList%)')]
     public function setTimeout($key, $ttl) {}
@@ -1968,6 +2150,8 @@ public function setTimeout($key, $ttl) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/expireat
      * @example
      * 
@@ -1988,6 +2172,8 @@ public function expireAt($key, $timestamp) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/pexpireat
      * @example
      * 
@@ -2006,6 +2192,8 @@ public function pExpireAt($key, $timestamp) {}
      *
      * @return array|Redis string[] The keys that match a certain pattern or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/keys
      * @example
      * 
@@ -2017,6 +2205,8 @@ public function keys($pattern) {}
 
     /**
      * @param string $pattern
+     *
+     * @throws RedisException
      * @link    https://redis.io/commands/keys
      */
     #[Deprecated(replacement: '%class%->keys(%parametersList%)')]
@@ -2027,6 +2217,8 @@ public function getKeys($pattern) {}
      *
      * @return int|Redis DB size, in number of keys or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/dbsize
      * @example
      * 
@@ -2044,6 +2236,8 @@ public function dbSize() {}
      *
      * @return bool|Redis TRUE if the connection is authenticated, FALSE otherwise or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/auth
      * @example $redis->auth('foobared');
      */
@@ -2054,6 +2248,8 @@ public function auth($password) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/bgrewriteaof
      * @example $redis->bgrewriteaof();
      */
@@ -2068,6 +2264,8 @@ public function bgrewriteaof() {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/slaveof
      * @example
      * 
@@ -2089,6 +2287,8 @@ public function slaveof($host = '127.0.0.1', $port = 6379) {}
      * - SLOGLOG LEN: Integer, the length of the slowLog
      * - SLOWLOG RESET: Boolean, depending on success
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * // Get ten slowLog entries
@@ -2120,6 +2320,8 @@ public function slowLog(string $operation, int $length = null) {}
      *
      * @return string|int|false|Redis for "encoding", int for "refcount" and "idletime", FALSE if the key doesn't exist or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/object
      * @example
      * 
@@ -2137,6 +2339,8 @@ public function object($string = '', $key = '') {}
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      * If a save is already running, this command will fail and return FALSE.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/save
      * @example $redis->save();
      */
@@ -2148,6 +2352,8 @@ public function save() {}
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      * If a save is already running, this command will fail and return FALSE
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/bgsave
      * @example $redis->bgSave();
      */
@@ -2158,6 +2364,8 @@ public function bgsave() {}
      *
      * @return int|Redis timestamp or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/lastsave
      * @example $redis->lastSave();
      */
@@ -2173,6 +2381,8 @@ public function lastSave() {}
      * @return  int|Redis The command returns the number of slaves reached by all the writes performed in the or Redis if in multi mode
      *              context of the current connection
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/wait
      * @example $redis->wait(2, 1000);
      */
@@ -2193,6 +2403,8 @@ public function wait($numSlaves, $timeout) {}
      * - hash:  Redis::REDIS_HASH
      * - other: Redis::REDIS_NOT_FOUND
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/type
      * @example $redis->type('key');
      */
@@ -2206,6 +2418,8 @@ public function type($key) {}
      *
      * @return int|Redis Size of the value after the append or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/append
      * @example
      * 
@@ -2225,6 +2439,8 @@ public function append($key, $value) {}
      *
      * @return string|Redis the substring or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/getrange
      * @example
      * 
@@ -2241,6 +2457,8 @@ public function getRange($key, $start, $end) {}
      * @param   string  $key
      * @param   int     $start
      * @param   int     $end
+     *
+     * @throws RedisException
      */
     #[Deprecated]
     public function substr($key, $start, $end) {}
@@ -2254,6 +2472,8 @@ public function substr($key, $start, $end) {}
      *
      * @return int|Redis the length of the string after it was modified or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/setrange
      * @example
      * 
@@ -2270,6 +2490,8 @@ public function setRange($key, $offset, $value) {}
      * @param string $key
      * @return int|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/strlen
      * @example
      * 
@@ -2300,6 +2522,8 @@ public function strlen($key) {}
      * specify a range with both start and end. If no clear bit is found in the specified range, the
      * function returns -1 as the user specified a clear range and there are no 0 bits in that range.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/bitpos
      * @example
      * 
@@ -2322,6 +2546,8 @@ public function bitpos($key, $bit, $start = 0, $end = null) {}
      *
      * @return int|Redis the bit value (0 or 1) or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/getbit
      * @example
      * 
@@ -2341,6 +2567,8 @@ public function getBit($key, $offset) {}
      *
      * @return int|Redis 0 or 1, the value of the bit before it was set or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/setbit
      * @example
      * 
@@ -2359,6 +2587,8 @@ public function setBit($key, $offset, $value) {}
      *
      * @return int|Redis The number of bits set to 1 in the value behind the input key or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/bitcount
      * @example
      * 
@@ -2381,6 +2611,8 @@ public function bitCount($key) {}
      *
      * @return int|Redis The size of the string stored in the destination key or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/bitop
      * @example
      * 
@@ -2399,6 +2631,7 @@ public function bitOp($operation, $retKey, $key1, ...$otherKeys) {}
      * Removes all entries from the current database.
      *
      * @return bool|Redis Always TRUE or Redis if in multi mode
+     * @throws RedisException
      * @link    https://redis.io/commands/flushdb
      * @example $redis->flushDB();
      */
@@ -2409,6 +2642,8 @@ public function flushDB() {}
      *
      * @return bool|Redis Always TRUE or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/flushall
      * @example $redis->flushAll();
      */
@@ -2429,6 +2664,8 @@ public function flushAll() {}
      * @return array|Redis returns Redis if in multi mode
      * An array of values, or a number corresponding to the number of elements stored if that was used
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sort
      * @example
      * 
@@ -2498,6 +2735,8 @@ public function sort($key, $option = null) {}
      *
      * @return array|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/info
      * @example
      * 
@@ -2516,6 +2755,8 @@ public function info($option = null) {}
      *
      * @return array|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/role
      * @example
      * 
@@ -2535,6 +2776,8 @@ public function role() {}
      *
      * @return bool|Redis `TRUE` in case of success, `FALSE` in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @example $redis->resetStat();
      * @link https://redis.io/commands/config-resetstat
      */
@@ -2547,6 +2790,8 @@ public function resetStat() {}
      *
      * @return int|bool|Redis the time left to live in seconds or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/ttl
      * @example
      * 
@@ -2565,6 +2810,8 @@ public function ttl($key) {}
      *
      * @return int|bool|Redis the time left to live in milliseconds or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/pttl
      * @example
      * 
@@ -2581,6 +2828,8 @@ public function pttl($key) {}
      *
      * @return bool|Redis TRUE if a timeout was removed, FALSE if the key didn’t exist or didn’t have an expiration timer or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/persist
      * @example $redis->persist('key');
      */
@@ -2594,6 +2843,8 @@ public function persist($key) {}
      *
      * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/mset
      * @example
      * 
@@ -2615,6 +2866,8 @@ public function mset(array $array) {}
      *
      * @return array|Redis Array containing the values related to keys in argument or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * $redis->set('key1', 'value1');
@@ -2637,6 +2890,8 @@ public function getMultiple(array $keys) {}
      *
      * @return array|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/mget
      * @example
      * 
@@ -2660,6 +2915,8 @@ public function mGet(array $array) {}
      * @param array $array
      * @return int|Redis 1 (if the keys were set) or 0 (no key was set) or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/msetnx
      */
     public function msetnx(array $array) {}
@@ -2675,6 +2932,8 @@ public function msetnx(array $array) {}
      *
      * @return string|mixed|false|Redis The element that was moved in case of success, FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/rpoplpush
      * @example
      * 
@@ -2718,6 +2977,8 @@ public function rPopLPush($srcKey, $dstKey) {}
      *
      * @return  string|mixed|bool|Redis  The element that was moved in case of success, FALSE in case of timeout or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/brpoplpush
      */
     public function bRPopLPush($srcKey, $dstKey, $timeout) {}
@@ -2736,6 +2997,8 @@ public function bRPopLPush($srcKey, $dstKey, $timeout) {}
      *
      * @return int|Redis Number of values added or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zadd
      * @example
      * 
@@ -2781,6 +3044,8 @@ public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $v
      *
      * @return array|Redis Array containing the values in specified range or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zrange
      * @example
      * 
@@ -2803,6 +3068,8 @@ public function zRange($key, $start, $end, $withscores = null) {}
      *
      * @return int|Redis Number of deleted values or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zrem
      * @example
      * 
@@ -2826,6 +3093,8 @@ public function zRem($key, $member1, ...$otherMembers) {}
      * @param string|mixed ...$otherMembers
      *
      * @return int|Redis Number of deleted values or Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->zRem(%parametersList%)')]
     public function zDelete($key, $member1, ...$otherMembers) {}
@@ -2845,6 +3114,8 @@ public function zDelete($key, $member1, ...$otherMembers) {}
      *
      * @return array|Redis Array containing the values in specified range or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zrevrange
      * @example
      * 
@@ -2875,6 +3146,8 @@ public function zRevRange($key, $start, $end, $withscore = null) {}
      *
      * @return array|Redis Array containing the values in specified range or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zrangebyscore
      * @example
      * 
@@ -2897,6 +3170,8 @@ public function zRangeByScore($key, $start, $end, array $options = []) {}
      * @param array  $options
      *
      * @return array|Redis returns Redis if in multi mode
+     *
+     * @throws RedisException
      */
     public function zRevRangeByScore($key, $start, $end, array $options = []) {}
 
@@ -2914,6 +3189,8 @@ public function zRevRangeByScore($key, $start, $end, array $options = []) {}
      *
      * @return array|false|Redis Array containing the values in the specified range or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zrangebylex
      * @example
      * 
@@ -2938,6 +3215,8 @@ public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) {}
      *
      * @return array|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zrevrangebylex
      */
     public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) {}
@@ -2953,6 +3232,8 @@ public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null)
      *
      * @return int|Redis the size of a corresponding zRangeByScore or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zcount
      * @example
      * 
@@ -2973,6 +3254,8 @@ public function zCount($key, $start, $end) {}
      *
      * @return int|Redis The number of values deleted from the sorted set or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zremrangebyscore
      * @example
      * 
@@ -2988,6 +3271,8 @@ public function zRemRangeByScore($key, $start, $end) {}
      * @param string $key
      * @param float  $start
      * @param float  $end
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->zRemRangeByScore(%parametersList%)')]
     public function zDeleteRangeByScore($key, $start, $end) {}
@@ -3001,6 +3286,8 @@ public function zDeleteRangeByScore($key, $start, $end) {}
      *
      * @return int|Redis The number of values deleted from the sorted set or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zremrangebyrank
      * @example
      * 
@@ -3019,6 +3306,8 @@ public function zRemRangeByRank($key, $start, $end) {}
      * @param string $key
      * @param int    $start
      * @param int    $end
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->zRemRangeByRank(%parametersList%)')]
     public function zDeleteRangeByRank($key, $start, $end) {}
@@ -3030,6 +3319,8 @@ public function zDeleteRangeByRank($key, $start, $end) {}
      *
      * @return int|Redis the set's cardinality or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zsize
      * @example
      * 
@@ -3044,6 +3335,8 @@ public function zCard($key) {}
     /**
      * @param string $key
      * @return int|Redis returns Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->zCard(%parametersList%)')]
     public function zSize($key) {}
@@ -3056,6 +3349,8 @@ public function zSize($key) {}
      *
      * @return float|bool|Redis false if member or key not exists or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zscore
      * @example
      * 
@@ -3074,6 +3369,8 @@ public function zScore($key, $member) {}
      *
      * @return int|false|Redis the item's score, or false if key or member is not exists or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zrank
      * @example
      * 
@@ -3095,6 +3392,8 @@ public function zRank($key, $member) {}
      *
      * @return int|false|Redis the item's score, false - if key or member is not exists or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link   https://redis.io/commands/zrevrank
      */
     public function zRevRank($key, $member) {}
@@ -3108,6 +3407,8 @@ public function zRevRank($key, $member) {}
      *
      * @return float|Redis the new value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zincrby
      * @example
      * 
@@ -3135,6 +3436,8 @@ public function zIncrBy($key, $value, $member) {}
      *
      * @return int|Redis The number of values in the new sorted set or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zunionstore
      * @example
      * 
@@ -3165,6 +3468,8 @@ public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggrega
      * @param array      $ZSetKeys
      * @param array|null $Weights
      * @param string     $aggregateFunction
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->zUnionStore(%parametersList%)')]
     public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {}
@@ -3185,6 +3490,8 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc
      *
      * @return int|Redis The number of values in the new sorted set or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zinterstore
      * @example
      * 
@@ -3219,6 +3526,7 @@ public function zInterStore($output, $zSetKeys, array $weights = null, $aggregat
      * @param $ZSetKeys
      * @param array|null $Weights
      * @param string $aggregateFunction
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->zInterStore(%parametersList%)')]
     public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {}
@@ -3233,6 +3541,8 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc
      *
      * @return array|false|Redis PHPRedis will return matching keys from Redis, or FALSE when iteration is complete or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/zscan
      * @example
      * 
@@ -3257,6 +3567,8 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {}
      * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multi mode
      * if the timeout was reached without an element to pop.
      *
+     * @throws RedisException
+     *
      * @since >= 5.0
      * @link https://redis.io/commands/bzpopmax
      * @example
@@ -3280,6 +3592,8 @@ public function bzPopMax($key1, $key2, $timeout) {}
      * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multi mode
      * if the timeout was reached without an element to pop.
      *
+     * @throws RedisException
+     *
      * @see bzPopMax
      * @since >= 5.0
      * @link https://redis.io/commands/bzpopmin
@@ -3295,6 +3609,8 @@ public function bzPopMin($key1, $key2, $timeout) {}
      * @return array|Redis Either an array with the key member and score of the highest element or an empty array or Redis if in multi mode
      * if there is no element to pop.
      *
+     * @throws RedisException
+     *
      * @since >= 5.0
      * @link https://redis.io/commands/zpopmax
      * @example
@@ -3316,6 +3632,8 @@ public function zPopMax($key, $count = 1) {}
      * @return array|Redis Either an array with the key member and score of the lowest element or an empty array or Redis if in multi mode
      * if there is no element to pop.
      *
+     * @throws RedisException
+     *
      * @since >= 5.0
      * @link https://redis.io/commands/zpopmin
      * @example
@@ -3339,6 +3657,8 @@ public function zPopMin($key, $count = 1) {}
      * - 1 if value didn't exist and was added successfully,
      * - 0 if the value was already present and was replaced, FALSE if there was an error.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hset
      * @example
      * 
@@ -3361,6 +3681,8 @@ public function hSet($key, $hashKey, $value) {}
      *
      * @return  bool|Redis TRUE if the field was set, FALSE if it was already present or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hsetnx
      * @example
      * 
@@ -3381,6 +3703,8 @@ public function hSetNx($key, $hashKey, $value) {}
      *
      * @return string|false|Redis The value, if the command executed successfully BOOL FALSE in case of failure or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hget
      */
     public function hGet($key, $hashKey) {}
@@ -3392,6 +3716,8 @@ public function hGet($key, $hashKey) {}
      *
      * @return int|false|Redis the number of items in a hash, FALSE if the key doesn't exist or isn't a hash or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hlen
      * @example
      * 
@@ -3413,6 +3739,8 @@ public function hLen($key) {}
      *
      * @return int|bool|Redis Number of deleted fields or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hdel
      * @example
      * 
@@ -3443,6 +3771,8 @@ public function hDel($key, $hashKey1, ...$otherHashKeys) {}
      *
      * @return array|Redis An array of elements, the keys of the hash. This works like PHP's array_keys() or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hkeys
      * @example
      * 
@@ -3476,6 +3806,8 @@ public function hKeys($key) {}
      *
      * @return array|Redis An array of elements, the values of the hash. This works like PHP's array_values() or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hvals
      * @example
      * 
@@ -3509,6 +3841,8 @@ public function hVals($key) {}
      *
      * @return array|Redis An array of elements, the contents of the hash or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hgetall
      * @example
      * 
@@ -3543,6 +3877,8 @@ public function hGetAll($key) {}
      *
      * @return bool|Redis If the member exists in the hash table, return TRUE, otherwise return FALSE or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hexists
      * @example
      * 
@@ -3562,6 +3898,8 @@ public function hExists($key, $hashKey) {}
      *
      * @return int|Redis the new value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hincrby
      * @example
      * 
@@ -3581,6 +3919,8 @@ public function hIncrBy($key, $hashKey, $value) {}
      *
      * @return float|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hincrbyfloat
      * @example
      * 
@@ -3612,6 +3952,8 @@ public function hIncrByFloat($key, $field, $increment) {}
      *
      * @return bool|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hmset
      * @example
      * 
@@ -3631,6 +3973,8 @@ public function hMSet($key, $hashKeys) {}
      * @return array|Redis Array An array of elements, the values of the specified fields in the hash, or Redis if in multi mode
      * with the hash keys as array keys.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hmget
      * @example
      * 
@@ -3652,6 +3996,8 @@ public function hMGet($key, $hashKeys) {}
      *
      * @return array|Redis An array of members that match our pattern or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/hscan
      * @example
      * 
@@ -3674,6 +4020,8 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) {}
      * @return int|Redis the string length of the value associated with field, or zero when field is not present in the hash or Redis if in multi mode
      * or key does not exist at all.
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/hstrlen
      * @since >= 3.2
      */
@@ -3690,6 +4038,8 @@ public function hStrLen(string $key, string $field) {}
      *
      * @return int|Redis The number of elements added to the geospatial key or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/geoadd
      * @since >= 3.2
      *
@@ -3715,6 +4065,8 @@ public function geoAdd($key, $longitude, $latitude, $member) {}
      *
      * @return array|Redis One or more Redis Geohash encoded strings or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/geohash
      * @since >= 3.2
      *
@@ -3740,6 +4092,8 @@ public function geoHash($key, ...$member) {}
      * @param string $member
      * @return array|Redis One or more longitude/latitude positions or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/geopos
      * @since >= 3.2
      *
@@ -3780,6 +4134,8 @@ public function geoPos(string $key, string $member) {}
      *
      * @return float|Redis The distance between the two passed members in the units requested (meters by default) or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/geodist
      * @since >= 3.2
      *
@@ -3843,6 +4199,8 @@ public function geoDist($key, $member1, $member2, $unit = null) {}
      * @return mixed|Redis When no STORE option is passed, this function returns an array of results or Redis if in multi mode
      * If it is passed this function returns the number of stored entries.
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/georadius
      * @since >= 3.2
      * @example
@@ -3927,6 +4285,8 @@ public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $op
      *
      * @return array|Redis The zero or more entries that are close enough to the member given the distance and radius specified or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/georadiusbymember
      * @since >= 3.2
      * @see georadius
@@ -3964,6 +4324,8 @@ public function geoRadiusByMember($key, $member, $radius, $units, array $options
      *
      * @return array|Redis Associative array for `GET`, key -> value or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/config-get
      * @example
      * 
@@ -3985,6 +4347,8 @@ public function config($operation, $key, $value) {}
      * your LUA script.  If there is an error executing the LUA script, the getLastError() function can tell you the
      * message that came back from Redis (e.g. compile error).
      *
+     * @throws RedisException
+     *
      * @link   https://redis.io/commands/eval
      * @example
      * 
@@ -4005,6 +4369,8 @@ public function eval($script, $args = [], $numKeys = 0) {}
      * @param   array   $args
      * @param   int     $numKeys
      * @return  mixed|Redis   @see eval() , returns Redis if in multi mode
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->eval(%parametersList%)')]
     public function evaluate($script, $args = [], $numKeys = 0) {}
@@ -4020,6 +4386,8 @@ public function evaluate($script, $args = [], $numKeys = 0) {}
      *
      * @return mixed|Redis @see eval() , returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @see     eval()
      * @link    https://redis.io/commands/evalsha
      * @example
@@ -4035,6 +4403,8 @@ public function evalSha($scriptSha, $args = [], $numKeys = 0) {}
      * @param string $scriptSha
      * @param array  $args
      * @param int    $numKeys
+     *
+     * @throws RedisException
      */
     #[Deprecated(replacement: '%class%->evalSha(%parametersList%)')]
     public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {}
@@ -4046,6 +4416,8 @@ public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {}
      *
      * @return  mixed|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/script-load
      * @link    https://redis.io/commands/script-kill
      * @link    https://redis.io/commands/script-flush
@@ -4070,6 +4442,8 @@ public function script($command, $script) {}
      *
      * @return string|null A string with the last returned script based error message, or NULL if there is no error
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * $redis->eval('this-is-not-lua');
@@ -4084,6 +4458,8 @@ public function getLastError() {}
      *
      * @return bool true
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * $redis->set('x', 'a');
@@ -4113,6 +4489,8 @@ public function clearLastError() {}
      * - CLIENT SETNAME will return true if it can be set and false if not
      * - CLIENT KILL will return true if the client can be killed, and false if not
      *
+     * @throws RedisException
+     *
      * Note: phpredis will attempt to reconnect so you can actually kill your own connection but may not notice losing it!
      *
      * @link https://redis.io/commands/client-list
@@ -4138,6 +4516,8 @@ public function client($command, $value = '') {}
      * @return string If a prefix is set up, the value now prefixed
      * If there is no prefix, the value will be returned unchanged.
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * $redis->setOption(Redis::OPT_PREFIX, 'my-prefix:');
@@ -4192,6 +4572,8 @@ public function _serialize($value) {}
      *
      * @return string|false The Redis encoded value of the key, or FALSE if the key doesn't exist
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/dump
      * @example
      * 
@@ -4210,6 +4592,8 @@ public function dump($key) {}
      *
      * @return bool
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/restore
      * @example
      * 
@@ -4233,6 +4617,8 @@ public function restore($key, $ttl, $value) {}
      *
      * @return bool
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/migrate
      * @example
      * 
@@ -4247,6 +4633,8 @@ public function migrate($host, $port, $key, $db, $timeout, $copy = false, $repla
      * @return array If successful, the time will come back as an associative array with element zero being the
      * unix timestamp, and element one being microseconds.
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/time
      * @example
      * 
@@ -4268,6 +4656,8 @@ public function time() {}
      *
      * @return array|false|Redis This function will return an array of keys or FALSE if there are no more keys or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link   https://redis.io/commands/scan
      * @example
      * 
@@ -4289,6 +4679,8 @@ public function scan(&$iterator, $pattern = null, $count = 0) {}
      *
      * @return bool|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/pfadd
      * @example $redis->pfAdd('key', array('elem1', 'elem2'))
      */
@@ -4302,6 +4694,8 @@ public function pfAdd($key, array $elements) {}
      *
      * @return int|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/pfcount
      * @example
      * 
@@ -4322,6 +4716,8 @@ public function pfCount($key) {}
      *
      * @return bool|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/pfmerge
      * @example
      * 
@@ -4341,6 +4737,8 @@ public function pfMerge($destKey, array $sourceKeys) {}
      *
      * @return mixed|Redis returns Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @example
      * 
      * $redis->rawCommand('SET', 'key', 'value'); // bool(true)
@@ -4354,6 +4752,8 @@ public function rawCommand($command, $arguments) {}
      *
      * @return int|Redis Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @example $redis->getMode();
      */
     public function getMode() {}
@@ -4367,6 +4767,8 @@ public function getMode() {}
      *
      * @return int|Redis The number of messages Redis reports as acknowledged or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xack
      * @example
      * 
@@ -4386,6 +4788,8 @@ public function xAck($stream, $group, $messages) {}
      *
      * @return string|Redis The added message ID or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xadd
      * @example
      * 
@@ -4409,6 +4813,8 @@ public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false)
      * @return array|Redis Either an array of message IDs along with corresponding data, or just an array of IDs or Redis if in multi mode
      * (if the 'JUSTID' option was passed).
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xclaim
      * @example
      * 
@@ -4439,6 +4845,8 @@ public function xClaim($key, $group, $consumer, $minIdleTime, $ids, $options = [
      *
      * @return int|Redis The number of messages removed or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xdel
      * @example
      * 
@@ -4456,6 +4864,8 @@ public function xDel($key, $ids) {}
      *
      * @return mixed|Redis This command returns different types depending on the specific XGROUP command executed or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xgroup
      * @example
      * 
@@ -4475,6 +4885,8 @@ public function xGroup($operation, $key, $group, $msgId = '', $mkStream = false)
      *
      * @return mixed|Redis This command returns different types depending on which subcommand is used or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xinfo
      * @example
      * 
@@ -4490,6 +4902,8 @@ public function xInfo($operation, $stream, $group) {}
      *
      * @return int|Redis The number of messages in the stream or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xlen
      * @example
      * 
@@ -4511,6 +4925,8 @@ public function xLen($stream) {}
      * @return array|Redis Information about the pending messages, in various forms depending on or Redis if in multi mode
      * the specific invocation of XPENDING.
      *
+     * @throws RedisException
+     *
      * @link https://redis.io/commands/xpending
      * @example
      * 
@@ -4530,6 +4946,8 @@ public function xPending($stream, $group, $start = null, $end = null, $count = n
      *
      * @return array|Redis The messages in the stream within the requested range or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xrange
      * @example
      * 
@@ -4550,6 +4968,8 @@ public function xRange($stream, $start, $end, $count = null) {}
      *
      * @return array|Redis The messages in the stream newer than the IDs passed to Redis (if any) or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xread
      * @example
      * 
@@ -4569,6 +4989,8 @@ public function xRead($streams, $count = null, $block = null) {}
      *
      * @return array|Redis The messages delivered to this consumer group (if any) or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xreadgroup
      * @example
      * 
@@ -4591,6 +5013,8 @@ public function xReadGroup($group, $consumer, $streams, $count = null, $block =
      *
      * @return array|Redis The messages in the range specified or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xrevrange
      * @example
      * 
@@ -4610,6 +5034,8 @@ public function xRevRange($stream, $end, $start, $count = null) {}
      *
      * @return int|Redis The number of messages trimed from the stream or Redis if in multi mode
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/xtrim
      * @example
      * 
@@ -4630,6 +5056,8 @@ public function xTrim($stream, $maxLen, $isApproximate) {}
      * @return  int|bool|Redis The number of elements added to the set or Redis if in multi mode
      * If this value is already in the set, FALSE is returned
      *
+     * @throws RedisException
+     *
      * @link    https://redis.io/commands/sadd
      * @link    https://github.com/phpredis/phpredis/commit/3491b188e0022f75b938738f7542603c7aae9077
      * @since   phpredis 2.2.8

From 444c307b4498b8efc1019c92aac0db3dde81b30b Mon Sep 17 00:00:00 2001
From: Andrew Menino-Barlow 
Date: Thu, 7 Apr 2022 12:48:51 +0100
Subject: [PATCH 031/419] Adding stub for
 https://github.com/kjdev/php-ext-snappy.

---
 snappy/snappy/snappy.php | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 snappy/snappy/snappy.php

diff --git a/snappy/snappy/snappy.php b/snappy/snappy/snappy.php
new file mode 100644
index 000000000..8e43722ad
--- /dev/null
+++ b/snappy/snappy/snappy.php
@@ -0,0 +1,18 @@
+
Date: Thu, 7 Apr 2022 19:15:02 +0100
Subject: [PATCH 032/419] Updated StubsMap and fixed formatting.

---
 PhpStormStubsMap.php     | 2 ++
 snappy/snappy/snappy.php | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php
index 3a60e4512..e87726ab2 100644
--- a/PhpStormStubsMap.php
+++ b/PhpStormStubsMap.php
@@ -4922,6 +4922,8 @@ final class PhpStormStubsMap
   'sinh' => 'standard/standard_3.php',
   'sizeof' => 'standard/standard_9.php',
   'sleep' => 'standard/standard_0.php',
+  'snappy_compress' => 'snappy/snappy/snappy.php',
+  'snappy_uncompress' => 'snappy/snappy/snappy.php',
   'snmp2_get' => 'snmp/snmp.php',
   'snmp2_getnext' => 'snmp/snmp.php',
   'snmp2_real_walk' => 'snmp/snmp.php',
diff --git a/snappy/snappy/snappy.php b/snappy/snappy/snappy.php
index 8e43722ad..ac139a982 100644
--- a/snappy/snappy/snappy.php
+++ b/snappy/snappy/snappy.php
@@ -15,4 +15,3 @@ function snappy_compress(string $data): string|false {}
  * @return string|false The original uncompressed data or FALSE on error.
  */
 function snappy_uncompress(string $data): string|false {}
-

From 5440d5873d22585ccf5f8f6aa394519a09142fcd Mon Sep 17 00:00:00 2001
From: Andrew Menino-Barlow 
Date: Fri, 8 Apr 2022 14:38:21 +0100
Subject: [PATCH 033/419] Added 'snappy' to
 'PhpCoreStubsProvider::StubDirectoryMap'.

---
 tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php
index b7d375416..d2d59ad6d 100644
--- a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php
+++ b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php
@@ -189,6 +189,7 @@ class PhpCoreStubsProvider
             'redis',
             'rrd',
             'SaxonC',
+            'snappy',
             'suhosin',
             'svm',
             'v8js',

From 96c26c803a705927fde04e4c6a614b5aa5256384 Mon Sep 17 00:00:00 2001
From: Ivan Fedorov 
Date: Thu, 31 Mar 2022 10:37:54 +0200
Subject: [PATCH 034/419] [phpstorm-stubs] add int ranges

---
 Core/Core.php           | 2 +-
 Core/Core_c.php         | 4 ++--
 Phar/Phar.php           | 4 ++--
 SPL/SPL.php             | 2 +-
 SPL/SPL_c1.php          | 4 ++--
 SimpleXML/SimpleXML.php | 2 +-
 bz2/bz2.php             | 2 +-
 dom/dom_c.php           | 3 ++-
 hash/hash.php           | 2 +-
 iconv/iconv.php         | 2 +-
 intl/intl.php           | 2 +-
 mbstring/mbstring.php   | 4 ++--
 standard/standard_0.php | 2 +-
 standard/standard_1.php | 4 ++--
 standard/standard_8.php | 2 +-
 standard/standard_9.php | 2 +-
 16 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/Core/Core.php b/Core/Core.php
index a3745dcf8..b01235c5c 100755
--- a/Core/Core.php
+++ b/Core/Core.php
@@ -51,7 +51,7 @@ function func_get_args(): array {}
  * @param string $string 

* The string being measured for length. *

- * @return int The length of the string on success, + * @return int<0,max> The length of the string on success, * and 0 if the string is empty. */ #[Pure] diff --git a/Core/Core_c.php b/Core/Core_c.php index 7530b0cb8..6d0c98fa0 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -698,7 +698,7 @@ interface Countable /** * Count elements of an object * @link https://php.net/manual/en/countable.count.php - * @return int The custom count as an integer. + * @return int<0,max> The custom count as an integer. *

* The return value is cast to an integer. *

@@ -799,7 +799,7 @@ public function getIterator(): Iterator {} /** * Returns the number of items in the {@see WeakMap} instance. * - * @return int + * @return int<0,max> */ public function count(): int {} } diff --git a/Phar/Phar.php b/Phar/Phar.php index 55ccef130..20ad6f9d1 100644 --- a/Phar/Phar.php +++ b/Phar/Phar.php @@ -316,7 +316,7 @@ public function copy( * Returns the number of entries (files) in the Phar archive * @link https://php.net/manual/en/phar.count.php * @param int $mode [optional] - * @return int The number of files contained within this phar, or 0 (the number zero) + * @return int<0,max> The number of files contained within this phar, or 0 (the number zero) * if none. */ #[TentativeType] @@ -1178,7 +1178,7 @@ public function delMetadata() {} * (PHP >= 5.3.0, PECL phar >= 1.0.0)
* Returns the actual size of the file (with compression) inside the Phar archive * @link https://php.net/manual/en/pharfileinfo.getcompressedsize.php - * @return int The size in bytes of the file within the Phar archive on disk. + * @return int<0, max> The size in bytes of the file within the Phar archive on disk. */ #[TentativeType] public function getCompressedSize(): int {} diff --git a/SPL/SPL.php b/SPL/SPL.php index 856efaf04..ce905c2cd 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -1919,7 +1919,7 @@ public function getArrayCopy(): array {} /** * Count elements * @link https://php.net/manual/en/arrayiterator.count.php - * @return int The number of elements or public properties in the associated + * @return int<0,max> The number of elements or public properties in the associated * array or object, respectively. */ #[TentativeType] diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 54ac9cbef..696792111 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -586,7 +586,7 @@ public function __construct( /** * Get the number of directories and files * @link https://php.net/manual/en/globiterator.count.php - * @return int The number of returned directories and files, as an + * @return int<0,max> The number of returned directories and files, as an * integer. */ #[TentativeType] @@ -975,7 +975,7 @@ public function setMaxLineLen(#[LanguageLevelTypeAware(['8.0' => 'int'], default /** * Get maximum line length * @link https://php.net/manual/en/splfileobject.getmaxlinelen.php - * @return int the maximum line length if one has been set with + * @return int<0, max> the maximum line length if one has been set with * SplFileObject::setMaxLineLen, default is 0. */ #[TentativeType] diff --git a/SimpleXML/SimpleXML.php b/SimpleXML/SimpleXML.php index 90a90458a..7781391dc 100644 --- a/SimpleXML/SimpleXML.php +++ b/SimpleXML/SimpleXML.php @@ -257,7 +257,7 @@ public function __toString(): string {} /** * Counts the children of an element * @link https://php.net/manual/en/simplexmlelement.count.php - * @return int the number of elements of an element. + * @return int<0,max> the number of elements of an element. */ #[Pure] #[TentativeType] diff --git a/bz2/bz2.php b/bz2/bz2.php index 6b722182c..f469d9a26 100644 --- a/bz2/bz2.php +++ b/bz2/bz2.php @@ -28,7 +28,7 @@ function bzopen($file, string $mode) {} * The file pointer. It must be valid and must point to a file * successfully opened by bzopen. *

- * @param int $length [optional]

+ * @param int<1024, 8192> $length [optional]

* If not specified, bzread will read 1024 * (uncompressed) bytes at a time. A maximum of 8192 * uncompressed bytes will be read at a time. diff --git a/dom/dom_c.php b/dom/dom_c.php index 9db0a1f57..9b1db4c07 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -1278,6 +1278,7 @@ class DOMNodeList implements IteratorAggregate, Countable public function item(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index) {} /** + * @return int<0, max> * @since 7.2 */ #[TentativeType] @@ -1367,7 +1368,7 @@ public function setNamedItemNS(DOMNode $arg) {} public function removeNamedItemNS($namespace, $localName) {} /** - * @return int + * @return int<0,max> * @since 7.2 */ #[TentativeType] diff --git a/hash/hash.php b/hash/hash.php index 592e4e73f..27e87e4dd 100644 --- a/hash/hash.php +++ b/hash/hash.php @@ -345,7 +345,7 @@ function mhash_get_hash_name(int $algo): string|false {} /** * Gets the highest available hash ID * @link https://php.net/manual/en/function.mhash-count.php - * @return int the highest available hash ID. Hashes are numbered from 0 to this + * @return int<0, max> the highest available hash ID. Hashes are numbered from 0 to this * hash ID. * @deprecated 8.1 */ diff --git a/iconv/iconv.php b/iconv/iconv.php index 229d102c2..78c928ce9 100644 --- a/iconv/iconv.php +++ b/iconv/iconv.php @@ -167,7 +167,7 @@ function iconv_substr(string $string, int $offset, ?int $length, ?string $encodi * string are assumed to be encoded in * iconv.internal_encoding. *

- * @return int|false the numeric position of the first occurrence of + * @return int<0,max>|false the numeric position of the first occurrence of * needle in haystack. *

* If needle is not found, diff --git a/intl/intl.php b/intl/intl.php index 25f028a1a..624a18ae6 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -2286,7 +2286,7 @@ public function get($index, #[TypeAware(['8.0' => 'bool'], default: '')] $fallba * (PHP >= 5.3.2, PECL intl >= 2.0.0)
* Get number of elements in the bundle * @link https://php.net/manual/en/resourcebundle.count.php - * @return int number of elements in the bundle. + * @return int<0,max> number of elements in the bundle. */ #[Pure] #[TentativeType] diff --git a/mbstring/mbstring.php b/mbstring/mbstring.php index a51a63b6d..1e6b79f16 100644 --- a/mbstring/mbstring.php +++ b/mbstring/mbstring.php @@ -267,11 +267,11 @@ function mb_strlen(string $string, #[LanguageLevelTypeAware(['8.0' => 'string|nu * @param string $needle

* The position counted from the beginning of haystack. *

- * @param int $offset [optional]

+ * @param int<0,max> $offset [optional]

* The search offset. If it is not specified, 0 is used. *

* @param string|null $encoding [optional] - * @return int|false the numeric position of + * @return int<0,max>|false the numeric position of * the first occurrence of needle in the * haystack string. If * needle is not found, it returns false. diff --git a/standard/standard_0.php b/standard/standard_0.php index ee2b0c385..0898fcc83 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -1300,7 +1300,7 @@ function strnatcasecmp(string $string1, string $string2): int {} * substring. It outputs a warning if the offset plus the length is * greater than the haystack length. *

- * @return int This functions returns an integer. + * @return int<0,max> This functions returns an integer. */ #[Pure] function substr_count(string $haystack, string $needle, int $offset = 0, ?int $length): int {} diff --git a/standard/standard_1.php b/standard/standard_1.php index 8948469af..aa985650f 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -39,11 +39,11 @@ function strtolower(string $string): string {} * If needle is not a string, it is converted * to an integer and applied as the ordinal value of a character. *

- * @param int $offset [optional]

+ * @param int<0,max> $offset [optional]

* If specified, search will start this number of characters counted from * the beginning of the string. Unlike {@see strrpos()} and {@see strripos()}, the offset cannot be negative. *

- * @return int|false

+ * @return int<0,max>|false

* Returns the position where the needle exists relative to the beginnning of * the haystack string (independent of search direction * or offset). diff --git a/standard/standard_8.php b/standard/standard_8.php index f69bb253c..3c481b943 100644 --- a/standard/standard_8.php +++ b/standard/standard_8.php @@ -623,7 +623,7 @@ function array_walk_recursive(object|array &$array, callable $callback, mixed $a * COUNT_RECURSIVE (or 1), count * will recursively count the array. This is particularly useful for * counting all the elements of a multidimensional array. count does not detect infinite recursion. - * @return int the number of elements in var, which is + * @return int<0,max> the number of elements in var, which is * typically an array, since anything else will have one * element. *

diff --git a/standard/standard_9.php b/standard/standard_9.php index 7a63f5382..627909c55 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -852,7 +852,7 @@ function pos(object|array $array): mixed {} * @link https://php.net/manual/en/function.sizeof.php * @param array|Countable $value * @param int $mode [optional] - * @return int + * @return int<0, max> */ #[Pure] function sizeof(Countable|array $value, int $mode = COUNT_NORMAL): int {} From cf183e4fd3925ea1fba0b8cf3f785139e618fa3e Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 31 Mar 2022 14:50:10 +0200 Subject: [PATCH 035/419] [phpstorm-stubs] replace int<> ranges with int before test ranges are not supported officially and thus produce runtime exception during parsing --- tests/BaseFunctionsTest.php | 2 +- tests/Model/PHPDocElement.php | 8 ++++++++ tests/Model/PHPFunction.php | 36 ++++++++++++----------------------- tests/Model/PHPMethod.php | 2 +- tests/StubsPhpDocTest.php | 4 ++-- 5 files changed, 24 insertions(+), 28 deletions(-) diff --git a/tests/BaseFunctionsTest.php b/tests/BaseFunctionsTest.php index 29efa1c77..9a2fc80b3 100644 --- a/tests/BaseFunctionsTest.php +++ b/tests/BaseFunctionsTest.php @@ -38,7 +38,7 @@ public function testFunctionsDeprecation(PHPFunction $function) $functionName = $function->name; $stubFunction = PhpStormStubsSingleton::getPhpStormStubs()->getFunction($functionName); static::assertFalse( - $function->is_deprecated && $stubFunction->is_deprecated !== true, + $function->isDeprecated && $stubFunction->isDeprecated !== true, "Function $functionName is not deprecated in stubs" ); } diff --git a/tests/Model/PHPDocElement.php b/tests/Model/PHPDocElement.php index 91cba38a5..9633c3fd9 100644 --- a/tests/Model/PHPDocElement.php +++ b/tests/Model/PHPDocElement.php @@ -8,6 +8,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Generic; use phpDocumentor\Reflection\DocBlock\Tags\Link; use phpDocumentor\Reflection\DocBlock\Tags\Param; +use phpDocumentor\Reflection\DocBlock\Tags\Return_; use phpDocumentor\Reflection\DocBlock\Tags\See; use phpDocumentor\Reflection\DocBlock\Tags\Since; use phpDocumentor\Reflection\DocBlock\Tags\Var_; @@ -52,6 +53,11 @@ trait PHPDocElement */ public $paramTags = []; + /** + * @var Return_[] + */ + public $returnTags = []; + /** * @var Var_[] */ @@ -78,6 +84,7 @@ protected function collectTags(Node $node) if ($node->getDocComment() !== null) { try { $text = $node->getDocComment()->getText(); + $text = preg_replace("/int\<\w+,\s*\w+\>/", "int", $text); $this->phpdoc = $text; $phpDoc = DocFactoryProvider::getDocFactory()->create($text); $tags = $phpDoc->getTags(); @@ -85,6 +92,7 @@ protected function collectTags(Node $node) $this->tagNames[] = $tag->getName(); } $this->paramTags = $phpDoc->getTagsByName('param'); + $this->returnTags = $phpDoc->getTagsByName('return'); $this->varTags = $phpDoc->getTagsByName('var'); $this->links = $phpDoc->getTagsByName('link'); $this->see = $phpDoc->getTagsByName('see'); diff --git a/tests/Model/PHPFunction.php b/tests/Model/PHPFunction.php index d74614ed4..0d4a1fe4c 100644 --- a/tests/Model/PHPFunction.php +++ b/tests/Model/PHPFunction.php @@ -22,7 +22,7 @@ class PHPFunction extends BasePHPElement /** * @var bool */ - public $is_deprecated; + public $isDeprecated; /** * @var PHPParameter[] @@ -45,7 +45,7 @@ class PHPFunction extends BasePHPElement public function readObjectFromReflection($reflectionObject) { $this->name = $reflectionObject->name; - $this->is_deprecated = $reflectionObject->isDeprecated(); + $this->isDeprecated = $reflectionObject->isDeprecated(); foreach ($reflectionObject->getParameters() as $parameter) { $this->parameters[] = (new PHPParameter())->readObjectFromReflection($parameter); } @@ -102,37 +102,25 @@ public function readObjectFromStubNode($node) } $this->checkDeprecationTag($node); - $this->checkReturnTag($node); + $this->checkReturnTag(); return $this; } protected function checkDeprecationTag(FunctionLike $node) { - try { - $this->is_deprecated = self::hasDeprecatedAttribute($node) || self::hasDeprecatedDocTag($node->getDocComment()); - } catch (Exception $e) { - $this->parseError = $e; - } + $this->isDeprecated = self::hasDeprecatedAttribute($node) || !empty($this->deprecatedTags); } - protected function checkReturnTag(FunctionLike $node) + protected function checkReturnTag() { - if ($node->getDocComment() !== null) { - try { - $phpDoc = DocFactoryProvider::getDocFactory()->create($node->getDocComment()->getText()); - $parsedReturnTag = $phpDoc->getTagsByName('return'); - if (!empty($parsedReturnTag) && $parsedReturnTag[0] instanceof Return_) { - $returnType = $parsedReturnTag[0]->getType(); - if ($returnType instanceof Compound) { - foreach ($returnType as $nextType) { - $this->returnTypesFromPhpDoc[] = (string)$nextType; - } - } else { - $this->returnTypesFromPhpDoc[] = (string)$returnType; - } + if (!empty($this->returnTags) && $this->returnTags[0] instanceof Return_) { + $returnType = $this->returnTags[0]->getType(); + if ($returnType instanceof Compound) { + foreach ($returnType as $nextType) { + $this->returnTypesFromPhpDoc[] = (string)$nextType; } - } catch (Exception $e) { - $this->parseError = $e; + } else { + $this->returnTypesFromPhpDoc[] = (string)$returnType; } } } diff --git a/tests/Model/PHPMethod.php b/tests/Model/PHPMethod.php index af3a8fbe5..a06db25c0 100644 --- a/tests/Model/PHPMethod.php +++ b/tests/Model/PHPMethod.php @@ -86,7 +86,7 @@ public function readObjectFromStubNode($node) array_push($this->returnTypesFromSignature, ...self::convertParsedTypeToArray($node->getReturnType())); $this->collectTags($node); $this->checkDeprecationTag($node); - $this->checkReturnTag($node); + $this->checkReturnTag(); if (strncmp($this->name, 'PS_UNRESERVE_PREFIX_', 20) === 0) { $this->name = substr($this->name, strlen('PS_UNRESERVE_PREFIX_')); diff --git a/tests/StubsPhpDocTest.php b/tests/StubsPhpDocTest.php index 0fa0f4410..ec182bd8d 100644 --- a/tests/StubsPhpDocTest.php +++ b/tests/StubsPhpDocTest.php @@ -47,7 +47,7 @@ public static function testConstantsPHPDocs(PHPConst $constant): void */ public static function testFunctionPHPDocs(PHPFunction $function): void { - self::assertNull($function->parseError, $function->parseError ?: ''); + self::assertNull($function->parseError, $function->parseError?->getMessage() ?: ''); self::checkPHPDocCorrectness($function, "function $function->name"); } @@ -57,7 +57,7 @@ public static function testFunctionPHPDocs(PHPFunction $function): void */ public static function testClassesPHPDocs(BasePHPClass $class): void { - self::assertNull($class->parseError, $class->parseError ?: ''); + self::assertNull($class->parseError, $class->parseError?->getMessage() ?: ''); self::checkPHPDocCorrectness($class, "class $class->name"); } From cbbc2dd5d78e8b674c604bd1c7ac728182d3045c Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Fri, 8 Apr 2022 15:54:01 +0200 Subject: [PATCH 036/419] Aux test suits reorganization --- .github/workflows/main.yml | 7 +++++-- phpunit.xml.dist | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ddb30ac8..51d9f67c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,8 +43,11 @@ jobs: - name: Composer Install run: docker-compose -f docker-compose.yml run test_runner composer install - - name: Test Stubs Map - run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Check_Stub_Map + - name: Test Stubs Map and Structure + run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Structure + + - name: Stub Reflection tests + run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Reflection - name: run cs fixer run: docker-compose -f docker-compose.yml run test_runner composer cs diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6b60fec5c..74abeb5c0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -59,22 +59,24 @@ tests/BaseClassesTest.php tests/BaseConstantsTest.php tests/BaseFunctionsTest.php - tests/StubsConstantsAndParametersValuesTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php tests/StubsParameterNamesTest.php tests/StubsPhpDocTest.php - tests/StubsReflectionClassesTest.php - tests/StubsStructureTest.php tests/StubsTypeHintsTest.php tests/StubsForbiddenTypeHintsTest.php tests/StubsPhp81Tests.php + + tests/StubsReflectionClassesTest.php + tests/StubsConstantsAndParametersValuesTest.php + tests/StubsPhpDocTest.php - + tests/CheckStubMapTest.php + tests/StubsStructureTest.php From bbef8d325c02f5f7ec034422ac17adf683d03349 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Fri, 8 Apr 2022 16:18:41 +0200 Subject: [PATCH 037/419] Moved StubsConstantsAndParametersValuesTest back to 8.1 suite, removed Reflection suite --- .github/workflows/main.yml | 5 +---- phpunit.xml.dist | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51d9f67c2..3f7cb08bc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,11 +43,8 @@ jobs: - name: Composer Install run: docker-compose -f docker-compose.yml run test_runner composer install - - name: Test Stubs Map and Structure + - name: Test Stubs Map, Structure and Reflection run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Structure - - name: Stub Reflection tests - run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Reflection - - name: run cs fixer run: docker-compose -f docker-compose.yml run test_runner composer cs diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 74abeb5c0..4ec7b964b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -59,6 +59,7 @@ tests/BaseClassesTest.php tests/BaseConstantsTest.php tests/BaseFunctionsTest.php + tests/StubsConstantsAndParametersValuesTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php tests/StubsParameterNamesTest.php @@ -67,16 +68,13 @@ tests/StubsForbiddenTypeHintsTest.php tests/StubsPhp81Tests.php - - tests/StubsReflectionClassesTest.php - tests/StubsConstantsAndParametersValuesTest.php - tests/StubsPhpDocTest.php tests/CheckStubMapTest.php tests/StubsStructureTest.php + tests/StubsReflectionClassesTest.php From be5319f05c1df371109846f0dd8740eaacae5a1c Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Mon, 11 Apr 2022 18:41:30 +0200 Subject: [PATCH 038/419] Adjusted job name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f7cb08bc..9645e7fb5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: PHP_VERSION: ${{matrix.php}} additional: runs-on: ubuntu-latest - name: Run checks for StubsMap and cs-fixer + name: Run cs-fixer and stubs structure tests steps: - name: Checkout uses: actions/checkout@v2 From 64c4fe7785fa0b9909ccc231f9f3790e77601f42 Mon Sep 17 00:00:00 2001 From: tianyiw Date: Tue, 12 Apr 2022 16:31:49 +0800 Subject: [PATCH 039/419] Update `sapi_windows_set_ctrl_handler` --- standard/basic.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/standard/basic.php b/standard/basic.php index 2382fb05d..e5b5d9026 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -160,20 +160,33 @@ function sapi_windows_vt100_support($stream, bool $enable): bool {} /** * Set or remove a CTRL event handler. * + * Sets or removes a CTRL event handler, which allows Windows CLI processes to intercept or ignore CTRL+C and CTRL+BREAK events. + * Note that in multithreaded environments, this is only possible when called from the main thread. + * * @link https://www.php.net/manual/en/function.sapi-windows-set-ctrl-handler.php - * @param callable $callable - * @param bool $add [optional] + * @param callable|null $handler

+ * A callback function to set or remove. If set, this function will be called whenever a CTRL+C or CTRL+BREAK event occurs. + *

+ *

+ * The function is supposed to have the following signature:
+ * `handler(int $event): void`
+ * `event` The CTRL event which has been received; either PHP_WINDOWS_EVENT_CTRL_C or PHP_WINDOWS_EVENT_CTRL_BREAK. + *

+ *

+ * Setting a null handler causes the process to ignore CTRL+C events, but not CTRL+BREAK events. + *

+ * @param bool $add [optional] If true, the handler is set. If false, the handler is removed. * @return bool TRUE on success or FALSE on failure. * @since 7.4 */ -function sapi_windows_set_ctrl_handler(callable $callable, bool $add = true): bool {} +function sapi_windows_set_ctrl_handler(?callable $handler, bool $add = true): bool {} /** * Send a CTRL event to another process. * * @link https://www.php.net/manual/en/function.sapi-windows-generate-ctrl-event.php - * @param int $event - * @param int $pid [optional] + * @param int $event The CTRL even to send; either PHP_WINDOWS_EVENT_CTRL_C or PHP_WINDOWS_EVENT_CTRL_BREAK. + * @param int $pid [optional] The ID of the process to which to send the event to. If 0 is given, the event is sent to all processes of the process group. * @return bool TRUE on success or FALSE on failure. * @since 7.4 */ From 61adc7a562a259f1bf62a6158c7207692582e8c4 Mon Sep 17 00:00:00 2001 From: tianyiw Date: Tue, 12 Apr 2022 16:43:48 +0800 Subject: [PATCH 040/419] Update sapi_windows_vt100_support --- standard/basic.php | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/standard/basic.php b/standard/basic.php index e5b5d9026..212b5e0b0 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -142,20 +142,30 @@ function sapi_windows_cp_is_utf8(): bool {} * * If VT100 support is enabled, it is possible to use control sequences as they are known from the VT100 terminal. * They allow the modification of the terminal's output. On Windows these sequences are called Console Virtual Terminal Sequences. + * + * Warning This function uses the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag implemented in the Windows 10 API, so the VT100 feature may not be available on older Windows versions. + * * @link https://php.net/manual/en/function.sapi-windows-vt100-support.php - * @param resource $stream - * @param bool $enable [optional]

- * - * If enable is omitted, the function returns TRUE if the stream stream has VT100 control codes enabled, FALSE otherwise. - * - * If enable is specified, the function will try to enable or disable the VT100 features of the stream stream. - * If the feature has been successfully enabled (or disabled), the function will return TRUE, or FALSE otherwise. + * @param resource $stream The stream on which the function will operate. + * @param bool|null $enable

+ * If bool, the VT100 feature will be enabled (if true) or disabled (if false). + *

+ *

+ * If enable is null, the function returns true if the stream stream has VT100 control codes enabled, false otherwise. + *

+ *

+ * If enable is a bool, the function will try to enable or disable the VT100 features of the stream stream. + * If the feature has been successfully enabled (or disabled), the function will return true, or false otherwise. + *

+ * @return bool

+ * If enable is null: returns true if the VT100 feature is enabled, false otherwise. + *

+ *

+ * If enable is a bool: Returns true on success or false on failure. *

- * @return bool If enable is not specified: returns TRUE if the VT100 feature is enabled, FALSE otherwise. - * If enable is specified: Returns TRUE on success or FALSE on failure. * @since 7.2 */ -function sapi_windows_vt100_support($stream, bool $enable): bool {} +function sapi_windows_vt100_support($stream, ?bool $enable = null): bool {} /** * Set or remove a CTRL event handler. @@ -168,14 +178,14 @@ function sapi_windows_vt100_support($stream, bool $enable): bool {} * A callback function to set or remove. If set, this function will be called whenever a CTRL+C or CTRL+BREAK event occurs. *

*

- * The function is supposed to have the following signature:
- * `handler(int $event): void`
+ * The function is supposed to have the following signature:
+ * `handler(int $event): void`
* `event` The CTRL event which has been received; either PHP_WINDOWS_EVENT_CTRL_C or PHP_WINDOWS_EVENT_CTRL_BREAK. *

*

* Setting a null handler causes the process to ignore CTRL+C events, but not CTRL+BREAK events. *

- * @param bool $add [optional] If true, the handler is set. If false, the handler is removed. + * @param bool $add If true, the handler is set. If false, the handler is removed. * @return bool TRUE on success or FALSE on failure. * @since 7.4 */ From d104de1efa6b68ec2df45d69b709240c76048cd3 Mon Sep 17 00:00:00 2001 From: tianyiw Date: Tue, 12 Apr 2022 16:53:28 +0800 Subject: [PATCH 041/419] Update basic.php --- standard/basic.php | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/standard/basic.php b/standard/basic.php index 212b5e0b0..4fd1d82e4 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -53,6 +53,9 @@ function cli_set_process_title(string $title): bool {} /** * Returns the current process title + * + * Returns the current process title, as set by cli_set_process_title(). Note that this may not exactly match what is shown in ps or top, depending on your operating system. + * * @link https://php.net/manual/en/function.cli-get-process-title.php * @return string|null Return a string with the current process title or NULL on error. * @since 5.5 @@ -103,32 +106,40 @@ function error_clear_last(): void {} /** * Get process codepage - * @param string $kind - * @return int + * @link https://php.net/manual/en/function.sapi-windows-cp-get + * @param string $kind The kind of operating system codepage to get, either 'ansi' or 'oem'. Any other value refers to the current codepage of the process. + * @return int

+ * If kind is 'ansi', the current ANSI code page of the operating system is returned. + * If kind is 'oem', the current OEM code page of the operating system is returned. + * Otherwise, the current codepage of the process is returned. + *

* @since 7.1 */ -function sapi_windows_cp_get(string $kind): int {} +function sapi_windows_cp_get(string $kind = ""): int {} /** * Set process codepage - * @param int $cp - * @return bool + * @link https://php.net/manual/en/function.sapi-windows-cp-set + * @param int $codepage A codepage identifier. + * @return bool Returns true on success or false on failure. * @since 7.1 */ -function sapi_windows_cp_set(int $cp): bool {} +function sapi_windows_cp_set(int $codepage): bool {} /** * Convert string from one codepage to another - * @param int|string $in_codepage - * @param int|string $out_codepage - * @param string $subject - * @return string + * @link https://php.net/manual/en/function.sapi-windows-cp-conv.php + * @param int|string $in_codepage The codepage of the subject string. Either the codepage name or identifier. + * @param int|string $out_codepage The codepage to convert the subject string to. Either the codepage name or identifier. + * @param string $subject The string to convert. + * @return string|null The subject string converted to out_codepage, or null on failure. * @since 7.1 */ -function sapi_windows_cp_conv(int|string $in_codepage, int|string $out_codepage, string $subject): string {} +function sapi_windows_cp_conv(int|string $in_codepage, int|string $out_codepage, string $subject): ?string {} /** * Indicates whether the codepage is utf-8 compatible + * @link https://www.php.net/manual/en/function.sapi-windows-cp-is-utf8.php * @return bool * @since 7.1 */ From 0229d9d23f7a4c288b1bf5564718be655d88a3fd Mon Sep 17 00:00:00 2001 From: tianyiw Date: Tue, 12 Apr 2022 17:27:23 +0800 Subject: [PATCH 042/419] delete trailing whitespace in comment --- standard/basic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/basic.php b/standard/basic.php index 4fd1d82e4..b47a19ddd 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -165,7 +165,7 @@ function sapi_windows_cp_is_utf8(): bool {} * If enable is null, the function returns true if the stream stream has VT100 control codes enabled, false otherwise. *

*

- * If enable is a bool, the function will try to enable or disable the VT100 features of the stream stream. + * If enable is a bool, the function will try to enable or disable the VT100 features of the stream stream. * If the feature has been successfully enabled (or disabled), the function will return true, or false otherwise. *

* @return bool

From c1696ea5ba009cc468b6c1c6fcf565f0cd66cac3 Mon Sep 17 00:00:00 2001 From: tianyiw Date: Tue, 12 Apr 2022 17:41:40 +0800 Subject: [PATCH 043/419] delete trailing whitespace in comment --- standard/basic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/standard/basic.php b/standard/basic.php index b47a19ddd..0b84cf168 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -53,9 +53,9 @@ function cli_set_process_title(string $title): bool {} /** * Returns the current process title - * + * * Returns the current process title, as set by cli_set_process_title(). Note that this may not exactly match what is shown in ps or top, depending on your operating system. - * + * * @link https://php.net/manual/en/function.cli-get-process-title.php * @return string|null Return a string with the current process title or NULL on error. * @since 5.5 @@ -153,9 +153,9 @@ function sapi_windows_cp_is_utf8(): bool {} * * If VT100 support is enabled, it is possible to use control sequences as they are known from the VT100 terminal. * They allow the modification of the terminal's output. On Windows these sequences are called Console Virtual Terminal Sequences. - * + * * Warning This function uses the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag implemented in the Windows 10 API, so the VT100 feature may not be available on older Windows versions. - * + * * @link https://php.net/manual/en/function.sapi-windows-vt100-support.php * @param resource $stream The stream on which the function will operate. * @param bool|null $enable

From d09d66f9308cf91995146b15b8ac6acd5fac3ccd Mon Sep 17 00:00:00 2001 From: tianyiw Date: Tue, 12 Apr 2022 21:07:12 +0800 Subject: [PATCH 044/419] Update basic.php --- standard/basic.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/standard/basic.php b/standard/basic.php index 0b84cf168..6b1a24db0 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -52,8 +52,6 @@ function dl(string $extension_filename): bool {} function cli_set_process_title(string $title): bool {} /** - * Returns the current process title - * * Returns the current process title, as set by cli_set_process_title(). Note that this may not exactly match what is shown in ps or top, depending on your operating system. * * @link https://php.net/manual/en/function.cli-get-process-title.php @@ -179,9 +177,7 @@ function sapi_windows_cp_is_utf8(): bool {} function sapi_windows_vt100_support($stream, ?bool $enable = null): bool {} /** - * Set or remove a CTRL event handler. - * - * Sets or removes a CTRL event handler, which allows Windows CLI processes to intercept or ignore CTRL+C and CTRL+BREAK events. + * Set or remove a CTRL event handler, which allows Windows CLI processes to intercept or ignore CTRL+C and CTRL+BREAK events. * Note that in multithreaded environments, this is only possible when called from the main thread. * * @link https://www.php.net/manual/en/function.sapi-windows-set-ctrl-handler.php From 5b40499ba2c9ca5df64abff1cfac2c63fe30fa25 Mon Sep 17 00:00:00 2001 From: tianyiw Date: Tue, 12 Apr 2022 21:36:19 +0800 Subject: [PATCH 045/419] Update basic.php --- standard/basic.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/standard/basic.php b/standard/basic.php index 6b1a24db0..13cf90005 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -185,9 +185,11 @@ function sapi_windows_vt100_support($stream, ?bool $enable = null): bool {} * A callback function to set or remove. If set, this function will be called whenever a CTRL+C or CTRL+BREAK event occurs. *

*

- * The function is supposed to have the following signature:
- * `handler(int $event): void`
- * `event` The CTRL event which has been received; either PHP_WINDOWS_EVENT_CTRL_C or PHP_WINDOWS_EVENT_CTRL_BREAK. + * The function is supposed to have the following signature: + * + * handler(int $event): void + * + * event The CTRL event which has been received; either PHP_WINDOWS_EVENT_CTRL_C or PHP_WINDOWS_EVENT_CTRL_BREAK. *

*

* Setting a null handler causes the process to ignore CTRL+C events, but not CTRL+BREAK events. From ef3d725bf1bf35473444778b8f5c161deee6858b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Pel=C3=AD=C5=A1ek?= Date: Wed, 13 Apr 2022 13:59:09 +0000 Subject: [PATCH 046/419] Improved wording Dimension is not a suitable word here. From purely mathematical point of view it would mean array of arrays of array. --- meta/attributes/ArrayShape.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/attributes/ArrayShape.php b/meta/attributes/ArrayShape.php index 17a91ad5b..eda3ea1d0 100644 --- a/meta/attributes/ArrayShape.php +++ b/meta/attributes/ArrayShape.php @@ -13,7 +13,7 @@ * * Example:
* #[ArrayShape(["f" => "int", "string", "x" => "float"])] - * This usage applied on an element effectively means that the array has 3 dimensions, the keys are "f", 1, and "x", and the corresponding types are "int", "string", and "float". + * This usage applied on an element effectively means that the array has 3 elements, the keys are "f", 1, and "x", and the corresponding types are "int", "string", and "float". */ #[Attribute(Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD|Attribute::TARGET_PARAMETER|Attribute::TARGET_PROPERTY)] class ArrayShape From 4b95f4f68c050574d4f448223e2643ddf06d45da Mon Sep 17 00:00:00 2001 From: Tim Bond Date: Thu, 14 Apr 2022 01:16:34 -0700 Subject: [PATCH 047/419] Update deprecation information for date functions --- date/date.php | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/date/date.php b/date/date.php index 0a83447f0..b610d7665 100644 --- a/date/date.php +++ b/date/date.php @@ -1418,10 +1418,10 @@ 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 + * @deprecated in 8.1. Use {@link date_sun_info} instead */ #[Pure(true)] -#[Deprecated(since: '8.1')] +#[Deprecated(reason: 'in 8.1. Use date_sun_info instead', since: '8.1')] function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude, ?float $longitude, ?float $zenith, ?float $utcOffset): string|int|float|false {} /** @@ -1470,10 +1470,10 @@ 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 + * @deprecated in 8.1. Use {@link date_sun_info} instead */ #[Pure(true)] -#[Deprecated(since: '8.1')] +#[Deprecated(reason: 'in 8.1. Use date_sun_info instead', since: '8.1')] function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?float $latitude, ?float $longitude, ?float $zenith, ?float $utcOffset): string|int|float|false {} /** @@ -1488,11 +1488,36 @@ function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?f * @param float $longitude

* Longitude in degrees. *

- * @return array|false array on success or false on failure. + * @return array{ + * sunrise: int|bool, + * sunset: int|bool, + * transit: int|bool, + * civil_twilight_begin: int|bool, + * civil_twilight_end: int|bool, + * nautical_twilight_begin: int|bool, + * nautical_twilight_end: int|bool, + * astronomical_twilight_begin: int|bool, + * astronomical_twilight_end: int|bool, + * }|false Returns array on success or false on failure. The structure of the array is detailed in the following list: + * + * + * + * + * + * + * + * + * + * + *
sunriseThe timestamp of the sunrise (zenith angle = 90°35').
sunsetThe timestamp of the sunset (zenith angle = 90°35').
transitThe timestamp when the sun is at its zenith, i.e. has reached its topmost point.
civil_twilight_beginThe start of the civil dawn (zenith angle = 96°). It ends at sunrise.
civil_twilight_endThe end of the civil dusk (zenith angle = 96°). It starts at sunset.
nautical_twilight_beginThe start of the nautical dawn (zenith angle = 102°). It ends at civil_twilight_begin.
nautical_twilight_endThe end of the nautical dusk (zenith angle = 102°). It starts at civil_twilight_end.
astronomical_twilight_beginThe start of the astronomical dawn (zenith angle = 108°). It ends at nautical_twilight_begin.
astronomical_twilight_endThe end of the astronomical dusk (zenith angle = 108°). It starts at nautical_twilight_end.
+ *
+ * The values of the array elements are either UNIX timestamps, false if the + * sun is below the respective zenith for the whole day, or true if the sun is + * above the respective zenith for the whole day. * @since 5.1.2 */ #[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] -function date_sun_info(int $timestamp, float $latitude, float $longitude) {} +function date_sun_info(int $timestamp, float $latitude, float $longitude): array|false {} // End of date v.5.3.2-0.dotdeb.1 From 43c63636cbbb4d52e586171d87101281a22db531 Mon Sep 17 00:00:00 2001 From: "Maxim.Kolmakov" Date: Tue, 26 Apr 2022 10:52:25 +0200 Subject: [PATCH 048/419] getClosure might return null in case of errors --- Reflection/ReflectionFunction.php | 4 ++-- Reflection/ReflectionMethod.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Reflection/ReflectionFunction.php b/Reflection/ReflectionFunction.php index 8958e802f..e732446f5 100644 --- a/Reflection/ReflectionFunction.php +++ b/Reflection/ReflectionFunction.php @@ -97,9 +97,9 @@ public function invokeArgs(array $args): mixed {} * Returns a dynamically created closure for the function * * @link https://php.net/manual/en/reflectionfunction.getclosure.php - * @return Closure Returns {@see Closure} or {@see null} in case of an error. + * @return Closure|null Returns {@see Closure} or {@see null} in case of an error. */ #[Pure] #[TentativeType] - public function getClosure(): Closure {} + public function getClosure(): ?Closure {} } diff --git a/Reflection/ReflectionMethod.php b/Reflection/ReflectionMethod.php index 980cf4f54..034bbf616 100644 --- a/Reflection/ReflectionMethod.php +++ b/Reflection/ReflectionMethod.php @@ -190,7 +190,7 @@ public function isDestructor(): bool {} * * @link https://php.net/manual/en/reflectionmethod.getclosure.php * @param object $object Forbidden for static methods, required for other methods or nothing. - * @return Closure Retruns {@see Closure} or {@see null} in case of an error. + * @return Closure|null Returns {@see Closure} or {@see null} in case of an error. * @since 5.4 */ #[Pure] @@ -198,7 +198,7 @@ public function isDestructor(): bool {} public function getClosure( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.3')] $object, #[PhpStormStubsElementAvailable(from: '7.4')] #[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object = null - ): Closure {} + ): ?Closure {} /** * Gets the method modifiers From 79317085c962249103d6979335b8e5b5e3ec63c3 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Wed, 27 Apr 2022 22:28:50 +0200 Subject: [PATCH 049/419] [phpstorm-stubs] update stubs according to latest php 8.1 --- PhpStormStubsMap.php | 1 + SPL/SPL_c1.php | 2 ++ json/json.php | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index e87726ab2..32558c45e 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -8081,6 +8081,7 @@ final class PhpStormStubsMap 'JSON_ERROR_INF_OR_NAN' => 'json/json.php', 'JSON_ERROR_INVALID_PROPERTY_NAME' => 'json/json.php', 'JSON_ERROR_NONE' => 'json/json.php', + 'JSON_ERROR_NON_BACKED_ENUM' => 'json/json.php', 'JSON_ERROR_RECURSION' => 'json/json.php', 'JSON_ERROR_STATE_MISMATCH' => 'json/json.php', 'JSON_ERROR_SYNTAX' => 'json/json.php', diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 696792111..b49f0b832 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -363,6 +363,7 @@ public function valid(): bool {} * @link https://php.net/manual/en/directoryiterator.key.php * @return string The key for the current DirectoryIterator item. */ + #[TentativeType] public function key(): mixed {} /** @@ -370,6 +371,7 @@ public function key(): mixed {} * @link https://php.net/manual/en/directoryiterator.current.php * @return DirectoryIterator The current DirectoryIterator item. */ + #[TentativeType] public function current(): mixed {} /** diff --git a/json/json.php b/json/json.php index 0053c636c..5019eb5f1 100644 --- a/json/json.php +++ b/json/json.php @@ -444,6 +444,11 @@ function json_last_error_msg(): string {} */ define('JSON_THROW_ON_ERROR', 4194304); +/** + * @since 8.1 + */ +define('JSON_ERROR_NON_BACKED_ENUM', 11); + /** * Class JsonException * From 3495280dc50b3519c77e11a02422064312f36d71 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Wed, 27 Apr 2022 23:01:11 +0200 Subject: [PATCH 050/419] [phpstorm-stubs] remove nullable from return type of getClosure signature Return type is declared as tentative and according to official stubs return type in signature is Closure so nullable type should be declared in PhpDoc --- Reflection/ReflectionFunction.php | 2 +- Reflection/ReflectionMethod.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Reflection/ReflectionFunction.php b/Reflection/ReflectionFunction.php index e732446f5..5d883685b 100644 --- a/Reflection/ReflectionFunction.php +++ b/Reflection/ReflectionFunction.php @@ -101,5 +101,5 @@ public function invokeArgs(array $args): mixed {} */ #[Pure] #[TentativeType] - public function getClosure(): ?Closure {} + public function getClosure(): Closure {} } diff --git a/Reflection/ReflectionMethod.php b/Reflection/ReflectionMethod.php index 034bbf616..e552020ff 100644 --- a/Reflection/ReflectionMethod.php +++ b/Reflection/ReflectionMethod.php @@ -198,7 +198,7 @@ public function isDestructor(): bool {} public function getClosure( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.3')] $object, #[PhpStormStubsElementAvailable(from: '7.4')] #[LanguageLevelTypeAware(['8.0' => 'object|null'], default: '')] $object = null - ): ?Closure {} + ): Closure {} /** * Gets the method modifiers From e89f2a2a94f379826368d120d2737703a4782a64 Mon Sep 17 00:00:00 2001 From: boymelancholy <50545243+boymelancholy@users.noreply.github.com> Date: Mon, 2 May 2022 00:48:21 +0900 Subject: [PATCH 051/419] Typo.Not "Retrun", "Return" --- Reflection/ReflectionProperty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reflection/ReflectionProperty.php b/Reflection/ReflectionProperty.php index 5cb4cc3b3..49a669c25 100644 --- a/Reflection/ReflectionProperty.php +++ b/Reflection/ReflectionProperty.php @@ -180,7 +180,7 @@ public function isProtected(): bool {} * Checks if property is static * * @link https://php.net/manual/en/reflectionproperty.isstatic.php - * @return bool Retruns {@see true} if the property is static, {@see false} otherwise. + * @return bool Returns {@see true} if the property is static, {@see false} otherwise. */ #[Pure] #[TentativeType] From 622af8cbcd48de7bf43774d713ddcee37cdba73b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 1 May 2022 12:45:02 +0100 Subject: [PATCH 052/419] [phpstorm-stubs] remove redundant SplPriorityQueue::__construct --- SPL/SPL_c1.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index b49f0b832..929805a6c 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -1640,12 +1640,6 @@ class SplPriorityQueue implements Iterator, Countable public const EXTR_PRIORITY = 2; public const EXTR_DATA = 1; - /** - * Construct a new SplPriorityQueue object - * @link https://www.php.net/manual/en/splpriorityqueue.construct.php - */ - public function __construct() {} - /** * Compare priorities in order to place elements correctly in the heap while sifting up. * @link https://php.net/manual/en/splpriorityqueue.compare.php From a39e937ff172b0be782a0f0711d74b3fd5ffe6f1 Mon Sep 17 00:00:00 2001 From: Stephen Ostrow Date: Thu, 28 Apr 2022 09:49:58 -0400 Subject: [PATCH 053/419] Additional signature for newrelic_notice_error for passing an Exception Documents for newrelic give a fourth signature option for newrelice_notice_error() which is not listed in the stub. newrelic_notice_error(string $errstr, Throwable|Exception $e) See https://docs.newrelic.com/docs/apm/agents/php-agent/php-agent-api/newrelic_notice_error/ --- newrelic/newrelic.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/newrelic/newrelic.php b/newrelic/newrelic.php index 69bc9f3a4..f9be8700d 100644 --- a/newrelic/newrelic.php +++ b/newrelic/newrelic.php @@ -275,23 +275,24 @@ function newrelic_name_transaction(string $name): bool {} * case: * - newrelic_notice_error(string $message) * - newrelic_notice_error(Throwable|Exception $e) + * - newrelic_notice_error(string $errstr, Throwable|Exception $e) * - newrelic_notice_error(int $errno, string $errstr, string $errfile, int $errline, string $errcontext) * * @link https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_notice_error/ * @since 2.6 * - * @param string|Throwable|Exception|int $messageOrExceptionOrCode Either an error message, an exception object, or + * @param string|Throwable|Exception|int $messageOrExceptionOrCode Either an error message, an exception object, or * an * integer error code - * @param string|null $errstr [optional] Required if first argument is an + * @param string|Throwable|Exception|null $errstrOrException [optional] Required if first argument is an * integer, Provide an error message that will be * meaningful to you when it displays in error - * traces. - * @param string|null $errfile [optional] The name of the file that the error + * traces or an exception object. + * @param string|null $errfile [optional] The name of the file that the error * occurred in. - * @param int|null $errline [optional] The line number where the error + * @param int|null $errline [optional] The line number where the error * occurred. - * @param string|null $errcontext [optional] An array that points to the symbol + * @param string|null $errcontext [optional] An array that points to the symbol * table * that was active when the error occurred. * @@ -299,7 +300,7 @@ function newrelic_name_transaction(string $name): bool {} */ function newrelic_notice_error( string|Throwable|Exception|int $messageOrExceptionOrCode, - string $errstr = null, + string|Throwable|Exception $errstrOrException = null, string $errfile = null, int $errline = null, string $errcontext = null From 004d450ed5c4bf40e89be62159e081368aa1a200 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 30 Apr 2022 14:16:06 +0200 Subject: [PATCH 054/419] [phpstorm-stubs] WI-60009 add template to ReflectionClass --- Reflection/ReflectionClass.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Reflection/ReflectionClass.php b/Reflection/ReflectionClass.php index 5834c5ceb..5c892137f 100644 --- a/Reflection/ReflectionClass.php +++ b/Reflection/ReflectionClass.php @@ -8,6 +8,7 @@ use JetBrains\PhpStorm\Pure; /** + * @template T * The ReflectionClass class reports information about a class. * * @link https://php.net/manual/en/class.reflectionclass.php @@ -46,7 +47,7 @@ class ReflectionClass implements Reflector * Constructs a ReflectionClass * * @link https://php.net/manual/en/reflectionclass.construct.php - * @param string|object $objectOrClass Either a string containing the name of + * @param string|object|T $objectOrClass Either a string containing the name of * the class to reflect, or an object. * @throws ReflectionException if the class does not exist. */ @@ -457,7 +458,7 @@ public function newInstance(...$args) {} * Creates a new class instance without invoking the constructor. * * @link https://php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php - * @return object a new instance of the class. + * @return object|T a new instance of the class. * @throws ReflectionException if the class is an internal class that * cannot be instantiated without invoking the constructor. In PHP 5.6.0 * onwards, this exception is limited only to internal classes that are final. From 407ba76b3f943b86c3a887bca9f8d4d5d606762a Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Tue, 3 May 2022 12:39:05 +0200 Subject: [PATCH 055/419] [phpstorm-stubs] improve PhpDocs a bit --- FFI/FFI.php | 2 +- pcre/pcre.php | 2 +- standard/standard_9.php | 22 +++++++++++----------- v8js/v8js.php | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/FFI/FFI.php b/FFI/FFI.php index 8e6de50c0..9cb4c7383 100644 --- a/FFI/FFI.php +++ b/FFI/FFI.php @@ -157,7 +157,7 @@ public static function typeof(CData $ptr): CType {} * dimensions specified by $dimensions. * * @param CType $type - * @param array|int[] $dimensions + * @param int[] $dimensions * @return CType */ public static function arrayType(CType $type, array $dimensions): CType {} diff --git a/pcre/pcre.php b/pcre/pcre.php index 10b274212..34386bfb6 100644 --- a/pcre/pcre.php +++ b/pcre/pcre.php @@ -387,7 +387,7 @@ function preg_replace_callback( /** * Perform a regular expression search and replace using callbacks * @link https://php.net/manual/en/function.preg-replace-callback-array.php - * @param array|callable[] $pattern An associative array mapping patterns (keys) to callbacks (values) + * @param callable[] $pattern An associative array mapping patterns (keys) to callbacks (values) * @param string|string[] $subject * @param int $limit [optional] * @param int &$count [optional] diff --git a/standard/standard_9.php b/standard/standard_9.php index 627909c55..c2a49d890 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -292,7 +292,7 @@ function array_intersect(array $array, #[PhpStormStubsElementAvailable(from: '5. * The array with main keys to check. *

* @param array ...$arrays - * @return array an associative array containing all the entries of + * @return array an associative array containing all the values and keys of * array1 which have keys that are present in all * arguments. * @meta @@ -343,7 +343,7 @@ function array_intersect_ukey( * the first argument is considered to be respectively less than, equal * to, or greater than the second. *

- * @return array an array containing all the values of array1 + * @return array an array containing all the values and keys of array1 * that are present in all the arguments. * @meta */ @@ -361,7 +361,7 @@ function array_uintersect( * The array with main values to check. *

* @param array $arrays - * @return array an associative array containing all the values in + * @return array an associative array containing all the values and keys in * array1 that are present in all of the arguments. * @meta */ @@ -385,7 +385,7 @@ function array_intersect_assoc(array $array, #[PhpStormStubsElementAvailable(fro * second. *

* @param array ...$rest - * @return array an array containing all the values of + * @return array an array containing all the values and keys of * array1 that are present in all the arguments. * @meta */ @@ -440,7 +440,7 @@ function array_intersect_uassoc( * Key comparison callback function. *

* @param array ...$rest - * @return array an array containing all the values of + * @return array an array containing all the values and keys of * array1 that are present in all the arguments. * @meta */ @@ -476,7 +476,7 @@ function array_diff(array $array, #[PhpStormStubsElementAvailable(from: '5.3', t * @param array $arrays

* An array to compare against *

- * @return array an array containing all the entries from + * @return array an array containing all the values and keys from * array1 whose keys are not present in any of the * other arrays. * @meta @@ -500,7 +500,7 @@ function array_diff_key(array $array, #[PhpStormStubsElementAvailable(from: '5.3 * be respectively less than, equal to, or greater than the second. *

* @param array ...$rest [optional] - * @return array an array containing all the entries from + * @return array an array containing all the values and keys from * array1 that are not present in any of the other arrays. * @meta */ @@ -530,7 +530,7 @@ function array_diff_ukey( * to, or greater than the second. *

* @param array ...$rest [optional] - * @return array an array containing all the values of array1 + * @return array an array containing all the values and keys of array1 * that are not present in any of the other arguments. * @meta */ @@ -581,7 +581,7 @@ function array_diff_assoc( *

* @param array ...$rest [optional] * @return array array_udiff_assoc returns an array - * containing all the values from array1 + * containing all the values and keys from array1 * that are not present in any of the other arguments. * Note that the keys are used in the comparison unlike * array_diff and array_udiff. @@ -614,7 +614,7 @@ function array_udiff_assoc( * be respectively less than, equal to, or greater than the second. *

* @param array ...$rest [optional] - * @return array an array containing all the entries from + * @return array an array containing all the values and keys from * array1 that are not present in any of the other arrays. * @meta */ @@ -657,7 +657,7 @@ function array_diff_uassoc( * the indices by using an internal function. *

* @param array ...$rest [optional] - * @return array an array containing all the values from + * @return array an array containing all the values and keys from * array1 that are not present in any of the other * arguments. * @meta diff --git a/v8js/v8js.php b/v8js/v8js.php index 5d3ac00df..709e78e52 100644 --- a/v8js/v8js.php +++ b/v8js/v8js.php @@ -118,7 +118,7 @@ public static function registerExtension($extension_name, $code, array $dependen /** * Returns extensions successfully registered with V8Js::registerExtension(). - * @return array|string[] + * @return string[] */ public static function getExtensions() {} From dd390865a162fb7c69f4d430f94b10f08852b1bf Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Wed, 4 May 2022 15:22:26 +0200 Subject: [PATCH 056/419] WI-66372 Fixed typos in ArrayShape --- imagick/imagick.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagick/imagick.php b/imagick/imagick.php index 5ccd40d50..b010fa4e0 100644 --- a/imagick/imagick.php +++ b/imagick/imagick.php @@ -4675,7 +4675,7 @@ public static function getQuantumDepth() {} * @link https://php.net/manual/en/imagick.getquantumrange.php * @return array the Imagick quantum range as a string. */ - #[ArrayShape(["quantumDepthLong" => "int", "quantumDepthString" => "string"])] + #[ArrayShape(["quantumRangeLong" => "int", "quantumRangeString" => "string"])] public static function getQuantumRange() {} /** From db803b26322bc8fef6f900da3acda0a778ffdbf3 Mon Sep 17 00:00:00 2001 From: Adrian Pennington Date: Wed, 4 May 2022 11:43:09 +0100 Subject: [PATCH 057/419] Update imap_sort documentation - reverse is boolean as of php 8.0 - search_criteria and charset are now optional --- imap/imap.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imap/imap.php b/imap/imap.php index 0e8dd80a0..30c1fe5a1 100644 --- a/imap/imap.php +++ b/imap/imap.php @@ -918,22 +918,22 @@ function imap_clearflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection * @param int $criteria

* Criteria can be one (and only one) of the following: * SORTDATE - message Date

- * @param int $reverse

+ * @param bool $reverse

* Set this to 1 for reverse sorting *

* @param int $flags [optional]

* The options are a bitmask of one or more of the * following: * SE_UID - Return UIDs instead of sequence numbers

- * @param string $search_criteria [optional] - * @param string $charset + * @param string|null $search_criteria [optional] + * @param string|null $charset [optional] * @return array|false an array of message numbers sorted by the given * parameters. */ function imap_sort( #[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, int $criteria, - bool $reverse, + #[LanguageLevelTypeAware(['8.0' => 'bool'], default: 'int')] $reverse, int $flags = 0, ?string $search_criteria = null, ?string $charset = null From 2aa1fe92371d1dea9ada00c0497bbf80231de655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Kube=C5=A1?= Date: Thu, 5 May 2022 15:21:45 +0200 Subject: [PATCH 058/419] MongoDB Serializable interface is not deprecated --- mongodb/mongodb.php | 1 - 1 file changed, 1 deletion(-) diff --git a/mongodb/mongodb.php b/mongodb/mongodb.php index 8e825470e..394a67c3f 100644 --- a/mongodb/mongodb.php +++ b/mongodb/mongodb.php @@ -2768,7 +2768,6 @@ interface Persistable extends Unserializable, Serializable {} * Classes that implement this interface may return data to be serialized as a BSON array or document in lieu of the object's public properties * @link https://php.net/manual/en/class.mongodb-bson-serializable.php */ - #[Deprecated(since: '8.1')] interface Serializable extends Type { /** From 4e756892120c49b2b9781b762a942c6e59248abe Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Tue, 3 May 2022 15:26:37 +0200 Subject: [PATCH 059/419] [phpstorm-stubs] WI-65079 add expected values for setlocale --- meta/locales/.phpstorm.meta.php | 211 ++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 meta/locales/.phpstorm.meta.php diff --git a/meta/locales/.phpstorm.meta.php b/meta/locales/.phpstorm.meta.php new file mode 100644 index 000000000..ca5bf1f5f --- /dev/null +++ b/meta/locales/.phpstorm.meta.php @@ -0,0 +1,211 @@ + Date: Wed, 11 May 2022 16:18:25 +0200 Subject: [PATCH 060/419] Fixed default value of array_reduce initial parameter --- standard/standard_9.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_9.php b/standard/standard_9.php index c2a49d890..fae4f3286 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -169,7 +169,7 @@ function array_reverse(array $array, bool $preserve_keys = false): array {} *

* @meta */ -function array_reduce(array $array, callable $callback, mixed $initial): mixed {} +function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {} /** * Pad array to the specified length with a value From 2f70bf285c0bbe04082ac16015fac0a0f8c1db07 Mon Sep 17 00:00:00 2001 From: Tim Bond Date: Thu, 28 Apr 2022 01:38:25 -0700 Subject: [PATCH 061/419] Add return type description for passthru() --- standard/standard_2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_2.php b/standard/standard_2.php index 58279ed5b..429333348 100644 --- a/standard/standard_2.php +++ b/standard/standard_2.php @@ -719,7 +719,7 @@ function escapeshellarg(string $arg): string {} * If the return_var argument is present, the * return status of the Unix command will be placed here. *

- * @return bool|null + * @return bool|null null on success or false on failure. */ function passthru(string $command, &$result_code): ?bool {} From 92194fe66e62b1281e5d6ab92aa00e1232ec7f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 11 May 2022 21:26:36 +0200 Subject: [PATCH 062/419] Leverage templating even more for ReflectionClass --- Reflection/ReflectionClass.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Reflection/ReflectionClass.php b/Reflection/ReflectionClass.php index 5c892137f..9fc52cee9 100644 --- a/Reflection/ReflectionClass.php +++ b/Reflection/ReflectionClass.php @@ -8,7 +8,7 @@ use JetBrains\PhpStorm\Pure; /** - * @template T + * @template T of object * The ReflectionClass class reports information about a class. * * @link https://php.net/manual/en/class.reflectionclass.php @@ -16,7 +16,7 @@ class ReflectionClass implements Reflector { /** - * @var string Name of the class, same as calling the {@see ReflectionClass::getName()} method + * @var class-string Name of the class, same as calling the {@see ReflectionClass::getName()} method */ #[Immutable] #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] @@ -47,7 +47,7 @@ class ReflectionClass implements Reflector * Constructs a ReflectionClass * * @link https://php.net/manual/en/reflectionclass.construct.php - * @param string|object|T $objectOrClass Either a string containing the name of + * @param class-string|T $objectOrClass Either a string containing the name of * the class to reflect, or an object. * @throws ReflectionException if the class does not exist. */ @@ -447,7 +447,7 @@ public function isInstance(#[LanguageLevelTypeAware(['8.0' => 'object'], default * @link https://php.net/manual/en/reflectionclass.newinstance.php * @param mixed ...$args Accepts a variable number of arguments which are * passed to the class constructor, much like {@see call_user_func} - * @return object a new instance of the class. + * @return T a new instance of the class. * @throws ReflectionException if the class constructor is not public or if * the class does not have a constructor and the $args parameter contains * one or more parameters. @@ -458,7 +458,7 @@ public function newInstance(...$args) {} * Creates a new class instance without invoking the constructor. * * @link https://php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php - * @return object|T a new instance of the class. + * @return T a new instance of the class. * @throws ReflectionException if the class is an internal class that * cannot be instantiated without invoking the constructor. In PHP 5.6.0 * onwards, this exception is limited only to internal classes that are final. @@ -472,7 +472,7 @@ public function newInstanceWithoutConstructor(): object {} * * @link https://php.net/manual/en/reflectionclass.newinstanceargs.php * @param array $args The parameters to be passed to the class constructor as an array. - * @return object|null a new instance of the class. + * @return T|null a new instance of the class. * @throws ReflectionException if the class constructor is not public or if * the class does not have a constructor and the $args parameter contains * one or more parameters. From 2cfb9124df73aa8cee8d0926342996e88873216f Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Mon, 16 May 2022 16:57:12 +0200 Subject: [PATCH 063/419] Changed PGSQL_LIBPQ_VERSION value to match current version --- pgsql/pgsql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 40b340d89..4e5a77133 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -2062,8 +2062,8 @@ function pg_consume_input(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'] */ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection): int|bool {} -define('PGSQL_LIBPQ_VERSION', "14.2"); -define('PGSQL_LIBPQ_VERSION_STR', "14.2"); +define('PGSQL_LIBPQ_VERSION', "14.3"); +define('PGSQL_LIBPQ_VERSION_STR', "14.3"); /** * Passed to pg_connect to force the creation of a new connection, From 4d56c4fe76164d43096b2775b2510042adee34b8 Mon Sep 17 00:00:00 2001 From: Takayasu Oyama Date: Mon, 16 May 2022 09:50:02 +0900 Subject: [PATCH 064/419] Update Redis.php I believe this is a typo. see https://github.com/phpredis/phpredis#mset-msetnx --- redis/Redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index 3c7d33128..5eb862e10 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -2848,7 +2848,7 @@ public function persist($key) {} * @link https://redis.io/commands/mset * @example *
-     * $redis->mset(array('key0' => 'value0', 'key1' => 'value1'));
+     * $redis->mSet(array('key0' => 'value0', 'key1' => 'value1'));
      * var_dump($redis->get('key0'));
      * var_dump($redis->get('key1'));
      * // Output:
@@ -2856,7 +2856,7 @@ public function persist($key) {}
      * // string(6) "value1"
      * 
*/ - public function mset(array $array) {} + public function mSet(array $array) {} /** * Get the values of all the specified keys. From 279ef21f8841201bfd78bd052de0f954fd342230 Mon Sep 17 00:00:00 2001 From: rtm-ctrlz Date: Wed, 18 May 2022 11:12:14 +0300 Subject: [PATCH 065/419] fix(standard/assert): second parameter can be `Throwable` since 7.0 --- standard/standard_9.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_9.php b/standard/standard_9.php index fae4f3286..1dbb56158 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -887,7 +887,7 @@ function key_exists($key, array $array): bool {} */ function assert( mixed $assertion, - #[LanguageLevelTypeAware(['8.0' => 'Throwable|string|null'], default: 'string')] $description = null + #[LanguageLevelTypeAware(['7.0' => 'Throwable|string|null'], default: 'string')] $description = null ): bool {} /** From 8a4364aceb9a8d86e49e110468dcccdb53261ac7 Mon Sep 17 00:00:00 2001 From: Zebulan Stanphill Date: Wed, 18 May 2022 13:38:02 -0500 Subject: [PATCH 066/419] Fix: Ds\Collection should extend IteratorAggregate. --- ds/ds.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ds/ds.php b/ds/ds.php index b07a27389..8d5f33d85 100644 --- a/ds/ds.php +++ b/ds/ds.php @@ -11,6 +11,7 @@ namespace Ds; use Countable; + use IteratorAggregate; use JsonSerializable; use OutOfBoundsException; use OutOfRangeException; @@ -24,7 +25,7 @@ * json_encode(). * @package Ds */ - interface Collection extends Traversable, Countable, JsonSerializable + interface Collection extends Countable, IteratorAggregate, JsonSerializable { /** * Removes all values from the collection. @@ -550,6 +551,8 @@ public function first() {} */ public function get(int $index) {} + public function getIterator(): Traversable {} + /** * Inserts values into the sequence at a given index. * @@ -826,6 +829,8 @@ public function clear(): void {} */ public function copy(): Collection {} + public function getIterator(): Traversable {} + /** * Returns whether the deque is empty. * @link https://www.php.net/manual/en/ds-deque.isempty.php @@ -1262,6 +1267,8 @@ public function first(): Pair {} */ public function get($key, $default = null) {} + public function getIterator(): Traversable {} + /** * Determines whether the map contains a given key * @@ -1897,6 +1904,8 @@ public function first() {} */ public function get(int $index) {} + public function getIterator(): Traversable {} + /** * Creates a new set using values common to both the current instance * and another set. In other words, returns a copy of the current @@ -2210,6 +2219,8 @@ public function count(): int {} */ public function copy(): Stack {} + public function getIterator(): Traversable {} + /** * Returns whether the collection is empty. * @link https://www.php.net/manual/en/ds-stack.isempty.php @@ -2336,6 +2347,8 @@ public function count(): int {} */ public function copy(): Stack {} + public function getIterator(): Traversable {} + /** * Returns whether the collection is empty. * @link https://www.php.net/manual/en/ds-queue.isempty.php @@ -2432,6 +2445,8 @@ public function clear(): void {} */ public function copy() {} + public function getIterator(): Traversable {} + /** * Returns whether the collection is empty. * @link https://www.php.net/manual/en/ds-collection.isempty.php From 0f6e6442c1aeda0caf6c01d8db80243108aaafdf Mon Sep 17 00:00:00 2001 From: Zebulan Stanphill Date: Wed, 18 May 2022 15:00:52 -0500 Subject: [PATCH 067/419] Add missing Ds\PriorityQueue#peek method. --- ds/ds.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ds/ds.php b/ds/ds.php index 8d5f33d85..fb48d456e 100644 --- a/ds/ds.php +++ b/ds/ds.php @@ -2454,6 +2454,15 @@ public function getIterator(): Traversable {} */ public function isEmpty(): bool {} + /** + * Returns the value at the front of the queue, but does not remove it. + * @link https://www.php.net/manual/en/ds-priorityqueue.peek.php + * + * @return mixed The value at the front of the queue. + * @throws UnderflowException if empty. + */ + public function peek() {} + /** * Pushes a value with a given priority into the queue. * From a664b228eb921736f77bf9655506b7796f7ac943 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Tue, 24 May 2022 14:23:17 +0200 Subject: [PATCH 068/419] WI-66818 Provide updated meta signatures for old versions of Mockery see https://github.com/mockery/mockery/issues/1181 --- meta/mockery/.phpstorm.meta.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 meta/mockery/.phpstorm.meta.php diff --git a/meta/mockery/.phpstorm.meta.php b/meta/mockery/.phpstorm.meta.php new file mode 100644 index 000000000..bb7acee5a --- /dev/null +++ b/meta/mockery/.phpstorm.meta.php @@ -0,0 +1,11 @@ + "@"])); +override(\Mockery::spy(0), map(["" => "@"])); +override(\Mockery::namedMock(0), map(["" => "@"])); +override(\Mockery::instanceMock(0), map(["" => "@"])); +override(\mock(0), map(["" => "@"])); +override(\spy(0), map(["" => "@"])); +override(\namedMock(0), map(["" => "@"])); \ No newline at end of file From da8a8fa3a06be8796b21bd9ee727c94d32c5a285 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 10 Jun 2022 11:30:51 +0200 Subject: [PATCH 069/419] [phpstorm-stubs] remove php7-pecl-amqp from docker image --- tests/DockerImages/7.1/Dockerfile | 2 +- tests/DockerImages/7.2/Dockerfile | 2 +- tests/DockerImages/7.3/Dockerfile | 2 +- tests/DockerImages/7.4/Dockerfile | 2 +- tests/DockerImages/8.0/Dockerfile | 2 +- tests/DockerImages/8.1/Dockerfile | 2 +- tests/DockerImages/peclExtensions/Dockerfile | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/DockerImages/7.1/Dockerfile b/tests/DockerImages/7.1/Dockerfile index 1360f1cb8..da6e1de44 100644 --- a/tests/DockerImages/7.1/Dockerfile +++ b/tests/DockerImages/7.1/Dockerfile @@ -4,7 +4,7 @@ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ - php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ + php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev aspell-dev diff --git a/tests/DockerImages/7.2/Dockerfile b/tests/DockerImages/7.2/Dockerfile index be9c61db2..1d4611948 100644 --- a/tests/DockerImages/7.2/Dockerfile +++ b/tests/DockerImages/7.2/Dockerfile @@ -4,7 +4,7 @@ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ - php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ + php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev aspell-dev diff --git a/tests/DockerImages/7.3/Dockerfile b/tests/DockerImages/7.3/Dockerfile index 593d08f2f..307861dcf 100644 --- a/tests/DockerImages/7.3/Dockerfile +++ b/tests/DockerImages/7.3/Dockerfile @@ -4,7 +4,7 @@ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php7-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ - php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ + php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev diff --git a/tests/DockerImages/7.4/Dockerfile b/tests/DockerImages/7.4/Dockerfile index 1fc15674a..9db2cfc0a 100644 --- a/tests/DockerImages/7.4/Dockerfile +++ b/tests/DockerImages/7.4/Dockerfile @@ -4,7 +4,7 @@ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php7-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ - php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ + php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev diff --git a/tests/DockerImages/8.0/Dockerfile b/tests/DockerImages/8.0/Dockerfile index 6e612e3b1..709315711 100644 --- a/tests/DockerImages/8.0/Dockerfile +++ b/tests/DockerImages/8.0/Dockerfile @@ -4,7 +4,7 @@ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ - php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ + php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev diff --git a/tests/DockerImages/8.1/Dockerfile b/tests/DockerImages/8.1/Dockerfile index 50de63ade..649b01f27 100644 --- a/tests/DockerImages/8.1/Dockerfile +++ b/tests/DockerImages/8.1/Dockerfile @@ -4,7 +4,7 @@ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ - php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ + php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev diff --git a/tests/DockerImages/peclExtensions/Dockerfile b/tests/DockerImages/peclExtensions/Dockerfile index 5b9bef4d8..6447eea06 100644 --- a/tests/DockerImages/peclExtensions/Dockerfile +++ b/tests/DockerImages/peclExtensions/Dockerfile @@ -4,7 +4,7 @@ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ - php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear php7-pecl-amqp rabbitmq-c rabbitmq-c-dev librrd \ + php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev From 81b3842e18d95eeb1b9050caf3b0eef34fb17c46 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 10 Jun 2022 11:38:09 +0200 Subject: [PATCH 070/419] [phpstorm-stubs] remove missing packages from docker image --- tests/DockerImages/7.4/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/DockerImages/7.4/Dockerfile b/tests/DockerImages/7.4/Dockerfile index 9db2cfc0a..d99adbfd3 100644 --- a/tests/DockerImages/7.4/Dockerfile +++ b/tests/DockerImages/7.4/Dockerfile @@ -3,8 +3,8 @@ FROM php:7.4-alpine RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ - libmcrypt-dev imap-dev php7-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ - php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ + libmcrypt-dev imap-dev enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev icu-dev \ + libffi-dev openssl-dev rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev From 76cf5dbdc78131a9bdc8dcf1e88db6498ce9b4a0 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 10 Jun 2022 11:46:40 +0200 Subject: [PATCH 071/419] [phpstorm-stubs] fix constant values --- intl/intl.php | 4 ++-- mbstring/mbstring.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/intl/intl.php b/intl/intl.php index 624a18ae6..32c7127f5 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -6693,8 +6693,8 @@ function intltz_get_id_for_windows_id(string $timezoneId, ?string $region = null * @link https://php.net/manual/en/intl.constants.php */ define('INTL_MAX_LOCALE_LEN', 156); -define('INTL_ICU_VERSION', "69.1"); -define('INTL_ICU_DATA_VERSION', "69.1"); +define('INTL_ICU_VERSION', "71.1"); +define('INTL_ICU_DATA_VERSION', "71.1"); define('ULOC_ACTUAL_LOCALE', 0); define('ULOC_VALID_LOCALE', 1); define('GRAPHEME_EXTR_COUNT', 0); diff --git a/mbstring/mbstring.php b/mbstring/mbstring.php index 1e6b79f16..34281a5a3 100644 --- a/mbstring/mbstring.php +++ b/mbstring/mbstring.php @@ -1428,6 +1428,6 @@ function mb_str_split(string $string, int $length = 1, ?string $encoding) {} /** * @since 7.4 */ -define('MB_ONIGURUMA_VERSION', '6.9.7'); +define('MB_ONIGURUMA_VERSION', '6.9.8'); // End of mbstring v. From f9fb90a49b9491c4179f6191bb97754d0cc983ee Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 10 Jun 2022 13:20:23 +0200 Subject: [PATCH 072/419] [phpstorm-stubs] fix constant parsing to support cast --- tests/Model/PHPConst.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Model/PHPConst.php b/tests/Model/PHPConst.php index 02d2bc4e8..4280385e2 100644 --- a/tests/Model/PHPConst.php +++ b/tests/Model/PHPConst.php @@ -5,6 +5,7 @@ use Exception; use PhpParser\Node\Const_; +use PhpParser\Node\Expr\Cast; use PhpParser\Node\Expr\UnaryMinus; use PhpParser\Node\Stmt\ClassConst; use PhpParser\Node\Stmt\Namespace_; @@ -86,6 +87,8 @@ protected function getConstValue($node) if (in_array('expr', $node->value->getSubNodeNames(), true)) { if ($node->value instanceof UnaryMinus) { return -$node->value->expr->value; + } elseif ($node->value instanceof Cast) { + return $node->value->expr->name->parts[0]; } return $node->value->expr->value; } From 9717ec39b211f2cef82a59c29c9eef0954647fac Mon Sep 17 00:00:00 2001 From: Filippova Maria Date: Fri, 10 Jun 2022 10:23:01 +0300 Subject: [PATCH 073/419] WI-66524 consider `INF` and `NAN` type as float --- standard/standard_defines.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/standard_defines.php b/standard/standard_defines.php index ea1b42051..e7b9a1e38 100644 --- a/standard/standard_defines.php +++ b/standard/standard_defines.php @@ -126,12 +126,12 @@ /** * The infinite */ -define('INF', INF); +define('INF', (float)INF); /** * Not A Number */ -define('NAN', NAN); +define('NAN', (float)NAN); /** * Round halves up From 23d2387e93359e468f676817d8bc31aa6dbe45ef Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 15 Jun 2022 12:25:12 +0300 Subject: [PATCH 074/419] Update date_c.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > DateInterval объект представляет разницу между двумя датами или FALSE в случае возникновения ошибки. --- date/date_c.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/date/date_c.php b/date/date_c.php index 7096b8109..8cc63a4f3 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -344,7 +344,7 @@ public function sub(DateInterval $interval): DateTimeImmutable {} * @link https://secure.php.net/manual/en/datetime.diff.php * @param DateTimeInterface $targetObject

The date to compare to.

* @param bool $absolute [optional]

Should the interval be forced to be positive?

- * @return DateInterval + * @return DateInterval|false * The {@link https://secure.php.net/manual/en/class.dateinterval.php DateInterval} object representing the * difference between the two dates or FALSE on failure. */ @@ -663,7 +663,7 @@ public function getTimestamp(): int {} * Returns the difference between two DateTime objects represented as a DateInterval. * @param DateTimeInterface $targetObject The date to compare to. * @param bool $absolute [optional] Whether to return absolute difference. - * @return DateInterval The DateInterval object representing the difference between the two dates. + * @return DateInterval|false The DateInterval object representing the difference between the two dates. * @link https://php.net/manual/en/datetime.diff.php */ #[TentativeType] From 11e9959926d90dd21f1f36c22dc30dc09cfd7c5b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Tue, 21 Jun 2022 10:29:21 +0200 Subject: [PATCH 075/419] [phpstorm-stubs] fix constant values. Fix warnings --- pgsql/pgsql.php | 4 ++-- tests/Model/PHPConst.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 4e5a77133..fc9974317 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -2062,8 +2062,8 @@ function pg_consume_input(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'] */ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection): int|bool {} -define('PGSQL_LIBPQ_VERSION', "14.3"); -define('PGSQL_LIBPQ_VERSION_STR', "14.3"); +define('PGSQL_LIBPQ_VERSION', "14.4"); +define('PGSQL_LIBPQ_VERSION_STR', "14.4"); /** * Passed to pg_connect to force the creation of a new connection, diff --git a/tests/Model/PHPConst.php b/tests/Model/PHPConst.php index 4280385e2..945ceb6d7 100644 --- a/tests/Model/PHPConst.php +++ b/tests/Model/PHPConst.php @@ -6,6 +6,7 @@ use Exception; use PhpParser\Node\Const_; use PhpParser\Node\Expr\Cast; +use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Expr\UnaryMinus; use PhpParser\Node\Stmt\ClassConst; use PhpParser\Node\Stmt\Namespace_; @@ -87,7 +88,7 @@ protected function getConstValue($node) if (in_array('expr', $node->value->getSubNodeNames(), true)) { if ($node->value instanceof UnaryMinus) { return -$node->value->expr->value; - } elseif ($node->value instanceof Cast) { + } elseif ($node->value instanceof Cast && $node->value->expr instanceof ConstFetch) { return $node->value->expr->name->parts[0]; } return $node->value->expr->value; From d9c383ec1e68b13d370507063431e10efeb93f1f Mon Sep 17 00:00:00 2001 From: Max Nesterenko Date: Tue, 21 Jun 2022 16:58:49 +0300 Subject: [PATCH 076/419] Fix https://github.com/arnaud-lb/php-rdkafka/pull/522 --- rdkafka/RdKafka.php | 2 +- rdkafka/RdKafka/KafkaConsumer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rdkafka/RdKafka.php b/rdkafka/RdKafka.php index 4817c6826..337318150 100755 --- a/rdkafka/RdKafka.php +++ b/rdkafka/RdKafka.php @@ -17,7 +17,7 @@ public function addBrokers($broker_list) {} /** * @param bool $all_topics - * @param Topic $only_topic + * @param null|Topic $only_topic * @param int $timeout_ms * * @throws Exception diff --git a/rdkafka/RdKafka/KafkaConsumer.php b/rdkafka/RdKafka/KafkaConsumer.php index f982cdd3b..6ed89dbea 100755 --- a/rdkafka/RdKafka/KafkaConsumer.php +++ b/rdkafka/RdKafka/KafkaConsumer.php @@ -50,7 +50,7 @@ public function getAssignment() {} /** * @param bool $all_topics - * @param KafkaConsumerTopic $only_topic + * @param null|KafkaConsumerTopic $only_topic * @param int $timeout_ms * * @throws Exception From 842595abcb76351b4f4691a21abada9aad79ead8 Mon Sep 17 00:00:00 2001 From: knesmeyanov Date: Mon, 27 Jun 2022 16:35:01 +0300 Subject: [PATCH 077/419] Fix FFI\CType::TYPE_LONG_DOUBLE constant typo. --- FFI/.phpstorm.meta.php | 2 +- FFI/FFI.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FFI/.phpstorm.meta.php b/FFI/.phpstorm.meta.php index 2e9abca08..7ae877387 100644 --- a/FFI/.phpstorm.meta.php +++ b/FFI/.phpstorm.meta.php @@ -50,7 +50,7 @@ \FFI\CType::TYPE_VOID, \FFI\CType::TYPE_FLOAT, \FFI\CType::TYPE_DOUBLE, - \FFI\CType::TYPE_LONG_DOUBLE, + \FFI\CType::TYPE_LONGDOUBLE, \FFI\CType::TYPE_UINT8, \FFI\CType::TYPE_SINT8, \FFI\CType::TYPE_UINT16, diff --git a/FFI/FFI.php b/FFI/FFI.php index 9cb4c7383..0b2052aee 100644 --- a/FFI/FFI.php +++ b/FFI/FFI.php @@ -360,7 +360,7 @@ class CType * * @since 8.1 */ - public const TYPE_LONG_DOUBLE = 3; + public const TYPE_LONGDOUBLE = 3; /** * @since 8.1 @@ -547,7 +547,7 @@ public function getName(): string {} * - {@see CType::TYPE_VOID} * - {@see CType::TYPE_FLOAT} * - {@see CType::TYPE_DOUBLE} - * - {@see CType::TYPE_LONG_DOUBLE} + * - {@see CType::TYPE_LONGDOUBLE} * - {@see CType::TYPE_UINT8} * - {@see CType::TYPE_SINT8} * - {@see CType::TYPE_UINT16} From fbc99390980abd2dd9c1c2a00ec4d02cce30f9c7 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 29 Jun 2022 09:54:28 +0200 Subject: [PATCH 078/419] Update iterators `key()` and `current()` method return types. --- SPL/SPL.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index ce905c2cd..9db8541e6 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -119,7 +119,7 @@ public function next(): void {} /** * Return the key of the current element * @link https://php.net/manual/en/iterator.key.php - * @return string|float|int|bool|null scalar on success, or null on failure. + * @return mixed scalar on success, or null on failure. */ #[TentativeType] public function key(): never {} @@ -290,7 +290,7 @@ public function valid(): bool {} /** * Access the current key * @link https://php.net/manual/en/recursiveiteratoriterator.key.php - * @return string|float|int|bool|null The current key. + * @return mixed The current key. */ #[TentativeType] public function key(): mixed {} @@ -475,7 +475,7 @@ public function valid(): bool {} /** * Get the key of the current element * @link https://php.net/manual/en/iteratoriterator.key.php - * @return string|float|int|bool|null The key of the current element. + * @return mixed The key of the current element. */ #[TentativeType] public function key(): mixed {} @@ -538,16 +538,16 @@ public function valid() {} /** * Get the current key * @link https://php.net/manual/en/filteriterator.key.php - * @return string|float|int|bool|null The current key. + * @return mixed The current key. */ - public function key() {} + public function key(): mixed {} /** * Get the current element value * @link https://php.net/manual/en/filteriterator.current.php * @return mixed The current element value. */ - public function current() {} + public function current(): mixed {} /** * Move the iterator forward @@ -690,16 +690,16 @@ public function valid(): bool {} /** * Get current key * @link https://php.net/manual/en/limititerator.key.php - * @return string|float|int|bool|null the key for the current item. + * @return mixed the key for the current item. */ - public function key() {} + public function key(): mixed {} /** * Get current element * @link https://php.net/manual/en/limititerator.current.php * @return mixed the current element or null if there is none. */ - public function current() {} + public function current(): mixed {} /** * Move the iterator forward @@ -802,16 +802,16 @@ public function valid(): bool {} /** * Return the key for the current element * @link https://php.net/manual/en/cachingiterator.key.php - * @return string|float|int|bool|null + * @return mixed */ - public function key() {} + public function key(): mixed {} /** * Return the current element * @link https://php.net/manual/en/cachingiterator.current.php * @return mixed */ - public function current() {} + public function current(): mixed {} /** * Move the iterator forward @@ -985,7 +985,7 @@ public function valid(): bool {} /** * Get the current key * @link https://php.net/manual/en/norewinditerator.key.php - * @return string|float|int|bool|null The current key. + * @return mixed The current key. */ #[TentativeType] public function key(): mixed {} @@ -1056,9 +1056,9 @@ public function valid(): bool {} /** * Gets the current key * @link https://php.net/manual/en/appenditerator.key.php - * @return string|float|int|bool|null The current key if it is valid or null otherwise. + * @return mixed The current key if it is valid or null otherwise. */ - public function key() {} + public function key(): mixed {} /** * Gets the current value From c682b097dba1eb7f6c227dcfb6911dbcab44e665 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 29 Jun 2022 10:22:52 +0200 Subject: [PATCH 079/419] Update `valid()` method. --- SPL/SPL.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index 9db8541e6..d9c40e96e 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -533,7 +533,7 @@ public function rewind(): void {} * @link https://php.net/manual/en/filteriterator.valid.php * @return bool true if the current element is valid, otherwise false */ - public function valid() {} + public function valid(): bool {} /** * Get the current key @@ -1399,7 +1399,7 @@ public function rewind() {} * @link https://php.net/manual/en/recursivetreeiterator.valid.php * @return bool true if the current position is valid, otherwise false */ - public function valid() {} + public function valid(): bool {} /** * Get the key of the current element From 9ddc09d8f574793569010e81c1d0fbd6bd9a6f28 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 29 Jun 2022 10:23:46 +0200 Subject: [PATCH 080/419] Update `rewind()` method. --- SPL/SPL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index d9c40e96e..4b8f8950e 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -1392,7 +1392,7 @@ public function __construct( * @link https://php.net/manual/en/recursivetreeiterator.rewind.php * @return void */ - public function rewind() {} + public function rewind(): void {} /** * Check validity From 09c559d796cc9933331c701f95dd1c961d59a416 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 29 Jun 2022 10:24:17 +0200 Subject: [PATCH 081/419] Update `next()` method. --- SPL/SPL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index 4b8f8950e..a1b4df19a 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -1422,7 +1422,7 @@ public function current(): mixed {} * @link https://php.net/manual/en/recursivetreeiterator.next.php * @return void */ - public function next() {} + public function next(): void {} /** * Begin iteration From 387462bbfbfe4ed807a8a73b850f10558ff7873e Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 29 Jun 2022 10:26:30 +0200 Subject: [PATCH 082/419] Update `getInnerIterator()` method. --- SPL/SPL.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index a1b4df19a..a311b9abb 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -562,7 +562,7 @@ public function next(): void {} * @link https://php.net/manual/en/filteriterator.getinneriterator.php * @return Iterator The inner iterator. */ - public function getInnerIterator() {} + public function getInnerIterator(): Iterator {} } /** @@ -733,7 +733,7 @@ public function getPosition(): int {} * @link https://php.net/manual/en/limititerator.getinneriterator.php * @return Iterator The inner iterator passed to LimitIterator::__construct. */ - public function getInnerIterator() {} + public function getInnerIterator(): Iterator {} } /** @@ -842,7 +842,7 @@ public function __toString(): string {} * @link https://php.net/manual/en/cachingiterator.getinneriterator.php * @return Iterator an object implementing the Iterator interface. */ - public function getInnerIterator() {} + public function getInnerIterator(): Iterator {} /** * Get flags used @@ -1011,7 +1011,7 @@ public function next(): void {} * @link https://php.net/manual/en/norewinditerator.getinneriterator.php * @return Iterator The inner iterator, as passed to NoRewindIterator::__construct. */ - public function getInnerIterator() {} + public function getInnerIterator(): Iterator {} } /** @@ -1081,7 +1081,7 @@ public function next(): void {} * @link https://php.net/manual/en/appenditerator.getinneriterator.php * @return Iterator the current inner Iterator. */ - public function getInnerIterator() {} + public function getInnerIterator(): Iterator {} /** * Gets an index of iterators From f4f773981f1ebb5da8a79132e5c2545bb74e39cd Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 30 Jun 2022 08:28:06 +0200 Subject: [PATCH 083/419] Update `key` methods return descriptions. --- SPL/SPL.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index a311b9abb..eff393167 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -119,7 +119,7 @@ public function next(): void {} /** * Return the key of the current element * @link https://php.net/manual/en/iterator.key.php - * @return mixed scalar on success, or null on failure. + * @return mixed The key of the current element. */ #[TentativeType] public function key(): never {} @@ -290,7 +290,7 @@ public function valid(): bool {} /** * Access the current key * @link https://php.net/manual/en/recursiveiteratoriterator.key.php - * @return mixed The current key. + * @return mixed The key of the current element. */ #[TentativeType] public function key(): mixed {} @@ -538,7 +538,7 @@ public function valid(): bool {} /** * Get the current key * @link https://php.net/manual/en/filteriterator.key.php - * @return mixed The current key. + * @return mixed The key of the current element. */ public function key(): mixed {} @@ -690,7 +690,7 @@ public function valid(): bool {} /** * Get current key * @link https://php.net/manual/en/limititerator.key.php - * @return mixed the key for the current item. + * @return mixed The key of the current element. */ public function key(): mixed {} @@ -802,7 +802,7 @@ public function valid(): bool {} /** * Return the key for the current element * @link https://php.net/manual/en/cachingiterator.key.php - * @return mixed + * @return mixed The key of the current element. */ public function key(): mixed {} @@ -985,7 +985,7 @@ public function valid(): bool {} /** * Get the current key * @link https://php.net/manual/en/norewinditerator.key.php - * @return mixed The current key. + * @return mixed The key of the current element. */ #[TentativeType] public function key(): mixed {} @@ -1056,7 +1056,7 @@ public function valid(): bool {} /** * Gets the current key * @link https://php.net/manual/en/appenditerator.key.php - * @return mixed The current key if it is valid or null otherwise. + * @return mixed The key of the current element. */ public function key(): mixed {} @@ -2041,7 +2041,7 @@ public function current(): mixed {} /** * Return current array key * @link https://php.net/manual/en/arrayiterator.key.php - * @return string|int|null The current array key. + * @return string|int|null The key of the current element. */ #[TentativeType] public function key(): string|int|null {} From 68947a59aff705f058048d6af9257275d65c30d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Sun, 10 Jul 2022 01:07:02 +0200 Subject: [PATCH 084/419] Update Redis config() method Fix for `Required parameter '$value' missing` when you calling `config()` method with GET option. E.g. `$redis->config('GET', 'databases')` --- redis/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.php b/redis/Redis.php index 5eb862e10..0a026bec4 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -4333,7 +4333,7 @@ public function geoRadiusByMember($key, $member, $radius, $units, array $options * $redis->config("SET", "dir", "/var/run/redis/dumps/"); *
*/ - public function config($operation, $key, $value) {} + public function config($operation, $key, $value = '') {} /** * Evaluate a LUA script serverside From 429db2f21b52010c84f0240b8a1337ac16758966 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Mon, 11 Jul 2022 17:15:29 +0200 Subject: [PATCH 085/419] Added since tag for GET_EXTENDED --- memcached/memcached.php | 1 + 1 file changed, 1 insertion(+) diff --git a/memcached/memcached.php b/memcached/memcached.php index 2430dda34..1edb4408a 100644 --- a/memcached/memcached.php +++ b/memcached/memcached.php @@ -686,6 +686,7 @@ class Memcached * A flag for Memcached::get(), Memcached::getMulti() and * Memcached::getMultiByKey() to ensure that the CAS token values are returned as well. * @link https://php.net/manual/en/memcached.constants.php + * @since 3.0.0 */ public const GET_EXTENDED = 2; public const GET_ERROR_RETURN_VALUE = false; From d79053e228b41279dc472ca44be8456c9d980af5 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 6 Dec 2021 17:38:17 +0100 Subject: [PATCH 086/419] [phpstorm-stubs] add support for test run on php 5.6 --- .github/workflows/main.yml | 2 +- phpunit.xml.dist | 8 +++++ tests/DockerImages/5.6/Dockerfile | 11 ++++++ tests/Model/BasePHPClass.php | 8 ++--- tests/Model/BasePHPElement.php | 33 +++++++++++------ tests/Model/CommonUtils.php | 8 +++-- tests/Model/PHPClass.php | 3 +- tests/Model/PHPConst.php | 10 ++++-- tests/Model/PHPDefineConstant.php | 1 - tests/Model/PHPDocElement.php | 1 - tests/Model/PHPFunction.php | 13 ++++--- tests/Model/PHPInterface.php | 1 - tests/Model/PHPMethod.php | 1 - tests/Model/PHPParameter.php | 5 +-- tests/Model/PHPProperty.php | 1 - tests/Model/PhpVersions.php | 17 ++++++--- tests/Model/StubProblemType.php | 1 - tests/Model/StubsContainer.php | 35 +++++++++---------- tests/Model/Tags/RemovedTag.php | 10 +++--- tests/Parsers/PHPReflectionParser.php | 7 ++-- .../Providers/ReflectionStubsSingleton.php | 6 ++-- tests/Tools/dump-reflection-to-file.php | 3 +- 22 files changed, 119 insertions(+), 66 deletions(-) create mode 100644 tests/DockerImages/5.6/Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9645e7fb5..353a61be4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] name: Run tests against php ${{matrix.php}} steps: - name: Checkout diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4ec7b964b..cf1edfdfe 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,13 @@ + + tests/BaseClassesTest.php + tests/BaseConstantsTest.php + tests/BaseFunctionsTest.php + tests/StubsMetaExpectedArgumentsTest.php + tests/StubsMetaInternalTagTest.php + tests/StubsPhpDocTest.php + tests/BaseClassesTest.php tests/BaseConstantsTest.php diff --git a/tests/DockerImages/5.6/Dockerfile b/tests/DockerImages/5.6/Dockerfile new file mode 100644 index 000000000..d28050a34 --- /dev/null +++ b/tests/DockerImages/5.6/Dockerfile @@ -0,0 +1,11 @@ +FROM php:5.6-alpine + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + bash gcc g++ make autoconf pkgconfig git \ + libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ + php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c librrd libzip-dev rrdtool-dev \ + gmp-dev yaml yaml-dev fann fann-dev + +RUN docker-php-ext-install imap gmp sockets intl bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ + pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap diff --git a/tests/Model/BasePHPClass.php b/tests/Model/BasePHPClass.php index 6fc66d557..fc5a593d2 100644 --- a/tests/Model/BasePHPClass.php +++ b/tests/Model/BasePHPClass.php @@ -1,5 +1,4 @@ constants, function (PHPConst $constant) use ($constantName): bool { + $constants = array_filter($this->constants, function (PHPConst $constant) use ($constantName) { return $constant->name === $constantName && $constant->duplicateOtherElement === false && BasePHPElement::entitySuitsCurrentPhpVersion($constant); }); @@ -71,12 +70,13 @@ function (PHPMethod $nextMethod) use ($parsedMethod) { } /** + * @param string $methodName * @return PHPMethod|null * @throws RuntimeException */ - public function getMethod(string $methodName) + public function getMethod($methodName) { - $methods = array_filter($this->methods, function (PHPMethod $method) use ($methodName): bool { + $methods = array_filter($this->methods, function (PHPMethod $method) use ($methodName) { return $method->name === $methodName && $method->duplicateOtherElement === false && BasePHPElement::entitySuitsCurrentPhpVersion($method); }); diff --git a/tests/Model/BasePHPElement.php b/tests/Model/BasePHPElement.php index da3725ea4..4ee2fc83a 100644 --- a/tests/Model/BasePHPElement.php +++ b/tests/Model/BasePHPElement.php @@ -1,5 +1,4 @@ namespacedName === null) { @@ -87,7 +90,7 @@ public static function getFQN(Node $node): string * @param ReflectionType|null $type * @return array */ - protected static function getReflectionTypeAsArray($type): array + protected static function getReflectionTypeAsArray($type) { $reflectionTypes = []; if ($type instanceof ReflectionNamedType) { @@ -104,8 +107,9 @@ protected static function getReflectionTypeAsArray($type): array /** * @param Name|Identifier|NullableType|string|UnionType|null|Type $type + * @return array */ - protected static function convertParsedTypeToArray($type): array + protected static function convertParsedTypeToArray($type) { $types = []; if ($type !== null) { @@ -124,8 +128,9 @@ protected static function convertParsedTypeToArray($type): array /** * @param Name|Identifier|NullableType|string $type + * @return string */ - protected static function getTypeNameFromNode($type): string + protected static function getTypeNameFromNode($type) { $nullable = false; $typeName = ''; @@ -147,7 +152,7 @@ protected static function getTypeNameFromNode($type): string * @param AttributeGroup[] $attrGroups * @return string[] */ - protected static function findTypesFromAttribute(array $attrGroups): array + protected static function findTypesFromAttribute(array $attrGroups) { foreach ($attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $attr) { @@ -176,7 +181,7 @@ protected static function findTypesFromAttribute(array $attrGroups): array * @param AttributeGroup[] $attrGroups * @return array */ - protected static function findAvailableVersionsRangeFromAttribute(array $attrGroups): array + protected static function findAvailableVersionsRangeFromAttribute(array $attrGroups) { $versionRange = []; foreach ($attrGroups as $attrGroup) { @@ -206,7 +211,11 @@ protected static function findAvailableVersionsRangeFromAttribute(array $attrGro return $versionRange; } - protected static function hasTentativeTypeAttribute(array $attrGroups): bool + /** + * @param array $attrGroups + * @return bool + */ + protected static function hasTentativeTypeAttribute(array $attrGroups) { foreach ($attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $attr) { @@ -218,7 +227,11 @@ protected static function hasTentativeTypeAttribute(array $attrGroups): bool return false; } - public function hasMutedProblem(int $stubProblemType): bool + /** + * @param int $stubProblemType + * @return bool + */ + public function hasMutedProblem($stubProblemType) { if (array_key_exists($stubProblemType, $this->mutedProblems)) { if (in_array('ALL', $this->mutedProblems[$stubProblemType], true) || @@ -234,7 +247,7 @@ public function hasMutedProblem(int $stubProblemType): bool * @return bool * @throws RuntimeException */ - public static function entitySuitsCurrentPhpVersion(BasePHPElement $element): bool + public static function entitySuitsCurrentPhpVersion(BasePHPElement $element) { return in_array((float)getenv('PHP_VERSION'), ParserUtils::getAvailableInVersions($element), true); } diff --git a/tests/Model/CommonUtils.php b/tests/Model/CommonUtils.php index 5357bb482..3e90e0cbe 100644 --- a/tests/Model/CommonUtils.php +++ b/tests/Model/CommonUtils.php @@ -1,5 +1,4 @@ properties, function (PHPProperty $property) use ($propertyName): bool { + $properties = array_filter($this->properties, function (PHPProperty $property) use ($propertyName) { return $property->name === $propertyName && $property->duplicateOtherElement === false && BasePHPElement::entitySuitsCurrentPhpVersion($property); }); diff --git a/tests/Model/PHPConst.php b/tests/Model/PHPConst.php index 945ceb6d7..15cc90679 100644 --- a/tests/Model/PHPConst.php +++ b/tests/Model/PHPConst.php @@ -1,5 +1,4 @@ value->expr->value; } if (in_array('name', $node->value->getSubNodeNames(), true)) { - $value = $node->value->name->parts[0] ?? $node->value->name->name; + $value = isset($node->value->name->parts[0]) ? $node->value->name->parts[0] : $node->value->name->name; return $value === 'null' ? null : $value; } return null; } - protected function getConstantFQN(NodeAbstract $node, string $nodeName): string + /** + * @param NodeAbstract $node + * @param string $nodeName + * @return string + */ + protected function getConstantFQN(NodeAbstract $node, $nodeName) { $namespace = ''; $parentParentNode = $node->getAttribute('parent')->getAttribute('parent'); diff --git a/tests/Model/PHPDefineConstant.php b/tests/Model/PHPDefineConstant.php index 176cb11fe..cc9413836 100644 --- a/tests/Model/PHPDefineConstant.php +++ b/tests/Model/PHPDefineConstant.php @@ -1,5 +1,4 @@ getParameters() as $parameter) { $this->parameters[] = (new PHPParameter())->readObjectFromReflection($parameter); } - $returnTypes = self::getReflectionTypeAsArray($reflectionObject->getReturnType()); + if (method_exists($reflectionObject, 'getReturnType')) { + $returnTypes = self::getReflectionTypeAsArray($reflectionObject->getReturnType()); + } if (!empty($returnTypes)) { array_push($this->returnTypesFromSignature, ...$returnTypes); } @@ -174,7 +175,11 @@ public function readMutedProblems($jsonData) } } - private static function hasDeprecatedAttribute(FunctionLike $node): bool + /** + * @param FunctionLike $node + * @return bool + */ + private static function hasDeprecatedAttribute(FunctionLike $node) { foreach ($node->getAttrGroups() as $group) { foreach ($group->attrs as $attr) { @@ -190,7 +195,7 @@ private static function hasDeprecatedAttribute(FunctionLike $node): bool * @param Doc|null $docComment * @return bool */ - private static function hasDeprecatedDocTag($docComment): bool + private static function hasDeprecatedDocTag($docComment) { $phpDoc = $docComment !== null ? DocFactoryProvider::getDocFactory()->create($docComment->getText()) : null; return $phpDoc !== null && !empty($phpDoc->getTagsByName('deprecated')); diff --git a/tests/Model/PHPInterface.php b/tests/Model/PHPInterface.php index c7dbaa78c..c2352b1fe 100644 --- a/tests/Model/PHPInterface.php +++ b/tests/Model/PHPInterface.php @@ -1,5 +1,4 @@ name = $reflectionObject->name; - $this->typesFromSignature = self::getReflectionTypeAsArray($reflectionObject->getType()); + if (method_exists($reflectionObject, 'getType')){ + $this->typesFromSignature = self::getReflectionTypeAsArray($reflectionObject->getType()); + } $this->is_vararg = $reflectionObject->isVariadic(); $this->is_passed_by_ref = $reflectionObject->isPassedByReference() && !$reflectionObject->canBePassedByValue(); $this->isOptional = $reflectionObject->isOptional(); diff --git a/tests/Model/PHPProperty.php b/tests/Model/PHPProperty.php index a57a434ad..0a8313fe5 100644 --- a/tests/Model/PHPProperty.php +++ b/tests/Model/PHPProperty.php @@ -1,5 +1,4 @@ constants; } @@ -43,9 +42,9 @@ public function getConstants(): array * @return PHPConst|null * @throws RuntimeException */ - public function getConstant(string $constantName, $sourceFilePath = null) + public function getConstant($constantName, $sourceFilePath = null) { - $constants = array_filter($this->constants, function (PHPConst $const) use ($constantName): bool { + $constants = array_filter($this->constants, function (PHPConst $const) use ($constantName) { return $const->name === $constantName && $const->duplicateOtherElement === false && BasePHPElement::entitySuitsCurrentPhpVersion($const); }); @@ -89,7 +88,7 @@ function (PHPConst $nextConstant) use ($constant) { /** * @return PHPFunction[] */ - public function getFunctions(): array + public function getFunctions() { return $this->functions; } @@ -101,13 +100,13 @@ public function getFunctions(): array * @return PHPFunction|null * @throws RuntimeException */ - public function getFunction(string $name, $sourceFilePath = null, bool $shouldSuitCurrentPhpVersion = true) + public function getFunction($name, $sourceFilePath = null, $shouldSuitCurrentPhpVersion = true) { - $functions = array_filter($this->functions, function (PHPFunction $function) use ($shouldSuitCurrentPhpVersion, $name): bool { + $functions = array_filter($this->functions, function (PHPFunction $function) use ($shouldSuitCurrentPhpVersion, $name) { return $function->name === $name && (!$shouldSuitCurrentPhpVersion || BasePHPElement::entitySuitsCurrentPhpVersion($function)); }); if (count($functions) > 1) { - $functions = array_filter($functions, function (PHPFunction $function): bool { + $functions = array_filter($functions, function (PHPFunction $function) { return $function->duplicateOtherElement === false; }); } @@ -151,7 +150,7 @@ function (PHPFunction $nextFunction) use ($function) { /** * @return PHPClass[] */ - public function getClasses(): array + public function getClasses() { return $this->classes; } @@ -163,9 +162,9 @@ public function getClasses(): array * @return PHPClass|null * @throws RuntimeException */ - public function getClass(string $name, $sourceFilePath = null, bool $shouldSuitCurrentPhpVersion = true) + public function getClass($name, $sourceFilePath = null, $shouldSuitCurrentPhpVersion = true) { - $classes = array_filter($this->classes, function (PHPClass $class) use ($shouldSuitCurrentPhpVersion, $name): bool { + $classes = array_filter($this->classes, function (PHPClass $class) use ($shouldSuitCurrentPhpVersion, $name) { return $class->name === $name && (!$shouldSuitCurrentPhpVersion || BasePHPElement::entitySuitsCurrentPhpVersion($class)); }); @@ -191,9 +190,9 @@ public function getClass(string $name, $sourceFilePath = null, bool $shouldSuitC /** * @return PHPClass[] */ - public function getCoreClasses(): array + public function getCoreClasses() { - return array_filter($this->classes, function (PHPClass $class): bool { + return array_filter($this->classes, function (PHPClass $class) { return $class->stubBelongsToCore === true; }); } @@ -222,9 +221,9 @@ function (PHPClass $nextClass) use ($class) { * @return PHPInterface|null * @throws RuntimeException */ - public function getInterface(string $name, $sourceFilePath = null, bool $shouldSuitCurrentPhpVersion = true) + public function getInterface($name, $sourceFilePath = null, $shouldSuitCurrentPhpVersion = true) { - $interfaces = array_filter($this->interfaces, function (PHPInterface $interface) use ($shouldSuitCurrentPhpVersion, $name): bool { + $interfaces = array_filter($this->interfaces, function (PHPInterface $interface) use ($shouldSuitCurrentPhpVersion, $name) { return $interface->name === $name && (!$shouldSuitCurrentPhpVersion || BasePHPElement::entitySuitsCurrentPhpVersion($interface)); }); @@ -250,7 +249,7 @@ public function getInterface(string $name, $sourceFilePath = null, bool $shouldS /** * @return PHPInterface[] */ - public function getInterfaces(): array + public function getInterfaces() { return $this->interfaces; } @@ -258,9 +257,9 @@ public function getInterfaces(): array /** * @return PHPInterface[] */ - public function getCoreInterfaces(): array + public function getCoreInterfaces() { - return array_filter($this->interfaces, function (PHPInterface $interface): bool { + return array_filter($this->interfaces, function (PHPInterface $interface) { return $interface->stubBelongsToCore === true; }); } diff --git a/tests/Model/Tags/RemovedTag.php b/tests/Model/Tags/RemovedTag.php index 6340d45e4..7ed990c86 100644 --- a/tests/Model/Tags/RemovedTag.php +++ b/tests/Model/Tags/RemovedTag.php @@ -1,5 +1,4 @@ create($matches[2] ?? '', $context) + $descriptionFactory->create(isset($matches[2]) ? $matches[2] : '', $context) ); } return new self(); @@ -58,7 +57,10 @@ public function getVersion() return $this->version; } - public function __toString(): string + /** + * @return string + */ + public function __toString() { return "PhpStorm internal '@removed' tag"; } diff --git a/tests/Parsers/PHPReflectionParser.php b/tests/Parsers/PHPReflectionParser.php index 93fdd890f..dc443b53c 100644 --- a/tests/Parsers/PHPReflectionParser.php +++ b/tests/Parsers/PHPReflectionParser.php @@ -1,5 +1,4 @@ Date: Mon, 6 Dec 2021 17:40:48 +0100 Subject: [PATCH 087/419] [phpstorm-stubs] update stubs according to php 5.6 --- Core/Core.php | 10 ++- Phar/Phar.php | 10 ++- SPL/SPL.php | 8 +- curl/curl_d.php | 4 +- date/date_c.php | 10 ++- dom/dom_c.php | 12 ++- intl/intl.php | 141 +++++++++++++++++++++--------- mbstring/mbstring.php | 14 ++- mysqli/mysqli.php | 7 +- openssl/openssl.php | 6 +- pcntl/pcntl.php | 13 ++- session/session.php | 3 +- soap/soap.php | 8 +- sqlite3/sqlite3.php | 25 ++++-- standard/standard_0.php | 8 +- standard/standard_1.php | 2 +- standard/standard_4.php | 4 +- standard/standard_6.php | 18 +++- standard/standard_9.php | 2 +- tests/TestData/mutedProblems.json | 26 ++++++ tokenizer/tokenizer.php | 8 +- xmlreader/xmlreader.php | 5 +- 22 files changed, 252 insertions(+), 92 deletions(-) diff --git a/Core/Core.php b/Core/Core.php index b01235c5c..608ee1ffe 100755 --- a/Core/Core.php +++ b/Core/Core.php @@ -326,7 +326,7 @@ function error_reporting(?int $error_level): int {} * It is possible to define resource constants, * however it is not recommended and may cause unpredictable behavior. *

- * @param bool $case_insensitive [optional]

+ * @param bool $case_insensitive

* If set to true, the constant will be defined case-insensitive. * The default behavior is case-sensitive; i.e. * CONSTANT and Constant represent @@ -341,7 +341,8 @@ function error_reporting(?int $error_level): int {} function define( string $constant_name, #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: 'null|array|bool|int|float|string')] $value, - #[Deprecated()] bool $case_insensitive = false + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] bool $case_insensitive, + #[Deprecated(since: 7.3)] bool $case_insensitive = false ): bool {} /** @@ -1027,7 +1028,10 @@ function debug_backtrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $lim *

* @return void */ -function debug_print_backtrace(int $options = 0, int $limit = 0): void {} +function debug_print_backtrace( + int $options = 0, + #[PhpStormStubsElementAvailable(from: '7.0')] int $limit = 0 +): void {} /** * Forces collection of any existing garbage cycles diff --git a/Phar/Phar.php b/Phar/Phar.php index 20ad6f9d1..90356506d 100644 --- a/Phar/Phar.php +++ b/Phar/Phar.php @@ -58,7 +58,8 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO, - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null, + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $fileformat = null ) {} public function __destruct() {} @@ -762,13 +763,16 @@ final public static function mapPhar(?string $alias = null, int $offset = 0): bo * (PHP >= 5.3.0, PECL phar >= 2.0.0)
* Returns the full path on disk or full phar URL to the currently executing Phar archive * @link https://php.net/manual/en/phar.running.php - * @param bool $returnPhar [optional]

+ * @param bool $returnPhar

* If FALSE, the full path on disk to the phar * archive is returned. If TRUE, a full phar URL is returned. *

* @return string the filename if valid, empty string otherwise. */ - final public static function running(bool $returnPhar = true): string {} + final public static function running( + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $returnPhar, + #[PhpStormStubsElementAvailable(from: '7.0')] bool $returnPhar = true + ): string {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)
diff --git a/SPL/SPL.php b/SPL/SPL.php index eff393167..089b53473 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -1546,8 +1546,8 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'object|array'], default: '')] $array = [], - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $iteratorClass = "ArrayIterator" + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $iteratorClass = "ArrayIterator" ) {} /** @@ -1842,8 +1842,8 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'object|array'], default: '')] $array = [], - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.1')] $iterator_class = null + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, + #[PhpStormStubsElementAvailable(from: '7.0', to: '7.1')] $iterator_class = null ) {} /** diff --git a/curl/curl_d.php b/curl/curl_d.php index cb47e05f8..70365844b 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -3396,7 +3396,7 @@ * CURLSSLOPT_ALLOW_BEAST: do not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. * CURLSSLOPT_NO_REVOKE: disable certificate revocation checks for those SSL backends where such behavior is present. * @link https://www.php.net/manual/en/function.curl-setopt.php - * @since 7.0.7 + * @since 5.6 */ define("CURLOPT_SSL_OPTIONS", 216); /** @@ -3426,7 +3426,7 @@ * Value for the CURLOPT_SSL_OPTIONS option. * Do not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. * @link https://www.php.net/manual/en/function.curl-setopt.php - * @since 7.0.7 + * @since 5.6 */ define("CURLSSLOPT_ALLOW_BEAST", 1); /** diff --git a/date/date_c.php b/date/date_c.php index 8cc63a4f3..346f3fc05 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -766,15 +766,17 @@ public function getOffset(DateTimeInterface $datetime): int {} /** * Returns all transitions for the timezone - * @param int $timestampBegin [optional] - * @param int $timestampEnd [optional] + * @param int $timestampBegin + * @param int $timestampEnd * @return array|false * @link https://php.net/manual/en/datetimezone.gettransitions.php */ #[TentativeType] public function getTransitions( - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampBegin = null, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampEnd = null + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $timestampBegin, + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $timestampEnd, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampBegin = null, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampEnd = null ): array|false {} /** diff --git a/dom/dom_c.php b/dom/dom_c.php index 9b1db4c07..1e2a24946 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -205,13 +205,16 @@ public function hasChildNodes(): bool {} /** * Clones a node * @link https://php.net/manual/en/domnode.clonenode.php - * @param bool $deep [optional]

+ * @param bool $deep

* Indicates whether to copy all descendant nodes. This parameter is * defaulted to false. *

* @return static The cloned node. */ - public function cloneNode(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $deep = false) {} + public function cloneNode( + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $deep, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $deep = false + ) {} /** * Normalizes the node @@ -1090,7 +1093,10 @@ public function loadXML( * @return string|false the XML, or false if an error occurred. */ #[TentativeType] - public function saveXML(?DOMNode $node = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null): string|false {} + public function saveXML( + ?DOMNode $node = null, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null + ): string|false {} /** * Creates a new DOMDocument object diff --git a/intl/intl.php b/intl/intl.php index 32c7127f5..ebb2f7f4d 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -332,7 +332,10 @@ public function sort( * @return bool TRUE on success or FALSE on failure. */ #[TentativeType] - public function sortWithSortKeys(array &$array): bool {} + public function sortWithSortKeys( + array &$array, + #[ElementAvailable(from: '5.3', to: '5.6')] $flags = [] + ): bool {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -457,7 +460,10 @@ public function getErrorMessage(): string|false {} */ #[Pure] #[TentativeType] - public function getSortKey(#[TypeAware(['8.0' => 'string'], default: '')] $string): string|false {} + public function getSortKey( + #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[ElementAvailable(from: '5.3', to: '5.6')] $arg2 + ): string|false {} } class NumberFormatter @@ -1252,13 +1258,15 @@ class Normalizer * Normalizes the input provided and returns the normalized string * @link https://php.net/manual/en/normalizer.normalize.php * @param string $string

The input string to normalize

- * @param int $form [optional]

One of the normalization forms.

+ * @param int $form

One of the normalization forms.

* @return string|false The normalized string or FALSE if an error occurred. */ #[TentativeType] public static function normalize( #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C + #[ElementAvailable(from: '5.3', to: '5.6')] $form, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C, + #[ElementAvailable(from: '5.3', to: '5.6')] $arg3 ): string|false {} /** @@ -1266,7 +1274,7 @@ public static function normalize( * Checks if the provided string is already in the specified normalization form. * @link https://php.net/manual/en/normalizer.isnormalized.php * @param string $string

The input string to normalize

- * @param int $form [optional]

+ * @param int $form

* One of the normalization forms. *

* @return bool TRUE if normalized, FALSE otherwise or if there an error @@ -1274,7 +1282,9 @@ public static function normalize( #[TentativeType] public static function isNormalized( #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C + #[ElementAvailable(from: '5.3', to: '5.6')] $form, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C, + #[ElementAvailable(from: '5.3', to: '5.6')] $arg3 ): bool {} /** @@ -1431,7 +1441,7 @@ public static function getKeywords(#[TypeAware(['8.0' => 'string'], default: '') * @param string $locale

* The locale to return a display script for *

- * @param string $displayLocale [optional]

+ * @param string $displayLocale

* Optional format locale to use to display the script name *

* @return string Display name of the script for the $locale in the format appropriate for @@ -1440,7 +1450,8 @@ public static function getKeywords(#[TypeAware(['8.0' => 'string'], default: '') #[TentativeType] public static function getDisplayScript( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1450,7 +1461,7 @@ public static function getDisplayScript( * @param string $locale

* The locale to return a display region for. *

- * @param string $displayLocale [optional]

+ * @param string $displayLocale

* Optional format locale to use to display the region name *

* @return string display name of the region for the $locale in the format appropriate for @@ -1459,7 +1470,8 @@ public static function getDisplayScript( #[TentativeType] public static function getDisplayRegion( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1469,13 +1481,14 @@ public static function getDisplayRegion( * @param string $locale

* The locale to return a display name for. *

- * @param string $displayLocale [optional]

optional format locale

+ * @param string $displayLocale

optional format locale

* @return string|false Display name of the locale in the format appropriate for $in_locale. */ #[TentativeType] public static function getDisplayName( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1485,7 +1498,7 @@ public static function getDisplayName( * @param string $locale

* The locale to return a display language for *

- * @param string $displayLocale [optional]

+ * @param string $displayLocale

* Optional format locale to use to display the language name *

* @return string|false display name of the language for the $locale in the format appropriate for @@ -1494,7 +1507,8 @@ public static function getDisplayName( #[TentativeType] public static function getDisplayLanguage( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1504,7 +1518,7 @@ public static function getDisplayLanguage( * @param string $locale

* The locale to return a display variant for *

- * @param string $displayLocale [optional]

+ * @param string $displayLocale

* Optional format locale to use to display the variant name *

* @return string|false Display name of the variant for the $locale in the format appropriate for @@ -1513,7 +1527,8 @@ public static function getDisplayLanguage( #[TentativeType] public static function getDisplayVariant( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1585,7 +1600,7 @@ public static function getAllVariants(#[TypeAware(['8.0' => 'string'], default: * @param string $locale

* The language range to check against *

- * @param bool $canonicalize [optional]

+ * @param bool $canonicalize

* If true, the arguments will be converted to canonical form before * matching. *

@@ -1595,7 +1610,8 @@ public static function getAllVariants(#[TypeAware(['8.0' => 'string'], default: public static function filterMatches( #[TypeAware(['8.0' => 'string'], default: '')] $languageTag, #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false + #[ElementAvailable(from: '5.3', to: '5.6')] $canonicalize, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false ): ?bool {} /** @@ -1609,11 +1625,11 @@ public static function filterMatches( * @param string $locale

* The locale to use as the language range when matching. *

- * @param bool $canonicalize [optional]

+ * @param bool $canonicalize

* If true, the arguments will be converted to canonical form before * matching. *

- * @param string $defaultLocale [optional]

+ * @param string $defaultLocale

* The locale to use if no match is found. *

* @return string The closest matching language tag or default value. @@ -1622,8 +1638,10 @@ public static function filterMatches( public static function lookup( array $languageTag, #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false, - #[TypeAware(['8.0' => 'string|null'], default: '')] $defaultLocale = null + #[ElementAvailable(from: '5.3', to: '5.6')] $canonicalize, + #[ElementAvailable(from: '5.3', to: '5.6')] $defaultLocale, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false, + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $defaultLocale = null ): ?string {} /** @@ -3855,7 +3873,11 @@ function collator_sort(Collator $object, array &$array, int $flags = 0): bool {} * @param string[] &$array

Array of strings to sort

* @return bool TRUE on success or FALSE on failure. */ -function collator_sort_with_sort_keys(Collator $object, array &$array): bool {} +function collator_sort_with_sort_keys( + Collator $object, + array &$array, + #[ElementAvailable(from: '5.3', to: '5.6')] $sort_flags = [] +): bool {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -3921,7 +3943,11 @@ function collator_get_error_message(Collator $object): string|false {} * @return string|false the collation key for the string. Collation keys can be compared directly instead of strings. */ #[Pure] -function collator_get_sort_key(Collator $object, string $string): string|false {} +function collator_get_sort_key( + Collator $object, + string $string, + #[ElementAvailable(from: '5.3', to: '5.6')] $arg3 +): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -4273,14 +4299,18 @@ function locale_get_keywords(string $locale): array|false|null {} * @param string $locale

* The locale to return a display script for *

- * @param string|null $displayLocale [optional]

+ * @param string|null $displayLocale

* Optional format locale to use to display the script name *

* @return string|false Display name of the script for the $locale in the format appropriate for * $in_locale. */ #[Pure] -function locale_get_display_script(string $locale, ?string $displayLocale = null): string|false {} +function locale_get_display_script( + string $locale, + #[ElementAvailable(from: '5.3', to: '5.6')] ?string $displayLocale, + #[ElementAvailable(from: '7.0')] ?string $displayLocale = null +): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -4289,14 +4319,18 @@ function locale_get_display_script(string $locale, ?string $displayLocale = null * @param string $locale

* The locale to return a display region for. *

- * @param string|null $displayLocale [optional]

+ * @param string|null $displayLocale

* Optional format locale to use to display the region name *

* @return string|false display name of the region for the $locale in the format appropriate for * $in_locale. */ #[Pure] -function locale_get_display_region(string $locale, ?string $displayLocale = null): string|false {} +function locale_get_display_region( + string $locale, + #[ElementAvailable(from: '5.3', to: '5.6')] ?string $displayLocale, + #[ElementAvailable(from: '7.0')] ?string $displayLocale = null +): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -4305,11 +4339,15 @@ function locale_get_display_region(string $locale, ?string $displayLocale = null * @param string $locale

* The locale to return a display name for. *

- * @param string|null $displayLocale [optional]

optional format locale

+ * @param string|null $displayLocale

optional format locale

* @return string|false Display name of the locale in the format appropriate for $in_locale. */ #[Pure] -function locale_get_display_name(string $locale, ?string $displayLocale = null): string|false {} +function locale_get_display_name( + string $locale, + #[ElementAvailable(from: '5.3', to: '5.6')] ?string $displayLocale, + #[ElementAvailable(from: '7.0')] ?string $displayLocale = null +): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -4318,14 +4356,18 @@ function locale_get_display_name(string $locale, ?string $displayLocale = null): * @param string $locale

* The locale to return a display language for *

- * @param string|null $displayLocale [optional]

+ * @param string|null $displayLocale

* Optional format locale to use to display the language name *

* @return string|false display name of the language for the $locale in the format appropriate for * $in_locale. */ #[Pure] -function locale_get_display_language(string $locale, ?string $displayLocale = null): string|false {} +function locale_get_display_language( + string $locale, + #[ElementAvailable(from: '5.3', to: '5.6')] ?string $displayLocale, + #[ElementAvailable(from: '7.0')] ?string $displayLocale = null +): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -4334,14 +4376,18 @@ function locale_get_display_language(string $locale, ?string $displayLocale = nu * @param string $locale

* The locale to return a display variant for *

- * @param string|null $displayLocale [optional]

+ * @param string|null $displayLocale

* Optional format locale to use to display the variant name *

* @return string|false Display name of the variant for the $locale in the format appropriate for * $in_locale. */ #[Pure] -function locale_get_display_variant(string $locale, ?string $displayLocale = null): string|false {} +function locale_get_display_variant( + string $locale, + #[ElementAvailable(from: '5.3', to: '5.6')] ?string $displayLocale, + #[ElementAvailable(from: '7.0')] ?string $displayLocale = null +): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -4412,14 +4458,19 @@ function locale_get_all_variants(string $locale): ?array {} * @param string $locale

* The language range to check against *

- * @param bool $canonicalize [optional]

+ * @param bool $canonicalize

* If true, the arguments will be converted to canonical form before * matching. *

* @return bool|null TRUE if $locale matches $langtag FALSE otherwise. */ #[Pure] -function locale_filter_matches(string $languageTag, string $locale, bool $canonicalize = false): ?bool {} +function locale_filter_matches( + string $languageTag, + string $locale, + #[ElementAvailable(from: '5.3', to: '5.6')] bool $canonicalize, + #[ElementAvailable(from: '7.0')] bool $canonicalize = false +): ?bool {} /** * Canonicalize the locale string @@ -4441,17 +4492,24 @@ function locale_canonicalize(string $locale): ?string {} * @param string $locale

* The locale to use as the language range when matching. *

- * @param bool $canonicalize [optional]

+ * @param bool $canonicalize

* If true, the arguments will be converted to canonical form before * matching. *

- * @param string|null $defaultLocale [optional]

+ * @param string|null $defaultLocale

* The locale to use if no match is found. *

* @return string|null The closest matching language tag or default value. */ #[Pure] -function locale_lookup(array $languageTag, string $locale, bool $canonicalize = false, ?string $defaultLocale = null): ?string {} +function locale_lookup( + array $languageTag, + string $locale, + #[ElementAvailable(from: '5.3', to: '5.6')] bool $canonicalize, + #[ElementAvailable(from: '5.3', to: '5.6')] ?string $defaultLocale, + #[ElementAvailable(from: '7.0')] bool $canonicalize = false, + #[ElementAvailable(from: '7.0')] ?string $defaultLocale = null, +): ?string {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
@@ -7466,7 +7524,10 @@ public function fromUCallback( * @return array|false|null */ #[TentativeType] - public static function getAliases(#[TypeAware(['8.0' => 'string'], default: '')] $name): array|false|null {} + public static function getAliases( + #[ElementAvailable(from: '5.5', to: '5.6')] $name = '', + #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string'], default: '')] $name + ): array|false|null {} /** * (PHP 5 >=5.5.0)
diff --git a/mbstring/mbstring.php b/mbstring/mbstring.php index 34281a5a3..ac2c3975c 100644 --- a/mbstring/mbstring.php +++ b/mbstring/mbstring.php @@ -1073,7 +1073,12 @@ function mb_ereg_replace_callback(string $pattern, callable $callback, string $s * @return string|false|null The resultant string or false on error. */ #[Pure] -function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $options = null): string|false|null {} +function mb_eregi_replace( + string $pattern, + string $replacement, + string $string, + #[PhpStormStubsElementAvailable(from: '7.0')] ?string $options = null +): string|false|null {} /** * Split multibyte string using regular expression @@ -1255,7 +1260,12 @@ function mbereg_replace($pattern, $replacement, $string, $option) {} * @removed 8.0 */ #[Deprecated(replacement: "mb_eregi_replace(%parametersList%)", since: "7.3")] -function mberegi_replace($pattern, $replacement, $string, string $option = "msri"): string {} +function mberegi_replace( + $pattern, + $replacement, + $string, + #[PhpStormStubsElementAvailable(from: '7.0')] string $option = "msri" +): string {} /** * @param $pattern diff --git a/mysqli/mysqli.php b/mysqli/mysqli.php index 5b3260e0f..48c96b998 100644 --- a/mysqli/mysqli.php +++ b/mysqli/mysqli.php @@ -1227,7 +1227,7 @@ public function fetch_field_direct(int $index): object|false {} * @return array an array of associative or numeric arrays holding result rows. */ #[TentativeType] - public function fetch_all(int $mode = MYSQLI_NUM): array {} + public function fetch_all(#[PhpStormStubsElementAvailable(from: '7.0')] int $mode = MYSQLI_NUM): array {} /** * Fetch the next row of a result set as an associative, a numeric array, or both @@ -1901,7 +1901,10 @@ function mysqli_fetch_lengths(mysqli_result $result): array|false {} * @param int $mode * @return array Returns an array of associative or numeric arrays holding result rows. */ -function mysqli_fetch_all(mysqli_result $result, int $mode = MYSQLI_NUM): array {} +function mysqli_fetch_all( + mysqli_result $result, + #[PhpStormStubsElementAvailable(from: '7.0')] int $mode = MYSQLI_NUM +): array {} /** * Fetch the next row of a result set as an associative, a numeric array, or both diff --git a/openssl/openssl.php b/openssl/openssl.php index e1cac8261..fec92102f 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -818,7 +818,7 @@ function openssl_seal( array $public_key, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $cipher_algo = '', #[PhpStormStubsElementAvailable(from: '8.0')] string $cipher_algo, - &$iv = null + #[PhpStormStubsElementAvailable(from: '7.0')] &$iv = null ): int|false {} /** @@ -840,9 +840,9 @@ function openssl_open( &$output, string $encrypted_key, #[LanguageLevelTypeAware(['8.0' => 'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], default: 'resource|array|string')] $private_key, - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $cipher_algo = '', + #[PhpStormStubsElementAvailable(from: '7.0', to: '7.4')] string $cipher_algo = '', #[PhpStormStubsElementAvailable(from: '8.0')] string $cipher_algo, - ?string $iv + #[PhpStormStubsElementAvailable(from: '7.0')] ?string $iv ): bool {} /** diff --git a/pcntl/pcntl.php b/pcntl/pcntl.php index 56be781d0..4ef06e275 100644 --- a/pcntl/pcntl.php +++ b/pcntl/pcntl.php @@ -95,7 +95,12 @@ function pcntl_fork(): int {} * child which exited, -1 on error or zero if WNOHANG was used and no * child was available */ -function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usage = []): int {} +function pcntl_waitpid( + int $process_id, + &$status, + int $flags = 0, + #[PhpStormStubsElementAvailable(from: '7.0')] &$resource_usage += []): int {} /** * Waits on or returns the status of a forked child @@ -141,7 +146,11 @@ function pcntl_waitpid(int $process_id, &$status, int $flags = 0, &$resource_usa * child which exited, -1 on error or zero if WNOHANG was provided as an * option (on wait3-available systems) and no child was available. */ -function pcntl_wait(&$status, int $flags = 0, &$resource_usage = []): int {} +function pcntl_wait( + &$status, + int $flags = 0, + #[PhpStormStubsElementAvailable(from: '7.0')] &$resource_usage += []): int {} /** * Installs a signal handler diff --git a/session/session.php b/session/session.php index 751200807..6cce466e5 100644 --- a/session/session.php +++ b/session/session.php @@ -4,6 +4,7 @@ use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; /** * Get and/or set the current session name.
@@ -167,7 +168,7 @@ function session_encode() {} * @return bool This function returns true if a session was successfully started, * otherwise false. */ -function session_start(array $options = []): bool {} +function session_start(#[PhpStormStubsElementAvailable(from: '7.0')] array $options = []): bool {} /** * Create new session id diff --git a/soap/soap.php b/soap/soap.php index f0fba940d..2d88becd1 100644 --- a/soap/soap.php +++ b/soap/soap.php @@ -3,6 +3,7 @@ // Start of soap v. use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; +use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; @@ -461,7 +462,7 @@ public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], /** * Sets SOAP headers for subsequent calls * @link https://php.net/manual/en/soapclient.setsoapheaders.php - * @param mixed $headers [optional]

+ * @param mixed $headers

* The headers to be set. It could be SoapHeader * object or array of SoapHeader objects. * If not specified or set to NULL, the headers will be deleted. @@ -470,7 +471,10 @@ public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], * @since 5.0.5 */ #[TentativeType] - public function __setSoapHeaders($headers = null): bool {} + public function __setSoapHeaders( + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $headers, + #[PhpStormStubsElementAvailable(from: '7.0')] $headers = null + ): bool {} } /** diff --git a/sqlite3/sqlite3.php b/sqlite3/sqlite3.php index efefa8a55..c69b1da9f 100644 --- a/sqlite3/sqlite3.php +++ b/sqlite3/sqlite3.php @@ -56,7 +56,7 @@ class SQLite3 * @param string $filename

* Path to the SQLite database, or :memory: to use in-memory database. *

- * @param int $flags [optional]

+ * @param int $flags

* Optional flags used to determine how to open the SQLite database. By * default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE. *

@@ -64,7 +64,7 @@ class SQLite3 * SQLITE3_OPEN_READONLY: Open the database for * reading only. *

- * @param string $encryptionKey [optional]

+ * @param string $encryptionKey

* An optional encryption key used when encrypting and decrypting an * SQLite database. *

@@ -73,8 +73,10 @@ class SQLite3 #[TentativeType] public function open( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $flags, + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $encryptionKey, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null ): void {} /** @@ -334,7 +336,10 @@ public function openBlob( * @return bool Returns the old value; true if exceptions were enabled, false otherwise. */ #[TentativeType] - public function enableExceptions(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $enable = false): bool {} + public function enableExceptions( + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $enable, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $enable = false + ): bool {} /** * Instantiates an SQLite3 object and opens an SQLite 3 database @@ -342,7 +347,7 @@ public function enableExceptions(#[LanguageLevelTypeAware(['8.0' => 'bool'], def * @param string $filename

* Path to the SQLite database, or :memory: to use in-memory database. *

- * @param int $flags [optional]

+ * @param int $flags

* Optional flags used to determine how to open the SQLite database. By * default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE. *

@@ -350,15 +355,17 @@ public function enableExceptions(#[LanguageLevelTypeAware(['8.0' => 'bool'], def * SQLITE3_OPEN_READONLY: Open the database for * reading only. *

- * @param string $encryptionKey [optional]

+ * @param string $encryptionKey

* An optional encryption key used when encrypting and decrypting an * SQLite database. *

*/ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $flags, + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $encryptionKey, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null ) {} /** diff --git a/standard/standard_0.php b/standard/standard_0.php index 0898fcc83..deb7c1cd3 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -727,7 +727,11 @@ function htmlspecialchars_decode(string $string, int $flags = ENT_QUOTES|ENT_SUB * @return array the translation table as an array. */ #[Pure] -function get_html_translation_table(int $table = 0, int $flags = ENT_QUOTES|ENT_SUBSTITUTE, string $encoding = "UTF-8"): array {} +function get_html_translation_table( + int $table = 0, + int $flags = ENT_QUOTES|ENT_SUBSTITUTE, + #[PhpStormStubsElementAvailable(from: '7.0')] string $encoding = "UTF-8" +): array {} /** * Calculate the sha1 hash of a string @@ -1224,7 +1228,7 @@ function php_sapi_name(): string|false {} * @return string the description, as a string. */ #[Pure(true)] -function php_uname(string $mode = 'a'): string {} +function php_uname(#[PhpStormStubsElementAvailable(from: '7.0')] string $mode = 'a'): string {} /** * Return a list of .ini files parsed from the additional ini dir diff --git a/standard/standard_1.php b/standard/standard_1.php index aa985650f..72c8281a6 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -234,7 +234,7 @@ function basename(string $path, string $suffix = ''): string {} * /component removed. */ #[Pure] -function dirname(string $path, int $levels = 1): string {} +function dirname(string $path, #[PhpStormStubsElementAvailable(from: '7.0')] int $levels = 1): string {} /** * Returns information about a file path diff --git a/standard/standard_4.php b/standard/standard_4.php index c7a18d41d..7ff6bfdf1 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -176,7 +176,7 @@ function serialize(mixed $value): string {} * In case the passed string is not unserializeable, false is returned and * E_NOTICE is issued.

*/ -function unserialize(string $data, array $options = []): mixed {} +function unserialize(string $data, #[PhpStormStubsElementAvailable(from: '7.0')] array $options = []): mixed {} /** * Dumps information about a variable @@ -440,7 +440,7 @@ function ini_get(string $option): string|false {} *

*/ #[Pure(true)] -function ini_get_all(?string $extension, bool $details = true): array|false {} +function ini_get_all(?string $extension, #[PhpStormStubsElementAvailable(from: '7.0')] bool $details = true): array|false {} /** * Sets the value of a configuration option diff --git a/standard/standard_6.php b/standard/standard_6.php index 0dc5ddef1..95c1ee89d 100644 --- a/standard/standard_6.php +++ b/standard/standard_6.php @@ -652,7 +652,7 @@ function fputcsv( array $fields, string $separator = ",", string $enclosure = '"', - string $escape = "\\", + #[PhpStormStubsElementAvailable(from: '7.0')] string $escape = "\\", #[PhpStormStubsElementAvailable('8.1')] string $eol = PHP_EOL ): int|false {} @@ -1045,7 +1045,12 @@ function get_headers( *

* @return bool true on success or false on failure. */ -function stream_set_timeout($stream, int $seconds, int $microseconds = 0): bool {} +function stream_set_timeout( + $stream, + int $seconds, + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] int $microseconds, + #[PhpStormStubsElementAvailable(from: '7.0')] int $microseconds = 0 +): bool {} /** * Alias: @@ -1058,12 +1063,17 @@ function stream_set_timeout($stream, int $seconds, int $microseconds = 0): bool * @param int $seconds

* The seconds part of the timeout to be set. *

- * @param int $microseconds [optional]

+ * @param int $microseconds

* The microseconds part of the timeout to be set. *

* @return bool true on success or false on failure. */ -function socket_set_timeout($stream, int $seconds, int $microseconds = 0): bool {} +function socket_set_timeout( + $stream, + int $seconds, + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] int $microseconds, + #[PhpStormStubsElementAvailable(from: '7.0')] int $microseconds = 0 +): bool {} /** * Alias: diff --git a/standard/standard_9.php b/standard/standard_9.php index 1dbb56158..d40cc6818 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -887,7 +887,7 @@ function key_exists($key, array $array): bool {} */ function assert( mixed $assertion, - #[LanguageLevelTypeAware(['7.0' => 'Throwable|string|null'], default: 'string')] $description = null + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['7.0' => 'Throwable|string|null'], default: 'string')] $description = null ): bool {} /** diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index 32732ef4b..8675d1d20 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -961,6 +961,7 @@ { "description": "parameter mismatch", "versions": [ + 5.6, 7.0 ] } @@ -968,6 +969,28 @@ } ], "classes": [ + { + "name": "DOMException", + "problems": [ + { + "description": "has wrong final modifier", + "versions": [ + 5.6 + ] + } + ] + }, + { + "name": "mysqli_sql_exception", + "problems": [ + { + "description": "has wrong final modifier", + "versions": [ + 5.6 + ] + } + ] + }, { "name": "Yaf_Application", "methods": [ @@ -3054,6 +3077,7 @@ { "description": "has wrong final modifier", "versions": [ + 5.6, 7.0, 7.1, 7.2, @@ -3118,6 +3142,7 @@ { "description": "has wrong static modifier", "versions": [ + 5.6, 7.0, 7.1, 7.2, @@ -3133,6 +3158,7 @@ { "description": "has wrong static modifier", "versions": [ + 5.6, 7.0, 7.1, 7.2, diff --git a/tokenizer/tokenizer.php b/tokenizer/tokenizer.php index c5b985a9f..ea7f26454 100644 --- a/tokenizer/tokenizer.php +++ b/tokenizer/tokenizer.php @@ -1,6 +1,7 @@ 'DOMNode|null'], default: '')] $baseNode = null): DOMNode|false {} + public function expand( + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'DOMNode|null'], default: '')] $baseNode = null + ): DOMNode|false {} } // End of xmlreader v.0.2 From 5ac07a429ee479d8dab11bf9ac61088ab8e32c7b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 27 Nov 2021 11:10:45 +0100 Subject: [PATCH 088/419] [phpstorm-stubs] fix sprintf for php 5.6 --- standard/standard_2.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/standard/standard_2.php b/standard/standard_2.php index 429333348..0dea9223d 100644 --- a/standard/standard_2.php +++ b/standard/standard_2.php @@ -332,13 +332,17 @@ function strchr(string $haystack, string $needle, bool $before_needle = false): * (- or +) to be used on a number. By default, only the - sign is used * on a number if it's negative. This specifier forces positive numbers * to have the + sign attached as well, and was added in PHP 4.3.0.

- * @param string|int|float ...$values [optional]

+ * @param string|int|float ...$values

*

* @return string a string produced according to the formatting string * format. */ #[Pure] -function sprintf(string $format, mixed ...$values): string {} +function sprintf( + string $format, + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $values, + #[PhpStormStubsElementAvailable(from: '7.0')] mixed ...$values +): string {} /** * Output a formatted string From f432611b5e2ce24661f60fecc11ad5575cccc6f7 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 6 Dec 2021 17:55:55 +0100 Subject: [PATCH 089/419] [phpstorm-stubs] update stubs map --- PhpStormStubsMap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 32558c45e..06dd84f2a 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -12753,6 +12753,7 @@ final class PhpStormStubsMap 'T_CALLABLE' => 'tokenizer/tokenizer.php', 'T_CASE' => 'tokenizer/tokenizer.php', 'T_CATCH' => 'tokenizer/tokenizer.php', + 'T_CHARACTER' => 'tokenizer/tokenizer.php', 'T_CLASS' => 'tokenizer/tokenizer.php', 'T_CLASS_C' => 'tokenizer/tokenizer.php', 'T_CLONE' => 'tokenizer/tokenizer.php', From c893ab466a27336eba56f71be9222a3dce6a6c00 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 6 Dec 2021 18:15:43 +0100 Subject: [PATCH 090/419] [phpstorm-stubs] add ReflectionFunctionAbstract::__toString --- Reflection/ReflectionFunctionAbstract.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Reflection/ReflectionFunctionAbstract.php b/Reflection/ReflectionFunctionAbstract.php index cf3ab14db..854969689 100644 --- a/Reflection/ReflectionFunctionAbstract.php +++ b/Reflection/ReflectionFunctionAbstract.php @@ -325,4 +325,7 @@ public function getTentativeReturnType(): ?ReflectionType {} #[Pure] #[TentativeType] public function isStatic(): bool {} + + #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] + public function __toString() {} } From 475a708583122158b2a28ffdd9ceb52769af6479 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 6 Dec 2021 19:16:03 +0100 Subject: [PATCH 091/419] [phpstorm-stubs] cleanup --- tests/Tools/dump-reflection-to-file.php | 2 +- tokenizer/tokenizer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Tools/dump-reflection-to-file.php b/tests/Tools/dump-reflection-to-file.php index 645a356f0..1a8203062 100644 --- a/tests/Tools/dump-reflection-to-file.php +++ b/tests/Tools/dump-reflection-to-file.php @@ -8,5 +8,5 @@ use StubTests\TestData\Providers\ReflectionStubsSingleton; -$reflectionFileName = 'ReflectionData.json'; +$reflectionFileName = $argv[1]; file_put_contents(__DIR__ . "/../../$reflectionFileName", serialize(ReflectionStubsSingleton::getReflectionStubs())); diff --git a/tokenizer/tokenizer.php b/tokenizer/tokenizer.php index ea7f26454..d4aaf82c9 100644 --- a/tokenizer/tokenizer.php +++ b/tokenizer/tokenizer.php @@ -234,4 +234,4 @@ function token_name(int $id): string {} /** * @removed 7.0 */ -define('T_CHARACTER', 315); \ No newline at end of file +define('T_CHARACTER', 315); From 4d33f58608c48a6228e1b319041e0915b55905cc Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 20 Jan 2022 14:30:11 +0100 Subject: [PATCH 092/419] [phpstorm-stubs] fixes after merge with master --- Core/Core.php | 2 +- pcntl/pcntl.php | 6 ++++-- standard/standard_2.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Core/Core.php b/Core/Core.php index 608ee1ffe..9f5a76610 100755 --- a/Core/Core.php +++ b/Core/Core.php @@ -342,7 +342,7 @@ function define( string $constant_name, #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: 'null|array|bool|int|float|string')] $value, #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] bool $case_insensitive, - #[Deprecated(since: 7.3)] bool $case_insensitive = false + #[PhpStormStubsElementAvailable(from: '7.0')] #[Deprecated(since: 7.3)] bool $case_insensitive = false ): bool {} /** diff --git a/pcntl/pcntl.php b/pcntl/pcntl.php index 4ef06e275..2c1b316d3 100644 --- a/pcntl/pcntl.php +++ b/pcntl/pcntl.php @@ -100,7 +100,8 @@ function pcntl_waitpid( &$status, int $flags = 0, #[PhpStormStubsElementAvailable(from: '7.0')] &$resource_usage -= []): int {} += [] +): int {} /** * Waits on or returns the status of a forked child @@ -150,7 +151,8 @@ function pcntl_wait( &$status, int $flags = 0, #[PhpStormStubsElementAvailable(from: '7.0')] &$resource_usage -= []): int {} += [] +): int {} /** * Installs a signal handler diff --git a/standard/standard_2.php b/standard/standard_2.php index 0dea9223d..f6453ac57 100644 --- a/standard/standard_2.php +++ b/standard/standard_2.php @@ -341,7 +341,7 @@ function strchr(string $haystack, string $needle, bool $before_needle = false): function sprintf( string $format, #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $values, - #[PhpStormStubsElementAvailable(from: '7.0')] mixed ...$values + mixed ...$values ): string {} /** From 6afea2ff6f07897219933af1a1ecfa8dbd495816 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 11 Jul 2022 18:47:13 +0200 Subject: [PATCH 093/419] [phpstorm-stubs] fix working dir for php 5.6 image --- tests/DockerImages/5.6/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/DockerImages/5.6/Dockerfile b/tests/DockerImages/5.6/Dockerfile index d28050a34..5592f32d0 100644 --- a/tests/DockerImages/5.6/Dockerfile +++ b/tests/DockerImages/5.6/Dockerfile @@ -1,5 +1,4 @@ FROM php:5.6-alpine - RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ @@ -9,3 +8,5 @@ RUN set -eux; \ RUN docker-php-ext-install imap gmp sockets intl bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap + +WORKDIR /opt/project/phpstorm-stubs \ No newline at end of file From 7d92cdbab31267dc9ef006ce0904221801d382a3 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Tue, 12 Jul 2022 16:16:10 +0200 Subject: [PATCH 094/419] Fixed getIterator return PHPDoc --- dom/dom_c.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/dom_c.php b/dom/dom_c.php index 1e2a24946..e129c487f 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -1267,7 +1267,7 @@ class DOMNodeList implements IteratorAggregate, Countable * The number of nodes in the list. The range of valid child node indices is 0 to length - 1 inclusive. * @link https://php.net/manual/en/class.domnodelist.php#domnodelist.props.length */ - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] + #[LanguageLevelTypeAware(['8.1' => 'readonly int'], default: '')] public $length; /** @@ -1381,7 +1381,7 @@ public function removeNamedItemNS($namespace, $localName) {} public function count(): int {} /** - * @return Traversable + * @return Iterator * @since 8.0 */ public function getIterator(): Iterator {} From 371c522a47e3334ee0633a863856121c07ed4a83 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Tue, 12 Jul 2022 17:07:03 +0200 Subject: [PATCH 095/419] fixed readonly DOMNodeList::length --- dom/dom_c.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/dom_c.php b/dom/dom_c.php index e129c487f..58e1a23be 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -2,6 +2,7 @@ //20120405 AG synced to official docs use JetBrains\PhpStorm\Deprecated; +use JetBrains\PhpStorm\Immutable; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; use JetBrains\PhpStorm\Internal\TentativeType; @@ -1267,7 +1268,8 @@ class DOMNodeList implements IteratorAggregate, Countable * The number of nodes in the list. The range of valid child node indices is 0 to length - 1 inclusive. * @link https://php.net/manual/en/class.domnodelist.php#domnodelist.props.length */ - #[LanguageLevelTypeAware(['8.1' => 'readonly int'], default: '')] + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] + #[Immutable] public $length; /** From 20191ce1ef295d8e38722e7702f9f075bbd53b16 Mon Sep 17 00:00:00 2001 From: "Dmitry.Tronin" <33625946+DmitryTronin@users.noreply.github.com> Date: Thu, 14 Jul 2022 17:59:56 +0200 Subject: [PATCH 096/419] adding 8.2alpha support --- .github/workflows/main.yml | 2 +- phpunit.xml.dist | 13 +++++++++++++ tests/DockerImages/8.2/Dockerfile | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/DockerImages/8.2/Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 353a61be4..79e52172b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] name: Run tests against php ${{matrix.php}} steps: - name: Checkout diff --git a/phpunit.xml.dist b/phpunit.xml.dist index cf1edfdfe..2371998da 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -76,6 +76,19 @@ tests/StubsForbiddenTypeHintsTest.php tests/StubsPhp81Tests.php
+ + tests/BaseClassesTest.php + tests/BaseConstantsTest.php + tests/BaseFunctionsTest.php + tests/StubsConstantsAndParametersValuesTest.php + tests/StubsMetaExpectedArgumentsTest.php + tests/StubsMetaInternalTagTest.php + tests/StubsParameterNamesTest.php + tests/StubsPhpDocTest.php + tests/StubsTypeHintsTest.php + tests/StubsForbiddenTypeHintsTest.php + tests/StubsPhp81Tests.php + tests/StubsPhpDocTest.php diff --git a/tests/DockerImages/8.2/Dockerfile b/tests/DockerImages/8.2/Dockerfile new file mode 100644 index 000000000..2bb53fb15 --- /dev/null +++ b/tests/DockerImages/8.2/Dockerfile @@ -0,0 +1,14 @@ +FROM php:8.2.0alpha3-zts-alpine + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + bash gcc g++ make autoconf pkgconfig git \ + libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ + php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ + libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + +RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ + pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell + +WORKDIR /opt/project/phpstorm-stubs From ae66eb22a7b78a30f6ca0ea81502e4dc2892d0ac Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Wed, 13 Jul 2022 09:35:13 +0200 Subject: [PATCH 097/419] [phpstorm-stubs] WI-66334 add duplicated signature of var_dump Ideally should be fixed using annotation from WI-61322 but until WI-61322 is fixed let's create a dup as users complain about the wrong signature --- standard/standard_4.php | 19 +++++++++++++------ tests/TestData/mutedProblems.json | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/standard/standard_4.php b/standard/standard_4.php index 7ff6bfdf1..fd728cca8 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -187,12 +187,19 @@ function unserialize(string $data, #[PhpStormStubsElementAvailable(from: '7.0')] * @param mixed ...$values [optional] * @return void */ -function var_dump( - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $vars, - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] ...$vars, - #[PhpStormStubsElementAvailable(from: '8.0')] mixed $value, - #[PhpStormStubsElementAvailable(from: '8.0')] mixed ...$values -): void {} +#[PhpStormStubsElementAvailable(from: '8.0')] +function var_dump(mixed $value, mixed ...$values): void {} + +/** + * Dumps information about a variable + * @link https://php.net/manual/en/function.var-dump.php + * @param mixed ...$vars

+ * The variable you want to export. + *

+ * @return void + */ +#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] +function var_dump(...$vars): void {} /** * Outputs or returns a parsable string representation of a variable diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index 8675d1d20..d410b133d 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -966,6 +966,27 @@ ] } ] + }, + { + "name": "var_dump", + "parameters": [ + { + "name": "vars", + "problems": [ + { + "description": "wrong optionallity", + "versions": [ + 5.6, + 7.0, + 7.1, + 7.2, + 7.3, + 7.4 + ] + } + ] + } + ] } ], "classes": [ From 09f6e370bcbd059eebb49183e7abc707823ae14b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Wed, 13 Jul 2022 11:05:54 +0200 Subject: [PATCH 098/419] [phpstorm-stubs] fix data provider --- tests/BaseFunctionsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/BaseFunctionsTest.php b/tests/BaseFunctionsTest.php index 9a2fc80b3..49c735193 100644 --- a/tests/BaseFunctionsTest.php +++ b/tests/BaseFunctionsTest.php @@ -85,7 +85,7 @@ public function testFunctionsDuplicates() } /** - * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::functionParametersProvider + * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::functionOptionalParametersProvider * @throws RuntimeException */ public function testFunctionsOptionalParameters(PHPFunction $function, PHPParameter $parameter) From 6c2d9fdb26c4d2fb389afe4b3f0226440df6478c Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Fri, 15 Jul 2022 18:36:26 +0200 Subject: [PATCH 099/419] Provide expected arguments for array_unique sorting flags --- meta/.phpstorm.meta.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 3b3ec06e2..7efdaba17 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -668,6 +668,8 @@ function expectedReturnValues($functionReference, $values) { expectedArguments(\ksort(), 1, argumentsSet('SortFlags')); expectedArguments(\krsort(), 1, argumentsSet('SortFlags')); + expectedArguments(\array_unique(), 1, SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_LOCALE_STRING); + /** * Use this constant to mark the function with an argument on the specified position as an exit point * From ad1c335947d07089172a98cf271261ccd0d93ff5 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 15 Jul 2022 21:33:17 +0200 Subject: [PATCH 100/419] [phpstorm-stubs] suppress PhpInconsistentReturnPointsInspection in stubs Inspection doesn't make sense in stubs and causes just extra noise --- .idea/inspectionProfiles/Project_Default.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index c5aecf806..a7b0332eb 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -8,6 +8,9 @@ + + +
*/ public function connect( $host, $port = 6379, - $timeout = 0.0, - $reserved = null, + $timeout = 0, + $persistent_id = null, $retry_interval = 0, - $read_timeout = 0.0 + $read_timeout = 0, + $context = null ) {} /** * Connects to a Redis instance. * - * @param string $host can be a host, or the path to a unix domain socket - * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) - * @param null $reserved should be null if $retry_interval is specified - * @param int $retryInterval retry interval in milliseconds. - * @param float $readTimeout value in seconds (optional, default is 0 meaning unlimited) + * @param string $host can be a host, or the path to a unix domain socket + * @param int $port optional + * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) + * @param string $persistent_id identity for the requested persistent connection + * @param int $retry_interval retry interval in milliseconds. + * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) + * @param array $context sine PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on error * @@ -164,10 +188,11 @@ public function connect( public function open( $host, $port = 6379, - $timeout = 0.0, - $reserved = null, - $retryInterval = 0, - $readTimeout = 0.0 + $timeout = 0, + $persistent_id = null, + $retry_interval = 0, + $read_timeout = 0, + $context = null ) {} /** @@ -241,8 +266,9 @@ public function getPersistentID() {} /** * Get the password used to authenticate the phpredis connection * - * @return string|null|bool Returns the password used to authenticate a phpredis session or NULL if none was used, - * and FALSE if we're not connected + * @return string|array|null Returns NULL if no username/password are set, + * the password string if a password is set, + * and a [username, password] array if authenticated with a username and password. * * @throws RedisException */ @@ -261,12 +287,13 @@ public function getAuth() {} * This feature is not available in threaded versions. pconnect and popen then working like their non persistent * equivalents. * - * @param string $host can be a host, or the path to a unix domain socket - * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0 meaning unlimited) - * @param string $persistentId identity for the requested persistent connection - * @param int $retryInterval retry interval in milliseconds. - * @param float $readTimeout value in seconds (optional, default is 0 meaning unlimited) + * @param string $host can be a host, or the path to a unix domain socket + * @param int $port optional + * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) + * @param string $persistent_id identity for the requested persistent connection + * @param int $retry_interval retry interval in milliseconds. + * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) + * @param array $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on ertcnror. * @@ -292,19 +319,21 @@ public function getAuth() {} public function pconnect( $host, $port = 6379, - $timeout = 0.0, - $persistentId = null, - $retryInterval = 0, - $readTimeout = 0.0 + $timeout = 0, + $persistent_id = null, + $retry_interval = 0, + $read_timeout = 0, + $context = null ) {} /** * @param string $host * @param int $port * @param float $timeout - * @param string $persistentId - * @param int $retryInterval - * @param float $readTimeout + * @param string $persistent_id + * @param int $retry_interval + * @param float $read_timeout + * @param array $context * * @return bool * @@ -314,10 +343,11 @@ public function pconnect( public function popen( $host, $port = 6379, - $timeout = 0.0, - $persistentId = '', - $retryInterval = 0, - $readTimeout = 0.0 + $timeout = 0, + $persistent_id = null, + $retry_interval = 0, + $read_timeout = 0, + $context = null ) {} /** @@ -411,11 +441,18 @@ public function getOption($option) {} * Throws a RedisException object on connectivity error, as described above. * @throws RedisException * @link https://redis.io/commands/ping + * + * @example + * // When called without an argument, PING returns `TRUE` + * $redis->ping(); + * + * // If passed an argument, that argument is returned. Here 'hello' will be returned + * $redis->ping('hello'); */ public function ping($message = null) {} /** - * Echo the given string + * Sends a string to Redis, which replies with the same string * * @param string $message * @@ -463,14 +500,16 @@ public function get($key) {} * * @since If you're using Redis >= 2.6.12, you can pass extended options as explained in example * - * @param string $key - * @param string|mixed $value string if not used serializer - * @param int|array $timeout [optional] Calling setEx() is preferred if you want a timeout.
+ * @param string $key + * @param string|mixed $value string if not used serializer + * @param int|array|mixed $timeout [optional] Calling setex() is preferred if you want a timeout.
* Since 2.6.12 it also supports different flags inside an array. Example ['NX', 'EX' => 60]
* - EX seconds -- Set the specified expire time, in seconds.
* - PX milliseconds -- Set the specified expire time, in milliseconds.
* - NX -- Only set the key if it does not already exist.
* - XX -- Only set the key if it already exist.
+ * + * @example *
      * // Simple key -> value set
      * $redis->set('key', 'value');
@@ -570,24 +609,24 @@ public function setnx($key, $value) {}
     public function del($key1, ...$otherKeys) {}
 
     /**
-     * @param   string|string[] $key1
-     * @param   string          $key2
-     * @param   string          $key3
+     * Remove specified keys.
+     *
+     * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN
+     * @param string       ...$otherKeys
      *
      * @return int|Redis Number of keys deleted or Redis if in multi mode
      *
      * @throws RedisException
      */
     #[Deprecated(replacement: "%class%->del(%parametersList%)")]
-    public function delete($key1, $key2 = null, $key3 = null) {}
+    public function delete($key, ...$otherKeys) {}
 
     /**
      * Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking.
      *
      * @see del()
-     * @param string|string[] $key1
-     * @param string          $key2
-     * @param string          $key3
+     * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN
+     * @param string       ...$other_keys
      *
      * @return int|Redis Number of keys unlinked or Redis if in multi mode
      *
@@ -604,7 +643,7 @@ public function delete($key1, $key2 = null, $key3 = null) {}
      * $redis->unlink(array('key3', 'key4'));   // return 2
      * 
*/ - public function unlink($key1, $key2 = null, $key3 = null) {} + public function unlink($key, ...$other_keys) {} /** * Enter and exit transactional mode. @@ -642,7 +681,7 @@ public function multi($mode = Redis::MULTI) {} /** * Returns a Redis instance which can simply transmitted faster to the server. * - * @return Redis returns the Redis instance. + * @return bool|Redis returns the Redis instance. * Once in pipeline-mode, all subsequent method calls return the same object until exec() is called. * Pay attention, that Pipeline is not a transaction, so you can get unexpected * results in case of big pipelines and small read/write timeouts. @@ -681,6 +720,10 @@ public function pipeline() {} public function exec() {} /** + * Flushes all previously queued commands in a transaction and restores the connection state to normal. + * + * @return bool + * * @throws RedisException * * @see multi() @@ -691,9 +734,11 @@ public function discard() {} /** * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, * the MULTI/EXEC transaction will fail (return FALSE). unwatch cancels all the watching of all keys by this client. - * @param string|string[] $key a list of keys * - * @return void|Redis returns Redis if in multi mode + * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN + * @param string ...$other_keys + * + * @return bool|Redis returns Redis if in multi mode * * @throws RedisException * @@ -708,12 +753,13 @@ public function discard() {} * // $ret = FALSE if x has been modified between the call to WATCH and the call to EXEC. *
*/ - public function watch($key) {} + public function watch($key, ...$other_keys) {} /** * @throws RedisException * * @see watch() + * @return bool|Redis * @link https://redis.io/commands/unwatch */ public function unwatch() {} @@ -724,7 +770,7 @@ public function unwatch() {} * Warning: this function will probably change in the future. * * @param string[] $channels an array of channels to subscribe - * @param string|array $callback either a string or an array($instance, 'method_name'). + * @param string|array|callable $callback either a string or an array($instance, 'method_name'). * The callback function receives 3 parameters: the redis instance, the channel name, and the message. * * @return mixed|null|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multi mode @@ -758,21 +804,23 @@ public function subscribe($channels, $callback) {} /** * Subscribe to channels by pattern * - * @param array $patterns an array of glob-style patterns to subscribe - * @param string|array $callback Either a string or an array with an object and method. + * @param array $patterns an array of glob-style patterns to subscribe + * @param string|array|callable $callback Either a string or an array with an object and method. * The callback will get four arguments ($redis, $pattern, $channel, $message) - * @return mixed|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multi mode + * @return mixed|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multi mode * * @throws RedisException * * @link https://redis.io/commands/psubscribe * @example *
-     * function psubscribe($redis, $pattern, $chan, $msg) {
+     * function f($redis, $pattern, $chan, $msg) {
      *  echo "Pattern: $pattern\n";
      *  echo "Channel: $chan\n";
      *  echo "Payload: $msg\n";
      * }
+     *
+     * $redis->psubscribe(array('chan-1', 'chan-2', 'chan-3'), 'f')
      * 
*/ public function psubscribe($patterns, $callback) {} @@ -813,35 +861,39 @@ public function publish($channel, $message) {} * @link https://redis.io/commands/pubsub * @example *
-     * $redis->pubsub('channels'); // All channels
-     * $redis->pubsub('channels', '*pattern*'); // Just channels matching your pattern
-     * $redis->pubsub('numsub', array('chan1', 'chan2')); // Get subscriber counts for 'chan1' and 'chan2'
-     * $redis->pubsub('numpat'); // Get the number of pattern subscribers
+     * $redis->pubaub('channels'); // All channels
+     * $redis->pubaub('channels', '*pattern*'); // Just channels matching your pattern
+     * $redis->pubaub('numsub', array('chan1', 'chan2')); // Get subscriber counts for 'chan1' and 'chan2'
+     * $redis->pubaub('numpat'); // Get the number of pattern subscribers
      * 
*/ - public function pubsub($keyword, $argument) {} + public function pubaub($keyword, $argument = null) {} /** * Stop listening for messages posted to the given channels. * * @param array $channels an array of channels to usubscribe * + * @return bool|array + * * @throws RedisException * * @link https://redis.io/commands/unsubscribe */ - public function unsubscribe($channels = null) {} + public function unsubscribe($channels) {} /** * Stop listening for messages posted to the given channels. * * @param array $patterns an array of glob-style patterns to unsubscribe * + * @return bool|array + * * @throws RedisException * * @link https://redis.io/commands/punsubscribe */ - public function punsubscribe($patterns = null) {} + public function punsubscribe($patterns) {} /** * Verify if the specified key/keys exists @@ -1080,6 +1132,7 @@ public function rPushx($key, $value) {} * Returns and removes the first element of the list. * * @param string $key + * @param int $count * * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multi mode * @@ -1094,12 +1147,13 @@ public function rPushx($key, $value) {} * $redis->lPop('key1'); // key1 => [ 'B', 'C' ] *
*/ - public function lPop($key) {} + public function lPop($key, $count = 0) {} /** * Returns and removes the last element of the list. * * @param string $key + * @param int $count * * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multi mode * @@ -1114,7 +1168,7 @@ public function lPop($key) {} * $redis->rPop('key1'); // key1 => [ 'A', 'B' ] *
*/ - public function rPop($key) {} + public function rPop($key, $count = 0) {} /** * Is a blocking lPop primitive. If at least one of the lists contains at least one element, @@ -1122,8 +1176,9 @@ public function rPop($key) {} * Il all the list identified by the keys passed in arguments are empty, blPop will block * during the specified timeout until an element is pushed to one of those lists. This element will be popped. * - * @param string|string[] $keys String array containing the keys of the lists OR variadic list of strings - * @param int $timeout Timeout is always the required final parameter + * @param string|string[] $key String array containing the keys of the lists OR variadic list of strings + * @param int $timeout_or_key Timeout is always the required final parameter + * @param mixed ...$extra_args * * @return array|Redis ['listName', 'element'] or Redis if in multi mode * @@ -1158,17 +1213,18 @@ public function rPop($key) {} * // array('key1', 'A') is returned *
*/ - public function blPop($keys, $timeout) {} + public function blPop($key, $timeout_or_key, ...$extra_args) {} /** * Is a blocking rPop primitive. If at least one of the lists contains at least one element, * the element will be popped from the head of the list and returned to the caller. * Il all the list identified by the keys passed in arguments are empty, brPop will - * block during the specified timeout until an element is pushed to one of those lists. T - * his element will be popped. + * block during the specified timeout until an element is pushed to one of those lists. + * This element will be popped. * - * @param string|string[] $keys String array containing the keys of the lists OR variadic list of strings - * @param int $timeout Timeout is always the required final parameter + * @param string|string[] $key String array containing the keys of the lists OR variadic list of strings + * @param int $timeout_or_key Timeout is always the required final parameter + * @param mixed ...$extra_args * * @return array|Redis ['listName', 'element'] or Redis if in multi mode * @@ -1203,7 +1259,7 @@ public function blPop($keys, $timeout) {} * // array('key1', 'A') is returned *
*/ - public function brPop(array $keys, $timeout) {} + public function brPop($key, $timeout_or_key, ...$extra_args) {} /** * Returns the size of a list identified by Key. If the list didn't exist or is empty, @@ -1426,8 +1482,8 @@ public function lRemove($key, $value, $count) {} * or the pivot didn't exists, the value is not inserted. * * @param string $key - * @param int $position Redis::BEFORE | Redis::AFTER - * @param string $pivot + * @param string $position Redis::BEFORE | Redis::AFTER + * @param mixed $pivot * @param string|mixed $value * * @return int|Redis The number of the elements in the list, -1 if the pivot didn't exists or Redis if in multi mode @@ -1622,7 +1678,7 @@ public function sCard($key) {} * // } *
*/ - public function sPop($key, $count = 1) {} + public function sPop($key, $count = 0) {} /** * Returns a random element(s) from the set value at Key, without removing it. @@ -1654,7 +1710,7 @@ public function sPop($key, $count = 1) {} * // } *
*/ - public function sRandMember($key, $count = 1) {} + public function sRandMember($key, $count = 0) {} /** * Returns the members of a set resulting from the intersection of all the sets @@ -2232,7 +2288,7 @@ public function dbSize() {} * Authenticate the connection using a password. * Warning: The password is sent in plain-text over the network. * - * @param string|string[] $password + * @param mixed $credentials * * @return bool|Redis TRUE if the connection is authenticated, FALSE otherwise or Redis if in multi mode * @@ -2241,7 +2297,7 @@ public function dbSize() {} * @link https://redis.io/commands/auth * @example $redis->auth('foobared'); */ - public function auth($password) {} + public function auth($credentials) {} /** * Starts the background rewrite of AOF (Append-Only File) @@ -2315,7 +2371,7 @@ public function slowLog(string $operation, int $length = null) {} * - "refcount" * - "idletime" * - * @param string $string + * @param string $subcommand * @param string $key * * @return string|int|false|Redis for "encoding", int for "refcount" and "idletime", FALSE if the key doesn't exist or Redis if in multi mode @@ -2331,7 +2387,7 @@ public function slowLog(string $operation, int $length = null) {} * $redis->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds). *
*/ - public function object($string = '', $key = '') {} + public function object($subcommand, $key) {} /** * Performs a synchronous save. @@ -2401,6 +2457,7 @@ public function wait($numSlaves, $timeout) {} * - list: Redis::REDIS_LIST * - zset: Redis::REDIS_ZSET * - hash: Redis::REDIS_HASH + * - stream: Redis::REDIS_STREAM * - other: Redis::REDIS_NOT_FOUND * * @throws RedisException @@ -2536,7 +2593,7 @@ public function strlen($key) {} * $redis->bitpos('key', 0, 1, 5); // int(-1) *
*/ - public function bitpos($key, $bit, $start = 0, $end = null) {} + public function bitpos($key, $bit, $start = 0, $end = -1) {} /** * Return a single bit out of a larger string @@ -2584,6 +2641,8 @@ public function setBit($key, $offset, $value) {} * Count bits in a string * * @param string $key + * @param int $start + * @param int $end * * @return int|Redis The number of bits set to 1 in the value behind the input key or Redis if in multi mode * @@ -2599,7 +2658,7 @@ public function setBit($key, $offset, $value) {} * var_dump( $redis->bitCount('bit', 0, 2) ); // int(11) *
*/ - public function bitCount($key) {} + public function bitCount($key, $start = 0, $end = -1) {} /** * Bitwise operation on multiple keys. @@ -2630,16 +2689,20 @@ public function bitOp($operation, $retKey, $key1, ...$otherKeys) {} /** * Removes all entries from the current database. * + * @param bool $async requires server version 4.0.0 or greater + * * @return bool|Redis Always TRUE or Redis if in multi mode * @throws RedisException * @link https://redis.io/commands/flushdb * @example $redis->flushDB(); */ - public function flushDB() {} + public function flushDB($async = null) {} /** * Removes all entries from all databases. * + * @param bool $async requires server version 4.0.0 or greater + * * @return bool|Redis Always TRUE or Redis if in multi mode * * @throws RedisException @@ -2647,7 +2710,7 @@ public function flushDB() {} * @link https://redis.io/commands/flushall * @example $redis->flushAll(); */ - public function flushAll() {} + public function flushAll($async = null) {} /** * Sort @@ -2781,6 +2844,7 @@ public function role() {} * @example $redis->resetStat(); * @link https://redis.io/commands/config-resetstat */ + #[Deprecated(replacement: '%class%->rawCommand(\'CONFIG\', \'RESETSTAT\');')] public function resetStat() {} /** @@ -2795,7 +2859,7 @@ public function resetStat() {} * @link https://redis.io/commands/ttl * @example *
-     * $redis->setEx('key', 123, 'test');
+     * $redis->setex('key', 123, 'test');
      * $redis->ttl('key'); // int(123)
      * 
*/ @@ -2815,7 +2879,7 @@ public function ttl($key) {} * @link https://redis.io/commands/pttl * @example *
-     * $redis->setEx('key', 123, 'test');
+     * $redis->setex('key', 123, 'test');
      * $redis->pttl('key'); // int(122999)
      * 
*/ @@ -3040,7 +3104,7 @@ public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $v * @param string $key * @param int $start * @param int $end - * @param bool $withscores + * @param mixed $withscores * * @return array|Redis Array containing the values in specified range or Redis if in multi mode * @@ -3110,7 +3174,7 @@ public function zDelete($key, $member1, ...$otherMembers) {} * @param string $key * @param int $start * @param int $end - * @param bool $withscore + * @param mixed $withscore * * @return array|Redis Array containing the values in specified range or Redis if in multi mode * @@ -3203,7 +3267,7 @@ public function zRevRangeByScore($key, $start, $end, array $options = []) {} * $redis->zRangeByLex('key', '-', '[c'); // array('b', 'c') *
*/ - public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) {} + public function zRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} /** * @see zRangeByLex() @@ -3219,7 +3283,7 @@ public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) {} * * @link https://redis.io/commands/zrevrangebylex */ - public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) {} + public function zRevRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} /** * Returns the number of elements of the sorted set stored at the specified key which have @@ -3403,7 +3467,7 @@ public function zRevRank($key, $member) {} * * @param string $key * @param float $value (double) value that will be added to the member's score - * @param string $member + * @param string|mixed $member * * @return float|Redis the new value or Redis if in multi mode * @@ -3461,7 +3525,7 @@ public function zIncrBy($key, $value, $member) {} * $redis->zUnionStore('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1') *
*/ - public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggregateFunction = 'SUM') {} + public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggregateFunction = null) {} /** * @param string $Output @@ -3519,7 +3583,7 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * $redis->zInterStore('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1') *
*/ - public function zInterStore($output, $zSetKeys, array $weights = null, $aggregateFunction = 'SUM') {} + public function zInterStore($output, $zSetKeys, array $weights = null, $aggregateFunction = null) {} /** * @param $Output @@ -3560,9 +3624,9 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * Block until Redis can pop the highest or lowest scoring members from one or more ZSETs. * There are two commands (BZPOPMIN and BZPOPMAX for popping the lowest and highest scoring elements respectively.) * - * @param string|array $key1 - * @param string|array $key2 ... - * @param int $timeout + * @param string|array $key + * @param string|int|array $timeout_or_key ... + * @param mixed ...$extra_args * * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multi mode * if the timeout was reached without an element to pop. @@ -3582,12 +3646,12 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * $redis->bzPopMax('zs1', 'zs2', 5); *
*/ - public function bzPopMax($key1, $key2, $timeout) {} + public function bzPopMax($key, $timeout_or_key, ...$extra_args) {} /** - * @param string|array $key1 - * @param string|array $key2 ... - * @param int $timeout + * @param string|array $key + * @param string|int|array $timeout_or_key ... + * @param mixed ...$extra_args * * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multi mode * if the timeout was reached without an element to pop. @@ -3598,7 +3662,7 @@ public function bzPopMax($key1, $key2, $timeout) {} * @since >= 5.0 * @link https://redis.io/commands/bzpopmin */ - public function bzPopMin($key1, $key2, $timeout) {} + public function bzPopMin($key, $timeout_or_key, ...$extra_args) {} /** * Can pop the highest scoring members from one ZSET. @@ -3621,7 +3685,7 @@ public function bzPopMin($key1, $key2, $timeout) {} * $redis->zPopMax('zs1', 3); *
*/ - public function zPopMax($key, $count = 1) {} + public function zPopMax($key, $count = null) {} /** * Can pop the lowest scoring members from one ZSET. @@ -3644,7 +3708,7 @@ public function zPopMax($key, $count = 1) {} * $redis->zPopMin('zs1', 3); *
*/ - public function zPopMin($key, $count = 1) {} + public function zPopMin($key, $count = null) {} /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. @@ -3994,7 +4058,7 @@ public function hMGet($key, $hashKeys) {} * @param string $pattern Optional pattern to match against. * @param int $count How many keys to return in a go (only a sugestion to Redis). * - * @return array|Redis An array of members that match our pattern or Redis if in multi mode + * @return array|bool|Redis An array of members that match our pattern or Redis if in multi mode * * @throws RedisException * @@ -4035,6 +4099,7 @@ public function hStrLen(string $key, string $field) {} * @param float $longitude * @param float $latitude * @param string $member + * @param mixed ...$other_triples * * @return int|Redis The number of elements added to the geospatial key or Redis if in multi mode * @@ -4055,7 +4120,7 @@ public function hStrLen(string $key, string $field) {} * ); // 2 *
*/ - public function geoAdd($key, $longitude, $latitude, $member) {} + public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) {} /** * Retrieve Geohash strings for one or more elements of a geospatial index. @@ -4089,7 +4154,7 @@ public function geoHash($key, ...$member) {} * Return longitude, latitude positions for each requested member. * * @param string $key - * @param string $member + * @param string ...$member * @return array|Redis One or more longitude/latitude positions or Redis if in multi mode * * @throws RedisException @@ -4116,7 +4181,7 @@ public function geoHash($key, ...$member) {} * } *
*/ - public function geoPos(string $key, string $member) {} + public function geoPos(string $key, string ...$member) {} /** * Return the distance between two members in a geospatial set. @@ -4271,7 +4336,7 @@ public function geoDist($key, $member1, $member2, $unit = null) {} * } *
*/ - public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $options = null) {} + public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $options = []) {} /** * This method is identical to geoRadius except that instead of passing a longitude and latitude as the "source" @@ -4313,7 +4378,7 @@ public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $op * } *
*/ - public function geoRadiusByMember($key, $member, $radius, $units, array $options = null) {} + public function geoRadiusByMember($key, $member, $radius, $units, array $options = []) {} /** * Get or Set the redis config keys. @@ -4333,7 +4398,7 @@ public function geoRadiusByMember($key, $member, $radius, $units, array $options * $redis->config("SET", "dir", "/var/run/redis/dumps/"); *
*/ - public function config($operation, $key, $value = '') {} + public function config($operation, $key, $value = null) {} /** * Evaluate a LUA script serverside @@ -4412,7 +4477,7 @@ public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {} /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. * @param string $command load | flush | kill | exists - * @param string $script + * @param mixed ...$script * * @return mixed|Redis returns Redis if in multi mode * @@ -4435,7 +4500,7 @@ public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {} * SCRIPT KILL will return true if a script was able to be killed and false if not * SCRIPT EXISTS will return an array with TRUE or FALSE for each passed script */ - public function script($command, $script) {} + public function script($command, ...$script) {} /** * The last error message (if any) @@ -4506,12 +4571,12 @@ public function clearLastError() {} * $redis->client('kill', ); // Kill the process at ip:port *
*/ - public function client($command, $value = '') {} + public function client($command, $value = null) {} /** * A utility method to prefix the value with the prefix setting for phpredis. * - * @param mixed $value The value you wish to prefix + * @param string $value The value you wish to prefix * * @return string If a prefix is set up, the value now prefixed * If there is no prefix, the value will be returned unchanged. @@ -4745,7 +4810,7 @@ public function pfMerge($destKey, array $sourceKeys) {} * $redis->rawCommand('GET", 'key'); // string(5) "value" *
*/ - public function rawCommand($command, $arguments) {} + public function rawCommand($command, ...$arguments) {} /** * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. @@ -4785,6 +4850,7 @@ public function xAck($stream, $group, $messages) {} * @param array $messages * @param int $maxLen * @param bool $isApproximate + * @param bool $nomkstream * * @return string|Redis The added message ID or Redis if in multi mode * @@ -4798,7 +4864,7 @@ public function xAck($stream, $group, $messages) {} * $redis->xAdd('mystream', "*", ['field' => 'value'], 10, true); *
*/ - public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false) {} + public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) {} /** * Claim ownership of one or more pending messages @@ -4874,7 +4940,7 @@ public function xDel($key, $ids) {} * $redis->xGroup('DESTROY', 'mystream', 'mygroup'); *
*/ - public function xGroup($operation, $key, $group, $msgId = '', $mkStream = false) {} + public function xGroup($operation, $key = null, $group = null, $msgId = null, $mkStream = false) {} /** * Get information about a stream or consumer groups @@ -4893,7 +4959,7 @@ public function xGroup($operation, $key, $group, $msgId = '', $mkStream = false) * $redis->xInfo('STREAM', 'mystream'); *
*/ - public function xInfo($operation, $stream, $group) {} + public function xInfo($operation, $stream = null, $group = null) {} /** * Get the length of a given stream. @@ -4922,7 +4988,7 @@ public function xLen($stream) {} * @param int $count * @param string $consumer * - * @return array|Redis Information about the pending messages, in various forms depending on or Redis if in multi mode + * @return array|string|Redis Information about the pending messages, in various forms depending on or Redis if in multi mode * the specific invocation of XPENDING. * * @throws RedisException @@ -4934,7 +5000,7 @@ public function xLen($stream) {} * $redis->xPending('mystream', 'mygroup', '-', '+', 1, 'consumer-1'); *
*/ - public function xPending($stream, $group, $start = null, $end = null, $count = null, $consumer = null) {} + public function xPending($stream, $group, $start = null, $end = null, $count = -1, $consumer = null) {} /** * Get a range of messages from a given stream @@ -4944,7 +5010,7 @@ public function xPending($stream, $group, $start = null, $end = null, $count = n * @param string $end * @param int $count * - * @return array|Redis The messages in the stream within the requested range or Redis if in multi mode + * @return array|bool|Redis The messages in the stream within the requested range or Redis if in multi mode * * @throws RedisException * @@ -4957,7 +5023,7 @@ public function xPending($stream, $group, $start = null, $end = null, $count = n * $redis->xRange('mystream', '-', '+', 2); *
*/ - public function xRange($stream, $start, $end, $count = null) {} + public function xRange($stream, $start, $end, $count = -1) {} /** * Read data from one or more streams and only return IDs greater than sent in the command. @@ -4966,7 +5032,7 @@ public function xRange($stream, $start, $end, $count = null) {} * @param int|string $count * @param int|string $block * - * @return array|Redis The messages in the stream newer than the IDs passed to Redis (if any) or Redis if in multi mode + * @return array|bool|Redis The messages in the stream newer than the IDs passed to Redis (if any) or Redis if in multi mode * * @throws RedisException * @@ -4976,7 +5042,7 @@ public function xRange($stream, $start, $end, $count = null) {} * $redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']); *
*/ - public function xRead($streams, $count = null, $block = null) {} + public function xRead($streams, $count = -1, $block = -1) {} /** * This method is similar to xRead except that it supports reading messages for a specific consumer group. @@ -5000,7 +5066,7 @@ public function xRead($streams, $count = null, $block = null) {} * $redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000); *
*/ - public function xReadGroup($group, $consumer, $streams, $count = null, $block = null) {} + public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) {} /** * This is identical to xRange except the results come back in reverse order. @@ -5011,7 +5077,7 @@ public function xReadGroup($group, $consumer, $streams, $count = null, $block = * @param string $start * @param int $count * - * @return array|Redis The messages in the range specified or Redis if in multi mode + * @return array|bool|Redis The messages in the range specified or Redis if in multi mode * * @throws RedisException * @@ -5021,7 +5087,7 @@ public function xReadGroup($group, $consumer, $streams, $count = null, $block = * $redis->xRevRange('mystream', '+', '-'); *
*/ - public function xRevRange($stream, $end, $start, $count = null) {} + public function xRevRange($stream, $end, $start, $count = -1) {} /** * Trim the stream length to a given maximum. From bd6d5f7f2cc9f24a53eea4e6840c9d1f36f6af39 Mon Sep 17 00:00:00 2001 From: RobiNN Date: Sat, 27 Aug 2022 01:06:56 +0200 Subject: [PATCH 165/419] Update Redis.php --- redis/Redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index a9318e881..be37d8bb0 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -4797,8 +4797,8 @@ public function pfMerge($destKey, array $sourceKeys) {} /** * Send arbitrary things to the redis server. * - * @param string $command Required command to send to the server. - * @param mixed $arguments Optional variable amount of arguments to send to the server. + * @param string $command Required command to send to the server. + * @param mixed ...$arguments Optional variable amount of arguments to send to the server. * * @return mixed|Redis returns Redis if in multi mode * From cb304bbe77a18a1cf02932f82eba0496b78f5809 Mon Sep 17 00:00:00 2001 From: RobiNN Date: Sat, 27 Aug 2022 01:13:40 +0200 Subject: [PATCH 166/419] typo --- redis/Redis.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index be37d8bb0..b8944b78f 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -861,13 +861,13 @@ public function publish($channel, $message) {} * @link https://redis.io/commands/pubsub * @example *
-     * $redis->pubaub('channels'); // All channels
-     * $redis->pubaub('channels', '*pattern*'); // Just channels matching your pattern
-     * $redis->pubaub('numsub', array('chan1', 'chan2')); // Get subscriber counts for 'chan1' and 'chan2'
-     * $redis->pubaub('numpat'); // Get the number of pattern subscribers
+     * $redis->pubsub('channels'); // All channels
+     * $redis->pubsub('channels', '*pattern*'); // Just channels matching your pattern
+     * $redis->pubsub('numsub', array('chan1', 'chan2')); // Get subscriber counts for 'chan1' and 'chan2'
+     * $redis->pubsub('numpat'); // Get the number of pattern subscribers
      * 
*/ - public function pubaub($keyword, $argument = null) {} + public function pubsub($keyword, $argument = null) {} /** * Stop listening for messages posted to the given channels. From aca842b158f8efbe882db446b1454f292e2b8c32 Mon Sep 17 00:00:00 2001 From: RobiNN Date: Sun, 28 Aug 2022 21:06:27 +0200 Subject: [PATCH 167/419] Update Redis.php --- redis/Redis.php | 350 ++++++++++++++++++++++++------------------------ 1 file changed, 175 insertions(+), 175 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index b8944b78f..215f36be9 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -178,7 +178,7 @@ public function connect( * @param string $persistent_id identity for the requested persistent connection * @param int $retry_interval retry interval in milliseconds. * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) - * @param array $context sine PhpRedis >= 5.3.0 can specify authentication and stream information on connect + * @param array $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on error * @@ -456,7 +456,7 @@ public function ping($message = null) {} * * @param string $message * - * @return string|Redis Returns message or Redis if in multi mode + * @return string|Redis Returns message or Redis if in multimode * * @throws RedisException * @@ -469,7 +469,7 @@ public function echo($message) {} * * @param string $key * - * @return string|mixed|false|Redis If key didn't exist, FALSE is returned or Redis if in multi mode + * @return string|mixed|false|Redis If key didn't exist, FALSE is returned or Redis if in multimode * Otherwise, the value related to this key is returned * * @throws RedisException @@ -524,7 +524,7 @@ public function get($key) {} * $redis->set('key', 'value', ['xx', 'px' => 1000]); *
* - * @return bool|Redis TRUE if the command is successful or Redis if in multi mode + * @return bool|Redis TRUE if the command is successful or Redis if in multimode * * @throws RedisException * @@ -539,7 +539,7 @@ public function set($key, $value, $timeout = null) {} * @param int $expire * @param string|mixed $value * - * @return bool|Redis returns Redis if in multi mode + * @return bool|Redis returns Redis if in multimode * * @throws RedisException * @@ -556,7 +556,7 @@ public function setex($key, $expire, $value) {} * @param int $expire in milliseconds. * @param string|mixed $value * - * @return bool|Redis returns Redis if in multi mode + * @return bool|Redis returns Redis if in multimode * * @throws RedisException * @@ -571,7 +571,7 @@ public function psetex($key, $expire, $value) {} * @param string $key * @param mixed $value * - * @return bool|array|Redis returns Redis if in multi mode + * @return bool|array|Redis returns Redis if in multimode * * @throws RedisException * @@ -590,7 +590,7 @@ public function setnx($key, $value) {} * @param int|string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param int|string ...$otherKeys * - * @return int|Redis Number of keys deleted or Redis if in multi mode + * @return int|Redis Number of keys deleted or Redis if in multimode * * @throws RedisException * @@ -614,7 +614,7 @@ public function del($key1, ...$otherKeys) {} * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param string ...$otherKeys * - * @return int|Redis Number of keys deleted or Redis if in multi mode + * @return int|Redis Number of keys deleted or Redis if in multimode * * @throws RedisException */ @@ -628,7 +628,7 @@ public function delete($key, ...$otherKeys) {} * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param string ...$other_keys * - * @return int|Redis Number of keys unlinked or Redis if in multi mode + * @return int|Redis Number of keys unlinked or Redis if in multimode * * @throws RedisException * @@ -654,7 +654,7 @@ public function unlink($key, ...$other_keys) {} * a Redis::PIPELINE block is simply transmitted faster to the server, but without any guarantee of atomicity. * discard cancels a transaction. * - * @return static|Redis returns the Redis instance and enters multi-mode or Redis if in multi mode + * @return static|Redis returns the Redis instance and enters multi-mode or Redis if in multimode * Once in multi-mode, all subsequent method calls return the same object until exec() is called. * * @throws RedisException @@ -710,7 +710,7 @@ public function multi($mode = Redis::MULTI) {} public function pipeline() {} /** - * @return void|array|Redis returns Redis if in multi mode + * @return void|array|Redis returns Redis if in multimode * * @throws RedisException * @@ -738,7 +738,7 @@ public function discard() {} * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param string ...$other_keys * - * @return bool|Redis returns Redis if in multi mode + * @return bool|Redis returns Redis if in multimode * * @throws RedisException * @@ -773,7 +773,7 @@ public function unwatch() {} * @param string|array|callable $callback either a string or an array($instance, 'method_name'). * The callback function receives 3 parameters: the redis instance, the channel name, and the message. * - * @return mixed|null|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multi mode + * @return mixed|null|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multimode * * @throws RedisException * @@ -807,7 +807,7 @@ public function subscribe($channels, $callback) {} * @param array $patterns an array of glob-style patterns to subscribe * @param string|array|callable $callback Either a string or an array with an object and method. * The callback will get four arguments ($redis, $pattern, $channel, $message) - * @return mixed|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multi mode + * @return mixed|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multimode * * @throws RedisException * @@ -833,7 +833,7 @@ public function psubscribe($patterns, $callback) {} * @param string $channel a channel to publish to * @param string $message string * - * @return int|Redis Number of clients that received the message or Redis if in multi mode + * @return int|Redis Number of clients that received the message or Redis if in multimode * * @throws RedisException * @@ -850,7 +850,7 @@ public function publish($channel, $message) {} * For the "channels" subcommand, you can pass a string pattern. * For "numsub" an array of channel names * - * @return array|int|Redis Either an integer or an array or Redis if in multi mode + * @return array|int|Redis Either an integer or an array or Redis if in multimode * - channels Returns an array where the members are the matching channels. * - numsub Returns a key/value array where the keys are channel names and * values are their counts. @@ -904,7 +904,7 @@ public function punsubscribe($patterns) {} * * @param string|string[] $key * - * @return int|bool|Redis The number of keys tested that do exist or Redis if in multi mode + * @return int|bool|Redis The number of keys tested that do exist or Redis if in multimode * * @throws RedisException * @@ -927,7 +927,7 @@ public function exists($key) {} * * @param string $key * - * @return int|Redis the new value or Redis if in multi mode + * @return int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -948,7 +948,7 @@ public function incr($key) {} * @param string $key * @param float $increment * - * @return float|Redis returns Redis if in multi mode + * @return float|Redis returns Redis if in multimode * * @throws RedisException * @@ -969,7 +969,7 @@ public function incrByFloat($key, $increment) {} * @param string $key key * @param int $value value that will be added to key (only for incrBy) * - * @return int|Redis the new value or Redis if in multi mode + * @return int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -990,7 +990,7 @@ public function incrBy($key, $value) {} * * @param string $key * - * @return int|Redis the new value or Redis if in multi mode + * @return int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -1011,7 +1011,7 @@ public function decr($key) {} * @param string $key * @param int $value that will be subtracted to key (only for decrBy) * - * @return int|Redis the new value or Redis if in multi mode + * @return int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -1034,7 +1034,7 @@ public function decrBy($key, $value) {} * @param string $key * @param string|mixed ...$value1 Variadic list of values to push in key, if dont used serialized, used string * - * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode + * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * * @throws RedisException * @@ -1062,7 +1062,7 @@ public function lPush($key, ...$value1) {} * @param string $key * @param string|mixed ...$value1 Variadic list of values to push in key, if dont used serialized, used string * - * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode + * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * * @throws RedisException * @@ -1088,7 +1088,7 @@ public function rPush($key, ...$value1) {} * @param string $key * @param string|mixed $value String, value to push in key * - * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode + * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * * @throws RedisException * @@ -1111,7 +1111,7 @@ public function lPushx($key, $value) {} * @param string $key * @param string|mixed $value String, value to push in key * - * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multi mode + * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * * @throws RedisException * @@ -1134,7 +1134,7 @@ public function rPushx($key, $value) {} * @param string $key * @param int $count * - * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multi mode + * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multimode * * @throws RedisException * @@ -1155,7 +1155,7 @@ public function lPop($key, $count = 0) {} * @param string $key * @param int $count * - * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multi mode + * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multimode * * @throws RedisException * @@ -1180,7 +1180,7 @@ public function rPop($key, $count = 0) {} * @param int $timeout_or_key Timeout is always the required final parameter * @param mixed ...$extra_args * - * @return array|Redis ['listName', 'element'] or Redis if in multi mode + * @return array|Redis ['listName', 'element'] or Redis if in multimode * * @throws RedisException * @@ -1226,7 +1226,7 @@ public function blPop($key, $timeout_or_key, ...$extra_args) {} * @param int $timeout_or_key Timeout is always the required final parameter * @param mixed ...$extra_args * - * @return array|Redis ['listName', 'element'] or Redis if in multi mode + * @return array|Redis ['listName', 'element'] or Redis if in multimode * * @throws RedisException * @@ -1267,7 +1267,7 @@ public function brPop($key, $timeout_or_key, ...$extra_args) {} * * @param string $key * - * @return int|bool|Redis The size of the list identified by Key exists or Redis if in multi mode + * @return int|bool|Redis The size of the list identified by Key exists or Redis if in multimode * bool FALSE if the data type identified by Key is not list * * @throws RedisException @@ -1290,7 +1290,7 @@ public function lLen($key) {} * * @param string $key * - * @return int|Redis The size of the list identified by Key exists or Redis if in multi mode + * @return int|Redis The size of the list identified by Key exists or Redis if in multimode * * @throws RedisException */ @@ -1305,7 +1305,7 @@ public function lSize($key) {} * @param string $key * @param int $index * - * @return mixed|bool|Redis the element at this index or Redis if in multi mode + * @return mixed|bool|Redis the element at this index or Redis if in multimode * * @throws RedisException * @@ -1329,7 +1329,7 @@ public function lIndex($key, $index) {} * * @param string $key * @param int $index - * @return mixed|bool|Redis the element at this index or Redis if in multi mode + * @return mixed|bool|Redis the element at this index or Redis if in multimode * * @throws RedisException */ @@ -1343,7 +1343,7 @@ public function lGet($key, $index) {} * @param int $index * @param string $value * - * @return bool|Redis TRUE if the new value is setted or Redis if in multi mode + * @return bool|Redis TRUE if the new value is setted or Redis if in multimode * FALSE if the index is out of range, or data type identified by key is not a list. * * @throws RedisException @@ -1370,7 +1370,7 @@ public function lSet($key, $index, $value) {} * @param int $start * @param int $end * - * @return array|Redis containing the values in specified range or Redis if in multi mode + * @return array|Redis containing the values in specified range or Redis if in multimode * * @throws RedisException * @@ -1391,7 +1391,7 @@ public function lRange($key, $start, $end) {} * @param string $key * @param int $start * @param int $end - * @return array|Redis returns Redis if in multi mode + * @return array|Redis returns Redis if in multimode * * @throws RedisException */ @@ -1405,7 +1405,7 @@ public function lGetRange($key, $start, $end) {} * @param int $start * @param int $stop * - * @return array|false|Redis Bool return FALSE if the key identify a non-list value or Redis if in multi mode + * @return array|false|Redis Bool return FALSE if the key identify a non-list value or Redis if in multimode * * @throws RedisException * @@ -1443,7 +1443,7 @@ public function listTrim($key, $start, $stop) {} * @param string $value * @param int $count * - * @return int|bool|Redis the number of elements to remove or Redis if in multi mode + * @return int|bool|Redis the number of elements to remove or Redis if in multimode * bool FALSE if the value identified by key is not a list. * * @throws RedisException @@ -1486,7 +1486,7 @@ public function lRemove($key, $value, $count) {} * @param mixed $pivot * @param string|mixed $value * - * @return int|Redis The number of the elements in the list, -1 if the pivot didn't exists or Redis if in multi mode + * @return int|Redis The number of the elements in the list, -1 if the pivot didn't exists or Redis if in multimode * * @throws RedisException * @@ -1517,7 +1517,7 @@ public function lInsert($key, $position, $pivot, $value) {} * @param string $key Required key * @param string|mixed ...$value1 Variadic list of values * - * @return int|bool|Redis The number of elements added to the set or Redis if in multi mode + * @return int|bool|Redis The number of elements added to the set or Redis if in multimode * If this value is already in the set, FALSE is returned * * @throws RedisException @@ -1537,7 +1537,7 @@ public function sAdd($key, ...$value1) {} * @param string $key * @param string|mixed ...$member1 Variadic list of members * - * @return int|Redis The number of elements removed from the set or Redis if in multi mode + * @return int|Redis The number of elements removed from the set or Redis if in multimode * * @throws RedisException * @@ -1573,7 +1573,7 @@ public function sRemove($key, ...$member1) {} * @param string $dstKey * @param string|mixed $member * - * @return bool|Redis If the operation is successful, return TRUE or Redis if in multi mode + * @return bool|Redis If the operation is successful, return TRUE or Redis if in multimode * If the srcKey and/or dstKey didn't exist, and/or the member didn't exist in srcKey, FALSE is returned. * * @throws RedisException @@ -1598,7 +1598,7 @@ public function sMove($srcKey, $dstKey, $member) {} * @param string $key * @param string|mixed $value * - * @return bool|Redis TRUE if value is a member of the set at key key, FALSE otherwise or Redis if in multi mode + * @return bool|Redis TRUE if value is a member of the set at key key, FALSE otherwise or Redis if in multimode * * @throws RedisException * @@ -1631,7 +1631,7 @@ public function sContains($key, $value) {} * * @param string $key * - * @return int|Redis the cardinality of the set identified by key, 0 if the set doesn't exist or Redis if in multi mode + * @return int|Redis the cardinality of the set identified by key, 0 if the set doesn't exist or Redis if in multimode * * @throws RedisException * @@ -1653,7 +1653,7 @@ public function sCard($key) {} * @param string $key * @param int $count [optional] * - * @return string|mixed|array|bool|Redis "popped" values or Redis if in multi mode + * @return string|mixed|array|bool|Redis "popped" values or Redis if in multimode * bool FALSE if set identified by key is empty or doesn't exist. * * @throws RedisException @@ -1686,7 +1686,7 @@ public function sPop($key, $count = 0) {} * @param string $key * @param int $count [optional] * - * @return string|mixed|array|bool|Redis value(s) from the set or Redis if in multi mode + * @return string|mixed|array|bool|Redis value(s) from the set or Redis if in multimode * bool FALSE if set identified by key is empty or doesn't exist and count argument isn't passed. * * @throws RedisException @@ -1720,7 +1720,7 @@ public function sRandMember($key, $count = 0) {} * @param string $key1 keys identifying the different sets on which we will apply the intersection. * @param string ...$otherKeys variadic list of keys * - * @return array|false|Redis contain the result of the intersection between those keys or Redis if in multi mode + * @return array|false|Redis contain the result of the intersection between those keys or Redis if in multimode * If the intersection between the different sets is empty, the return value will be empty array. * * @throws RedisException @@ -1758,7 +1758,7 @@ public function sInter($key1, ...$otherKeys) {} * @param string $key1 keys identifying the different sets on which we will apply the intersection. * @param string ...$otherKeys variadic list of keys * - * @return int|false|Redis The cardinality of the resulting set, or FALSE in case of a missing key or Redis if in multi mode + * @return int|false|Redis The cardinality of the resulting set, or FALSE in case of a missing key or Redis if in multimode * * @throws RedisException * @@ -1797,7 +1797,7 @@ public function sInterStore($dstKey, $key1, ...$otherKeys) {} * @param string $key1 first key for union * @param string ...$otherKeys variadic list of keys corresponding to sets in redis * - * @return array|Redis string[] The union of all these sets or Redis if in multi mode + * @return array|Redis string[] The union of all these sets or Redis if in multimode * * @throws RedisException * @@ -1834,7 +1834,7 @@ public function sUnion($key1, ...$otherKeys) {} * @param string $key1 first key for union * @param string ...$otherKeys variadic list of keys corresponding to sets in redis * - * @return int|Redis Any number of keys corresponding to sets in redis or Redis if in multi mode + * @return int|Redis Any number of keys corresponding to sets in redis or Redis if in multimode * * @throws RedisException * @@ -1874,7 +1874,7 @@ public function sUnionStore($dstKey, $key1, ...$otherKeys) {} * @param string $key1 first key for diff * @param string ...$otherKeys variadic list of keys corresponding to sets in redis * - * @return array|Redis string[] The difference of the first set will all the others or Redis if in multi mode + * @return array|Redis string[] The difference of the first set will all the others or Redis if in multimode * * @throws RedisException * @@ -1910,7 +1910,7 @@ public function sDiff($key1, ...$otherKeys) {} * @param string $key1 first key for diff * @param string ...$otherKeys variadic list of keys corresponding to sets in redis * - * @return int|false|Redis The cardinality of the resulting set, or FALSE in case of a missing key or Redis if in multi mode + * @return int|false|Redis The cardinality of the resulting set, or FALSE in case of a missing key or Redis if in multimode * * @throws RedisException * @@ -1946,7 +1946,7 @@ public function sDiffStore($dstKey, $key1, ...$otherKeys) {} * * @param string $key * - * @return array|Redis An array of elements, the contents of the set or Redis if in multi mode + * @return array|Redis An array of elements, the contents of the set or Redis if in multimode * * @throws RedisException * @@ -1977,7 +1977,7 @@ public function sMembers($key) {} * @link https://redis.io/commands/smembers * * @param string $key - * @return array|Redis An array of elements, the contents of the set or Redis if in multi mode + * @return array|Redis An array of elements, the contents of the set or Redis if in multimode * * @throws RedisException */ @@ -1992,7 +1992,7 @@ public function sGetMembers($key) {} * @param string $pattern String, optional pattern to match against. * @param int $count How many members to return at a time (Redis might return a different amount) * - * @return array|false|Redis PHPRedis will return an array of keys or FALSE when we're done iterating or Redis if in multi mode + * @return array|false|Redis PHPRedis will return an array of keys or FALSE when we're done iterating or Redis if in multimode * * @throws RedisException * @@ -2015,7 +2015,7 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) {} * @param string $key * @param string|mixed $value * - * @return string|mixed|Redis A string (mixed, if used serializer), the previous value located at this key or Redis if in multi mode + * @return string|mixed|Redis A string (mixed, if used serializer), the previous value located at this key or Redis if in multimode * * @throws RedisException * @@ -2032,7 +2032,7 @@ public function getSet($key, $value) {} /** * Returns a random key * - * @return string|Redis an existing key in redis or Redis if in multi mode + * @return string|Redis an existing key in redis or Redis if in multimode * * @throws RedisException * @@ -2050,7 +2050,7 @@ public function randomKey() {} * * @param int $dbIndex * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2072,7 +2072,7 @@ public function select($dbIndex) {} * @param string $key * @param int $dbIndex * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2094,7 +2094,7 @@ public function move($key, $dbIndex) {} * @param string $srcKey * @param string $dstKey * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2129,7 +2129,7 @@ public function renameKey($srcKey, $dstKey) {} * @param string $srcKey * @param string $dstKey * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2150,7 +2150,7 @@ public function renameNx($srcKey, $dstKey) {} * @param string $key The key that will disappear * @param int $ttl The key's remaining Time To Live, in seconds * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2171,7 +2171,7 @@ public function expire($key, $ttl) {} * @param string $key The key that will disappear. * @param int $ttl The key's remaining Time To Live, in milliseconds * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2191,7 +2191,7 @@ public function pExpire($key, $ttl) {} * * @param string $key * @param int $ttl - * @return bool|Redis returns Redis if in multi mode + * @return bool|Redis returns Redis if in multimode * * @throws RedisException */ @@ -2204,7 +2204,7 @@ public function setTimeout($key, $ttl) {} * @param string $key The key that will disappear. * @param int $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time. * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2226,7 +2226,7 @@ public function expireAt($key, $timestamp) {} * @param string $key The key that will disappear * @param int $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2246,7 +2246,7 @@ public function pExpireAt($key, $timestamp) {} * * @param string $pattern pattern, using '*' as a wildcard * - * @return array|Redis string[] The keys that match a certain pattern or Redis if in multi mode + * @return array|Redis string[] The keys that match a certain pattern or Redis if in multimode * * @throws RedisException * @@ -2271,7 +2271,7 @@ public function getKeys($pattern) {} /** * Returns the current database's size * - * @return int|Redis DB size, in number of keys or Redis if in multi mode + * @return int|Redis DB size, in number of keys or Redis if in multimode * * @throws RedisException * @@ -2290,7 +2290,7 @@ public function dbSize() {} * * @param mixed $credentials * - * @return bool|Redis TRUE if the connection is authenticated, FALSE otherwise or Redis if in multi mode + * @return bool|Redis TRUE if the connection is authenticated, FALSE otherwise or Redis if in multimode * * @throws RedisException * @@ -2302,7 +2302,7 @@ public function auth($credentials) {} /** * Starts the background rewrite of AOF (Append-Only File) * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2318,7 +2318,7 @@ public function bgrewriteaof() {} * @param string $host [optional] * @param int $port [optional] * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2338,7 +2338,7 @@ public function slaveof($host = '127.0.0.1', $port = 6379) {} * @param string $operation This can be either GET, LEN, or RESET * @param int|null $length If executing a SLOWLOG GET command, you can pass an optional length. * - * @return mixed|Redis The return value of SLOWLOG will depend on which operation was performed or Redis if in multi mode + * @return mixed|Redis The return value of SLOWLOG will depend on which operation was performed or Redis if in multimode * - SLOWLOG GET: Array of slowLog entries, as provided by Redis * - SLOGLOG LEN: Integer, the length of the slowLog * - SLOWLOG RESET: Boolean, depending on success @@ -2374,7 +2374,7 @@ public function slowLog(string $operation, int $length = null) {} * @param string $subcommand * @param string $key * - * @return string|int|false|Redis for "encoding", int for "refcount" and "idletime", FALSE if the key doesn't exist or Redis if in multi mode + * @return string|int|false|Redis for "encoding", int for "refcount" and "idletime", FALSE if the key doesn't exist or Redis if in multimode * * @throws RedisException * @@ -2392,7 +2392,7 @@ public function object($subcommand, $key) {} /** * Performs a synchronous save. * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * If a save is already running, this command will fail and return FALSE. * * @throws RedisException @@ -2405,7 +2405,7 @@ public function save() {} /** * Performs a background save. * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * If a save is already running, this command will fail and return FALSE * * @throws RedisException @@ -2418,7 +2418,7 @@ public function bgsave() {} /** * Returns the timestamp of the last disk save. * - * @return int|Redis timestamp or Redis if in multi mode + * @return int|Redis timestamp or Redis if in multimode * * @throws RedisException * @@ -2434,7 +2434,7 @@ public function lastSave() {} * @param int $numSlaves Number of slaves that need to acknowledge previous write commands. * @param int $timeout Timeout in milliseconds. * - * @return int|Redis The command returns the number of slaves reached by all the writes performed in the or Redis if in multi mode + * @return int|Redis The command returns the number of slaves reached by all the writes performed in the or Redis if in multimode * context of the current connection * * @throws RedisException @@ -2449,7 +2449,7 @@ public function wait($numSlaves, $timeout) {} * * @param string $key * - * @return int|Redis returns Redis if in multi mode + * @return int|Redis returns Redis if in multimode * Depending on the type of the data pointed by the key, * this method will return the following value: * - string: Redis::REDIS_STRING @@ -2473,7 +2473,7 @@ public function type($key) {} * @param string $key * @param string|mixed $value * - * @return int|Redis Size of the value after the append or Redis if in multi mode + * @return int|Redis Size of the value after the append or Redis if in multimode * * @throws RedisException * @@ -2494,7 +2494,7 @@ public function append($key, $value) {} * @param int $start * @param int $end * - * @return string|Redis the substring or Redis if in multi mode + * @return string|Redis the substring or Redis if in multimode * * @throws RedisException * @@ -2527,7 +2527,7 @@ public function substr($key, $start, $end) {} * @param int $offset * @param string $value * - * @return int|Redis the length of the string after it was modified or Redis if in multi mode + * @return int|Redis the length of the string after it was modified or Redis if in multimode * * @throws RedisException * @@ -2545,7 +2545,7 @@ public function setRange($key, $offset, $value) {} * Get the length of a string value. * * @param string $key - * @return int|Redis returns Redis if in multi mode + * @return int|Redis returns Redis if in multimode * * @throws RedisException * @@ -2568,7 +2568,7 @@ public function strlen($key) {} * @param int $start * @param int $end * - * @return int|Redis The command returns the position of the first bit set to 1 or 0 according to the request or Redis if in multi mode + * @return int|Redis The command returns the position of the first bit set to 1 or 0 according to the request or Redis if in multimode * If we look for set bits (the bit argument is 1) and the string is empty or composed of just * zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string * only contains bit set to 1, the function returns the first bit not part of the string on the @@ -2601,7 +2601,7 @@ public function bitpos($key, $bit, $start = 0, $end = -1) {} * @param string $key * @param int $offset * - * @return int|Redis the bit value (0 or 1) or Redis if in multi mode + * @return int|Redis the bit value (0 or 1) or Redis if in multimode * * @throws RedisException * @@ -2622,7 +2622,7 @@ public function getBit($key, $offset) {} * @param int $offset * @param bool|int $value bool or int (1 or 0) * - * @return int|Redis 0 or 1, the value of the bit before it was set or Redis if in multi mode + * @return int|Redis 0 or 1, the value of the bit before it was set or Redis if in multimode * * @throws RedisException * @@ -2644,7 +2644,7 @@ public function setBit($key, $offset, $value) {} * @param int $start * @param int $end * - * @return int|Redis The number of bits set to 1 in the value behind the input key or Redis if in multi mode + * @return int|Redis The number of bits set to 1 in the value behind the input key or Redis if in multimode * * @throws RedisException * @@ -2668,7 +2668,7 @@ public function bitCount($key, $start = 0, $end = -1) {} * @param string $key1 first key * @param string ...$otherKeys variadic list of keys * - * @return int|Redis The size of the string stored in the destination key or Redis if in multi mode + * @return int|Redis The size of the string stored in the destination key or Redis if in multimode * * @throws RedisException * @@ -2691,7 +2691,7 @@ public function bitOp($operation, $retKey, $key1, ...$otherKeys) {} * * @param bool $async requires server version 4.0.0 or greater * - * @return bool|Redis Always TRUE or Redis if in multi mode + * @return bool|Redis Always TRUE or Redis if in multimode * @throws RedisException * @link https://redis.io/commands/flushdb * @example $redis->flushDB(); @@ -2703,7 +2703,7 @@ public function flushDB($async = null) {} * * @param bool $async requires server version 4.0.0 or greater * - * @return bool|Redis Always TRUE or Redis if in multi mode + * @return bool|Redis Always TRUE or Redis if in multimode * * @throws RedisException * @@ -2724,7 +2724,7 @@ public function flushAll($async = null) {} * - 'alpha' => TRUE, * - 'store' => 'external-key' * - * @return array|Redis returns Redis if in multi mode + * @return array|Redis returns Redis if in multimode * An array of values, or a number corresponding to the number of elements stored if that was used * * @throws RedisException @@ -2796,7 +2796,7 @@ public function sort($key, $option = null) {} * - vm_enabled * - role * - * @return array|Redis returns Redis if in multi mode + * @return array|Redis returns Redis if in multimode * * @throws RedisException * @@ -2816,7 +2816,7 @@ public function info($option = null) {} /** * Returns an indexed array whose first element is the role * - * @return array|Redis returns Redis if in multi mode + * @return array|Redis returns Redis if in multimode * * @throws RedisException * @@ -2837,7 +2837,7 @@ public function role() {} * - Number of connections received * - Number of expired keys * - * @return bool|Redis `TRUE` in case of success, `FALSE` in case of failure or Redis if in multi mode + * @return bool|Redis `TRUE` in case of success, `FALSE` in case of failure or Redis if in multimode * * @throws RedisException * @@ -2852,7 +2852,7 @@ public function resetStat() {} * * @param string $key * - * @return int|bool|Redis the time left to live in seconds or Redis if in multi mode + * @return int|bool|Redis the time left to live in seconds or Redis if in multimode * * @throws RedisException * @@ -2872,7 +2872,7 @@ public function ttl($key) {} * * @param string $key * - * @return int|bool|Redis the time left to live in milliseconds or Redis if in multi mode + * @return int|bool|Redis the time left to live in milliseconds or Redis if in multimode * * @throws RedisException * @@ -2890,7 +2890,7 @@ public function pttl($key) {} * * @param string $key * - * @return bool|Redis TRUE if a timeout was removed, FALSE if the key didn’t exist or didn’t have an expiration timer or Redis if in multi mode + * @return bool|Redis TRUE if a timeout was removed, FALSE if the key didn’t exist or didn’t have an expiration timer or Redis if in multimode * * @throws RedisException * @@ -2905,7 +2905,7 @@ public function persist($key) {} * * @param array $array Pairs: array(key => value, ...) * - * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multi mode + * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -2928,7 +2928,7 @@ public function mSet(array $array) {} * * @param array $keys Array containing the list of the keys * - * @return array|Redis Array containing the values related to keys in argument or Redis if in multi mode + * @return array|Redis Array containing the values related to keys in argument or Redis if in multimode * * @throws RedisException * @@ -2952,7 +2952,7 @@ public function getMultiple(array $keys) {} * * @param array $array * - * @return array|Redis returns Redis if in multi mode + * @return array|Redis returns Redis if in multimode * * @throws RedisException * @@ -2977,7 +2977,7 @@ public function mGet(array $array) {} /** * @see mset() * @param array $array - * @return int|Redis 1 (if the keys were set) or 0 (no key was set) or Redis if in multi mode + * @return int|Redis 1 (if the keys were set) or 0 (no key was set) or Redis if in multimode * * @throws RedisException * @@ -2994,7 +2994,7 @@ public function msetnx(array $array) {} * @param string $srcKey * @param string $dstKey * - * @return string|mixed|false|Redis The element that was moved in case of success, FALSE in case of failure or Redis if in multi mode + * @return string|mixed|false|Redis The element that was moved in case of success, FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -3039,7 +3039,7 @@ public function rPopLPush($srcKey, $dstKey) {} * @param string $dstKey * @param int $timeout * - * @return string|mixed|bool|Redis The element that was moved in case of success, FALSE in case of timeout or Redis if in multi mode + * @return string|mixed|bool|Redis The element that was moved in case of success, FALSE in case of timeout or Redis if in multimode * * @throws RedisException * @@ -3059,7 +3059,7 @@ public function bRPopLPush($srcKey, $dstKey, $timeout) {} * @param float|string|mixed $scoreN Optional score or value if options omitted * @param string|float|mixed $valueN Optional value or score if options omitted * - * @return int|Redis Number of values added or Redis if in multi mode + * @return int|Redis Number of values added or Redis if in multimode * * @throws RedisException * @@ -3106,7 +3106,7 @@ public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $v * @param int $end * @param mixed $withscores * - * @return array|Redis Array containing the values in specified range or Redis if in multi mode + * @return array|Redis Array containing the values in specified range or Redis if in multimode * * @throws RedisException * @@ -3130,7 +3130,7 @@ public function zRange($key, $start, $end, $withscores = null) {} * @param string|mixed $member1 * @param string|mixed ...$otherMembers * - * @return int|Redis Number of deleted values or Redis if in multi mode + * @return int|Redis Number of deleted values or Redis if in multimode * * @throws RedisException * @@ -3156,7 +3156,7 @@ public function zRem($key, $member1, ...$otherMembers) {} * @param string|mixed $member1 * @param string|mixed ...$otherMembers * - * @return int|Redis Number of deleted values or Redis if in multi mode + * @return int|Redis Number of deleted values or Redis if in multimode * * @throws RedisException */ @@ -3176,7 +3176,7 @@ public function zDelete($key, $member1, ...$otherMembers) {} * @param int $end * @param mixed $withscore * - * @return array|Redis Array containing the values in specified range or Redis if in multi mode + * @return array|Redis Array containing the values in specified range or Redis if in multimode * * @throws RedisException * @@ -3208,7 +3208,7 @@ public function zRevRange($key, $start, $end, $withscore = null) {} * - withscores => TRUE, * - and limit => array($offset, $count) * - * @return array|Redis Array containing the values in specified range or Redis if in multi mode + * @return array|Redis Array containing the values in specified range or Redis if in multimode * * @throws RedisException * @@ -3233,7 +3233,7 @@ public function zRangeByScore($key, $start, $end, array $options = []) {} * @param int $end * @param array $options * - * @return array|Redis returns Redis if in multi mode + * @return array|Redis returns Redis if in multimode * * @throws RedisException */ @@ -3251,7 +3251,7 @@ public function zRevRangeByScore($key, $start, $end, array $options = []) {} * @param int $offset Optional argument if you wish to start somewhere other than the first element. * @param int $limit Optional argument if you wish to limit the number of elements returned. * - * @return array|false|Redis Array containing the values in the specified range or Redis if in multi mode + * @return array|false|Redis Array containing the values in the specified range or Redis if in multimode * * @throws RedisException * @@ -3277,7 +3277,7 @@ public function zRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} * @param int $offset * @param int $limit * - * @return array|Redis returns Redis if in multi mode + * @return array|Redis returns Redis if in multimode * * @throws RedisException * @@ -3294,7 +3294,7 @@ public function zRevRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} * @param string $start * @param string $end * - * @return int|Redis the size of a corresponding zRangeByScore or Redis if in multi mode + * @return int|Redis the size of a corresponding zRangeByScore or Redis if in multimode * * @throws RedisException * @@ -3316,7 +3316,7 @@ public function zCount($key, $start, $end) {} * @param string $start double or "+inf" or "-inf" as a string * @param string $end double or "+inf" or "-inf" as a string * - * @return int|Redis The number of values deleted from the sorted set or Redis if in multi mode + * @return int|Redis The number of values deleted from the sorted set or Redis if in multimode * * @throws RedisException * @@ -3348,7 +3348,7 @@ public function zDeleteRangeByScore($key, $start, $end) {} * @param int $start * @param int $end * - * @return int|Redis The number of values deleted from the sorted set or Redis if in multi mode + * @return int|Redis The number of values deleted from the sorted set or Redis if in multimode * * @throws RedisException * @@ -3381,7 +3381,7 @@ public function zDeleteRangeByRank($key, $start, $end) {} * * @param string $key * - * @return int|Redis the set's cardinality or Redis if in multi mode + * @return int|Redis the set's cardinality or Redis if in multimode * * @throws RedisException * @@ -3398,7 +3398,7 @@ public function zCard($key) {} /** * @param string $key - * @return int|Redis returns Redis if in multi mode + * @return int|Redis returns Redis if in multimode * * @throws RedisException */ @@ -3411,7 +3411,7 @@ public function zSize($key) {} * @param string $key * @param string|mixed $member * - * @return float|bool|Redis false if member or key not exists or Redis if in multi mode + * @return float|bool|Redis false if member or key not exists or Redis if in multimode * * @throws RedisException * @@ -3431,7 +3431,7 @@ public function zScore($key, $member) {} * @param string $key * @param string|mixed $member * - * @return int|false|Redis the item's score, or false if key or member is not exists or Redis if in multi mode + * @return int|false|Redis the item's score, or false if key or member is not exists or Redis if in multimode * * @throws RedisException * @@ -3454,7 +3454,7 @@ public function zRank($key, $member) {} * @param string $key * @param string|mixed $member * - * @return int|false|Redis the item's score, false - if key or member is not exists or Redis if in multi mode + * @return int|false|Redis the item's score, false - if key or member is not exists or Redis if in multimode * * @throws RedisException * @@ -3469,7 +3469,7 @@ public function zRevRank($key, $member) {} * @param float $value (double) value that will be added to the member's score * @param string|mixed $member * - * @return float|Redis the new value or Redis if in multi mode + * @return float|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -3498,7 +3498,7 @@ public function zIncrBy($key, $value, $member) {} * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": defines the behaviour to use on * duplicate entries during the zUnionStore * - * @return int|Redis The number of values in the new sorted set or Redis if in multi mode + * @return int|Redis The number of values in the new sorted set or Redis if in multimode * * @throws RedisException * @@ -3552,7 +3552,7 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": * defines the behaviour to use on duplicate entries during the zInterStore. * - * @return int|Redis The number of values in the new sorted set or Redis if in multi mode + * @return int|Redis The number of values in the new sorted set or Redis if in multimode * * @throws RedisException * @@ -3603,7 +3603,7 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * @param string $pattern String (optional), the pattern to match. * @param int $count How many keys to return per iteration (Redis might return a different number). * - * @return array|false|Redis PHPRedis will return matching keys from Redis, or FALSE when iteration is complete or Redis if in multi mode + * @return array|false|Redis PHPRedis will return matching keys from Redis, or FALSE when iteration is complete or Redis if in multimode * * @throws RedisException * @@ -3628,7 +3628,7 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * @param string|int|array $timeout_or_key ... * @param mixed ...$extra_args * - * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multi mode + * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode * if the timeout was reached without an element to pop. * * @throws RedisException @@ -3653,7 +3653,7 @@ public function bzPopMax($key, $timeout_or_key, ...$extra_args) {} * @param string|int|array $timeout_or_key ... * @param mixed ...$extra_args * - * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multi mode + * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode * if the timeout was reached without an element to pop. * * @throws RedisException @@ -3670,7 +3670,7 @@ public function bzPopMin($key, $timeout_or_key, ...$extra_args) {} * @param string $key * @param int $count * - * @return array|Redis Either an array with the key member and score of the highest element or an empty array or Redis if in multi mode + * @return array|Redis Either an array with the key member and score of the highest element or an empty array or Redis if in multimode * if there is no element to pop. * * @throws RedisException @@ -3693,7 +3693,7 @@ public function zPopMax($key, $count = null) {} * @param string $key * @param int $count * - * @return array|Redis Either an array with the key member and score of the lowest element or an empty array or Redis if in multi mode + * @return array|Redis Either an array with the key member and score of the lowest element or an empty array or Redis if in multimode * if there is no element to pop. * * @throws RedisException @@ -3717,7 +3717,7 @@ public function zPopMin($key, $count = null) {} * @param string $hashKey * @param string $value * - * @return int|bool|Redis returns Redis if in multi mode + * @return int|bool|Redis returns Redis if in multimode * - 1 if value didn't exist and was added successfully, * - 0 if the value was already present and was replaced, FALSE if there was an error. * @@ -3743,7 +3743,7 @@ public function hSet($key, $hashKey, $value) {} * @param string $hashKey * @param string $value * - * @return bool|Redis TRUE if the field was set, FALSE if it was already present or Redis if in multi mode + * @return bool|Redis TRUE if the field was set, FALSE if it was already present or Redis if in multimode * * @throws RedisException * @@ -3765,7 +3765,7 @@ public function hSetNx($key, $hashKey, $value) {} * @param string $key * @param string $hashKey * - * @return string|false|Redis The value, if the command executed successfully BOOL FALSE in case of failure or Redis if in multi mode + * @return string|false|Redis The value, if the command executed successfully BOOL FALSE in case of failure or Redis if in multimode * * @throws RedisException * @@ -3778,7 +3778,7 @@ public function hGet($key, $hashKey) {} * * @param string $key * - * @return int|false|Redis the number of items in a hash, FALSE if the key doesn't exist or isn't a hash or Redis if in multi mode + * @return int|false|Redis the number of items in a hash, FALSE if the key doesn't exist or isn't a hash or Redis if in multimode * * @throws RedisException * @@ -3801,7 +3801,7 @@ public function hLen($key) {} * @param string $hashKey1 * @param string ...$otherHashKeys * - * @return int|bool|Redis Number of deleted fields or Redis if in multi mode + * @return int|bool|Redis Number of deleted fields or Redis if in multimode * * @throws RedisException * @@ -3833,7 +3833,7 @@ public function hDel($key, $hashKey1, ...$otherHashKeys) {} * * @param string $key * - * @return array|Redis An array of elements, the keys of the hash. This works like PHP's array_keys() or Redis if in multi mode + * @return array|Redis An array of elements, the keys of the hash. This works like PHP's array_keys() or Redis if in multimode * * @throws RedisException * @@ -3868,7 +3868,7 @@ public function hKeys($key) {} * * @param string $key * - * @return array|Redis An array of elements, the values of the hash. This works like PHP's array_values() or Redis if in multi mode + * @return array|Redis An array of elements, the values of the hash. This works like PHP's array_values() or Redis if in multimode * * @throws RedisException * @@ -3903,7 +3903,7 @@ public function hVals($key) {} * * @param string $key * - * @return array|Redis An array of elements, the contents of the hash or Redis if in multi mode + * @return array|Redis An array of elements, the contents of the hash or Redis if in multimode * * @throws RedisException * @@ -3939,7 +3939,7 @@ public function hGetAll($key) {} * @param string $key * @param string $hashKey * - * @return bool|Redis If the member exists in the hash table, return TRUE, otherwise return FALSE or Redis if in multi mode + * @return bool|Redis If the member exists in the hash table, return TRUE, otherwise return FALSE or Redis if in multimode * * @throws RedisException * @@ -3960,7 +3960,7 @@ public function hExists($key, $hashKey) {} * @param string $hashKey * @param int $value (integer) value that will be added to the member's value * - * @return int|Redis the new value or Redis if in multi mode + * @return int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -3981,7 +3981,7 @@ public function hIncrBy($key, $hashKey, $value) {} * @param string $field * @param float $increment * - * @return float|Redis returns Redis if in multi mode + * @return float|Redis returns Redis if in multimode * * @throws RedisException * @@ -4014,7 +4014,7 @@ public function hIncrByFloat($key, $field, $increment) {} * @param string $key * @param array $hashKeys key → value array * - * @return bool|Redis returns Redis if in multi mode + * @return bool|Redis returns Redis if in multimode * * @throws RedisException * @@ -4034,7 +4034,7 @@ public function hMSet($key, $hashKeys) {} * @param string $key * @param array $hashKeys * - * @return array|Redis Array An array of elements, the values of the specified fields in the hash, or Redis if in multi mode + * @return array|Redis Array An array of elements, the values of the specified fields in the hash, or Redis if in multimode * with the hash keys as array keys. * * @throws RedisException @@ -4058,7 +4058,7 @@ public function hMGet($key, $hashKeys) {} * @param string $pattern Optional pattern to match against. * @param int $count How many keys to return in a go (only a sugestion to Redis). * - * @return array|bool|Redis An array of members that match our pattern or Redis if in multi mode + * @return array|bool|Redis An array of members that match our pattern or Redis if in multimode * * @throws RedisException * @@ -4081,7 +4081,7 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) {} * @param string $key * @param string $field * - * @return int|Redis the string length of the value associated with field, or zero when field is not present in the hash or Redis if in multi mode + * @return int|Redis the string length of the value associated with field, or zero when field is not present in the hash or Redis if in multimode * or key does not exist at all. * * @throws RedisException @@ -4101,7 +4101,7 @@ public function hStrLen(string $key, string $field) {} * @param string $member * @param mixed ...$other_triples * - * @return int|Redis The number of elements added to the geospatial key or Redis if in multi mode + * @return int|Redis The number of elements added to the geospatial key or Redis if in multimode * * @throws RedisException * @@ -4128,7 +4128,7 @@ public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) * @param string $key * @param string ...$member variadic list of members * - * @return array|Redis One or more Redis Geohash encoded strings or Redis if in multi mode + * @return array|Redis One or more Redis Geohash encoded strings or Redis if in multimode * * @throws RedisException * @@ -4155,7 +4155,7 @@ public function geoHash($key, ...$member) {} * * @param string $key * @param string ...$member - * @return array|Redis One or more longitude/latitude positions or Redis if in multi mode + * @return array|Redis One or more longitude/latitude positions or Redis if in multimode * * @throws RedisException * @@ -4197,7 +4197,7 @@ public function geoPos(string $key, string ...$member) {} * @param string $member2 * @param string|null $unit * - * @return float|Redis The distance between the two passed members in the units requested (meters by default) or Redis if in multi mode + * @return float|Redis The distance between the two passed members in the units requested (meters by default) or Redis if in multimode * * @throws RedisException * @@ -4261,7 +4261,7 @@ public function geoDist($key, $member1, $member2, $unit = null) {} * the last one passed will be used. * Note: When using STORE[DIST] in Redis Cluster, the store key must has to the same slot as * the query key or you will get a CROSSLOT error. - * @return mixed|Redis When no STORE option is passed, this function returns an array of results or Redis if in multi mode + * @return mixed|Redis When no STORE option is passed, this function returns an array of results or Redis if in multimode * If it is passed this function returns the number of stored entries. * * @throws RedisException @@ -4348,7 +4348,7 @@ public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $op * @param $units * @param array|null $options see georadius * - * @return array|Redis The zero or more entries that are close enough to the member given the distance and radius specified or Redis if in multi mode + * @return array|Redis The zero or more entries that are close enough to the member given the distance and radius specified or Redis if in multimode * * @throws RedisException * @@ -4387,7 +4387,7 @@ public function geoRadiusByMember($key, $member, $radius, $units, array $options * @param string $key for `SET`, glob-pattern for `GET` * @param string|mixed $value optional string (only for `SET`) * - * @return array|Redis Associative array for `GET`, key -> value or Redis if in multi mode + * @return array|Redis Associative array for `GET`, key -> value or Redis if in multimode * * @throws RedisException * @@ -4407,7 +4407,7 @@ public function config($operation, $key, $value = null) {} * @param array $args * @param int $numKeys * - * @return mixed|Redis What is returned depends on what the LUA script itself returns, which could be a scalar value or Redis if in multi mode + * @return mixed|Redis What is returned depends on what the LUA script itself returns, which could be a scalar value or Redis if in multimode * (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in * your LUA script. If there is an error executing the LUA script, the getLastError() function can tell you the * message that came back from Redis (e.g. compile error). @@ -4433,7 +4433,7 @@ public function eval($script, $args = [], $numKeys = 0) {} * @param string $script * @param array $args * @param int $numKeys - * @return mixed|Redis @see eval() , returns Redis if in multi mode + * @return mixed|Redis @see eval() , returns Redis if in multimode * * @throws RedisException */ @@ -4449,7 +4449,7 @@ public function evaluate($script, $args = [], $numKeys = 0) {} * @param array $args * @param int $numKeys * - * @return mixed|Redis @see eval() , returns Redis if in multi mode + * @return mixed|Redis @see eval() , returns Redis if in multimode * * @throws RedisException * @@ -4479,7 +4479,7 @@ public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {} * @param string $command load | flush | kill | exists * @param mixed ...$script * - * @return mixed|Redis returns Redis if in multi mode + * @return mixed|Redis returns Redis if in multimode * * @throws RedisException * @@ -4719,7 +4719,7 @@ public function time() {} * @param string $pattern Pattern to match. * @param int $count Count of keys per iteration (only a suggestion to Redis). * - * @return array|false|Redis This function will return an array of keys or FALSE if there are no more keys or Redis if in multi mode + * @return array|false|Redis This function will return an array of keys or FALSE if there are no more keys or Redis if in multimode * * @throws RedisException * @@ -4742,7 +4742,7 @@ public function scan(&$iterator, $pattern = null, $count = 0) {} * @param string $key * @param array $elements * - * @return bool|Redis returns Redis if in multi mode + * @return bool|Redis returns Redis if in multimode * * @throws RedisException * @@ -4757,7 +4757,7 @@ public function pfAdd($key, array $elements) {} * * @param string|array $key * - * @return int|Redis returns Redis if in multi mode + * @return int|Redis returns Redis if in multimode * * @throws RedisException * @@ -4779,7 +4779,7 @@ public function pfCount($key) {} * @param string $destKey * @param array $sourceKeys * - * @return bool|Redis returns Redis if in multi mode + * @return bool|Redis returns Redis if in multimode * * @throws RedisException * @@ -4800,7 +4800,7 @@ public function pfMerge($destKey, array $sourceKeys) {} * @param string $command Required command to send to the server. * @param mixed ...$arguments Optional variable amount of arguments to send to the server. * - * @return mixed|Redis returns Redis if in multi mode + * @return mixed|Redis returns Redis if in multimode * * @throws RedisException * @@ -4815,7 +4815,7 @@ public function rawCommand($command, ...$arguments) {} /** * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. * - * @return int|Redis Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE or Redis if in multi mode + * @return int|Redis Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE or Redis if in multimode * * @throws RedisException * @@ -4830,7 +4830,7 @@ public function getMode() {} * @param string $group * @param array $messages * - * @return int|Redis The number of messages Redis reports as acknowledged or Redis if in multi mode + * @return int|Redis The number of messages Redis reports as acknowledged or Redis if in multimode * * @throws RedisException * @@ -4852,7 +4852,7 @@ public function xAck($stream, $group, $messages) {} * @param bool $isApproximate * @param bool $nomkstream * - * @return string|Redis The added message ID or Redis if in multi mode + * @return string|Redis The added message ID or Redis if in multimode * * @throws RedisException * @@ -4876,7 +4876,7 @@ public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, * @param array $ids * @param array $options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID'] * - * @return array|Redis Either an array of message IDs along with corresponding data, or just an array of IDs or Redis if in multi mode + * @return array|Redis Either an array of message IDs along with corresponding data, or just an array of IDs or Redis if in multimode * (if the 'JUSTID' option was passed). * * @throws RedisException @@ -4909,7 +4909,7 @@ public function xClaim($key, $group, $consumer, $minIdleTime, $ids, $options = [ * @param string $key * @param array $ids * - * @return int|Redis The number of messages removed or Redis if in multi mode + * @return int|Redis The number of messages removed or Redis if in multimode * * @throws RedisException * @@ -4928,7 +4928,7 @@ public function xDel($key, $ids) {} * @param string $msgId * @param bool $mkStream * - * @return mixed|Redis This command returns different types depending on the specific XGROUP command executed or Redis if in multi mode + * @return mixed|Redis This command returns different types depending on the specific XGROUP command executed or Redis if in multimode * * @throws RedisException * @@ -4949,7 +4949,7 @@ public function xGroup($operation, $key = null, $group = null, $msgId = null, $m * @param string $stream * @param string $group * - * @return mixed|Redis This command returns different types depending on which subcommand is used or Redis if in multi mode + * @return mixed|Redis This command returns different types depending on which subcommand is used or Redis if in multimode * * @throws RedisException * @@ -4966,7 +4966,7 @@ public function xInfo($operation, $stream = null, $group = null) {} * * @param string $stream * - * @return int|Redis The number of messages in the stream or Redis if in multi mode + * @return int|Redis The number of messages in the stream or Redis if in multimode * * @throws RedisException * @@ -4988,7 +4988,7 @@ public function xLen($stream) {} * @param int $count * @param string $consumer * - * @return array|string|Redis Information about the pending messages, in various forms depending on or Redis if in multi mode + * @return array|string|Redis Information about the pending messages, in various forms depending on or Redis if in multimode * the specific invocation of XPENDING. * * @throws RedisException @@ -5010,7 +5010,7 @@ public function xPending($stream, $group, $start = null, $end = null, $count = - * @param string $end * @param int $count * - * @return array|bool|Redis The messages in the stream within the requested range or Redis if in multi mode + * @return array|bool|Redis The messages in the stream within the requested range or Redis if in multimode * * @throws RedisException * @@ -5032,7 +5032,7 @@ public function xRange($stream, $start, $end, $count = -1) {} * @param int|string $count * @param int|string $block * - * @return array|bool|Redis The messages in the stream newer than the IDs passed to Redis (if any) or Redis if in multi mode + * @return array|bool|Redis The messages in the stream newer than the IDs passed to Redis (if any) or Redis if in multimode * * @throws RedisException * @@ -5053,7 +5053,7 @@ public function xRead($streams, $count = -1, $block = -1) {} * @param int|null $count * @param int|null $block * - * @return array|Redis The messages delivered to this consumer group (if any) or Redis if in multi mode + * @return array|Redis The messages delivered to this consumer group (if any) or Redis if in multimode * * @throws RedisException * @@ -5077,7 +5077,7 @@ public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) * @param string $start * @param int $count * - * @return array|bool|Redis The messages in the range specified or Redis if in multi mode + * @return array|bool|Redis The messages in the range specified or Redis if in multimode * * @throws RedisException * @@ -5098,7 +5098,7 @@ public function xRevRange($stream, $end, $start, $count = -1) {} * @param int $maxLen * @param bool $isApproximate * - * @return int|Redis The number of messages trimed from the stream or Redis if in multi mode + * @return int|Redis The number of messages trimed from the stream or Redis if in multimode * * @throws RedisException * @@ -5119,7 +5119,7 @@ public function xTrim($stream, $maxLen, $isApproximate) {} * @param string $key Required key * @param array $values Required values * - * @return int|bool|Redis The number of elements added to the set or Redis if in multi mode + * @return int|bool|Redis The number of elements added to the set or Redis if in multimode * If this value is already in the set, FALSE is returned * * @throws RedisException From 4c31d9ef905f02299a5ca6675c2154bf455958c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?= Date: Mon, 5 Sep 2022 19:13:19 +0200 Subject: [PATCH 168/419] Typo in SplFileObject::getChildren() --- SPL/SPL_c1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index efe5694b3..055785216 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -999,7 +999,7 @@ public function hasChildren() {} * @return null|RecursiveIterator An SplFileObject does not have children so this method returns NULL. */ #[TentativeType] - #[LanguageLevelTypeAware(['8.2' => 'null|null'], default: 'null|RecursiveIterator')] + #[LanguageLevelTypeAware(['8.2' => 'null'], default: 'null|RecursiveIterator')] public function getChildren() {} /** From 2aadcd5199a3c07e28e623a41f0a0eb316cb9fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?= Date: Tue, 6 Sep 2022 13:22:00 +0200 Subject: [PATCH 169/419] PHP 8.2: Added SplFixedArray::__serialize() and SplFixedArray::__unserialize() --- SPL/SPL_c1.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 055785216..ff5638bc5 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -1950,6 +1950,15 @@ public function valid(): bool {} #[TentativeType] public function __wakeup(): void {} + #[PhpStormStubsElementAvailable(from: '8.2')] + public function __serialize(): array {} + + /** + * @param array $data + */ + #[PhpStormStubsElementAvailable(from: '8.2')] + public function __unserialize(array $data): void {} + /** * @return Traversable */ From 80e7ea6998a7e7139b0ae2bbe86d6f62cd9f8f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?= Date: Tue, 6 Sep 2022 16:31:28 +0200 Subject: [PATCH 170/419] PHP 8.2: Added missing constants in "standard" --- PhpStormStubsMap.php | 19 +++++++++ standard/standard_defines.php | 79 +++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 0fc648230..d9e8f8347 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -7095,6 +7095,7 @@ final class PhpStormStubsMap 'CURL_VERSION_UNIX_SOCKETS' => 'curl/curl_d.php', 'CURL_VERSION_ZSTD' => 'curl/curl_d.php', 'CURL_WRITEFUNC_PAUSE' => 'curl/curl_d.php', + 'CURRENCY_SYMBOL' => 'standard/standard_defines.php', 'CYAN' => 'winbinder/winbinder.php', 'Calendar' => 'winbinder/winbinder.php', 'CheckBox' => 'winbinder/winbinder.php', @@ -7151,6 +7152,7 @@ final class PhpStormStubsMap 'DBA_LMDB_USE_SUB_DIR' => 'dba/dba.php', 'DEBUG_BACKTRACE_IGNORE_ARGS' => 'Core/Core_d.php', 'DEBUG_BACKTRACE_PROVIDE_OBJECT' => 'Core/Core_d.php', + 'DECIMAL_POINT' => 'standard/standard_defines.php', 'DEFAULT_INCLUDE_PATH' => 'Core/Core_d.php', 'DIRECTORY_SEPARATOR' => 'standard/standard_defines.php', 'DISP_E_DIVBYZERO' => 'com_dotnet/com_dotnet.php', @@ -7265,6 +7267,7 @@ final class PhpStormStubsMap 'ERA_D_FMT' => 'standard/standard_defines.php', 'ERA_D_T_FMT' => 'standard/standard_defines.php', 'ERA_T_FMT' => 'standard/standard_defines.php', + 'ERA_YEAR' => 'standard/standard_defines.php', 'EVBUFFER_EOF' => 'libevent/libevent.php', 'EVBUFFER_ERROR' => 'libevent/libevent.php', 'EVBUFFER_READ' => 'libevent/libevent.php', @@ -7445,6 +7448,7 @@ final class PhpStormStubsMap 'FPE_FLTUND' => 'pcntl/pcntl.php', 'FPE_INTDIV' => 'pcntl/pcntl.php', 'FPE_INTOVF' => 'pcntl/pcntl.php', + 'FRAC_DIGITS' => 'standard/standard_defines.php', 'FTA_BOLD' => 'winbinder/winbinder.php', 'FTA_ITALIC' => 'winbinder/winbinder.php', 'FTA_NORMAL' => 'winbinder/winbinder.php', @@ -7740,6 +7744,7 @@ final class PhpStormStubsMap 'GRAPHEME_EXTR_MAXBYTES' => 'intl/intl.php', 'GRAPHEME_EXTR_MAXCHARS' => 'intl/intl.php', 'GREEN' => 'winbinder/winbinder.php', + 'GROUPING' => 'standard/standard_defines.php', 'Gauge' => 'winbinder/winbinder.php', 'Grpc\\CALL_ERROR' => 'grpc/grpc.php', 'Grpc\\CALL_ERROR_ALREADY_ACCEPTED' => 'grpc/grpc.php', @@ -8148,6 +8153,8 @@ final class PhpStormStubsMap 'INTL_IDNA_VARIANT_2003' => 'intl/intl.php', 'INTL_IDNA_VARIANT_UTS46' => 'intl/intl.php', 'INTL_MAX_LOCALE_LEN' => 'intl/intl.php', + 'INT_CURR_SYMBOL' => 'standard/standard_defines.php', + 'INT_FRAC_DIGITS' => 'standard/standard_defines.php', 'IN_ACCESS' => 'inotify/inotify.php', 'IN_ALL_EVENTS' => 'inotify/inotify.php', 'IN_ATTRIB' => 'inotify/inotify.php', @@ -8557,6 +8564,9 @@ final class PhpStormStubsMap 'MON_7' => 'standard/standard_defines.php', 'MON_8' => 'standard/standard_defines.php', 'MON_9' => 'standard/standard_defines.php', + 'MON_DECIMAL_POINT' => 'standard/standard_defines.php', + 'MON_GROUPING' => 'standard/standard_defines.php', + 'MON_THOUSANDS_SEP' => 'standard/standard_defines.php', 'MQSERIES_MQACT_NONE' => 'mqseries/mqseries.php', 'MQSERIES_MQAT_AIX' => 'mqseries/mqseries.php', 'MQSERIES_MQAT_BATCH' => 'mqseries/mqseries.php', @@ -10366,6 +10376,7 @@ final class PhpStormStubsMap 'NCURSES_KEY_UNDO' => 'ncurses/ncurses.php', 'NCURSES_KEY_UP' => 'ncurses/ncurses.php', 'NCURSES_REPORT_MOUSE_POSITION' => 'ncurses/ncurses.php', + 'NEGATIVE_SIGN' => 'standard/standard_defines.php', 'NIL' => 'imap/imap.php', 'NOCOLOR' => 'winbinder/winbinder.php', 'NOEXPR' => 'standard/standard_defines.php', @@ -10376,6 +10387,9 @@ final class PhpStormStubsMap 'NORM_IGNORESYMBOLS' => 'com_dotnet/com_dotnet.php', 'NORM_IGNOREWIDTH' => 'com_dotnet/com_dotnet.php', 'NOSTR' => 'standard/standard_defines.php', + 'N_CS_PRECEDES' => 'standard/standard_defines.php', + 'N_SEP_BY_SPACE' => 'standard/standard_defines.php', + 'N_SIGN_POSN' => 'standard/standard_defines.php', 'NakedWindow' => 'winbinder/winbinder.php', 'OAUTH_AUTH_TYPE_AUTHORIZATION' => 'oauth/oauth.php', 'OAUTH_AUTH_TYPE_FORM' => 'oauth/oauth.php', @@ -10728,6 +10742,7 @@ final class PhpStormStubsMap 'POLL_MSG' => 'pcntl/pcntl.php', 'POLL_OUT' => 'pcntl/pcntl.php', 'POLL_PRI' => 'pcntl/pcntl.php', + 'POSITIVE_SIGN' => 'standard/standard_defines.php', 'POSIX_F_OK' => 'posix/posix.php', 'POSIX_RLIMIT_AS' => 'posix/posix.php', 'POSIX_RLIMIT_CORE' => 'posix/posix.php', @@ -10791,6 +10806,9 @@ final class PhpStormStubsMap 'PTHREADS_INHERIT_INCLUDES' => 'pthreads/pthreads.php', 'PTHREADS_INHERIT_INI' => 'pthreads/pthreads.php', 'PTHREADS_INHERIT_NONE' => 'pthreads/pthreads.php', + 'P_CS_PRECEDES' => 'standard/standard_defines.php', + 'P_SEP_BY_SPACE' => 'standard/standard_defines.php', + 'P_SIGN_POSN' => 'standard/standard_defines.php', 'PopupWindow' => 'winbinder/winbinder.php', 'PushButton' => 'winbinder/winbinder.php', 'RADIUS_ACCESS_ACCEPT' => 'radius/radius.php', @@ -12725,6 +12743,7 @@ final class PhpStormStubsMap 'TCP_KEEPINTVL' => 'sockets/sockets.php', 'TCP_NODELAY' => 'sockets/sockets.php', 'TCP_NOTSENT_LOWAT' => 'sockets/sockets.php', + 'THOUSANDS_SEP' => 'standard/standard_defines.php', 'THOUSEP' => 'standard/standard_defines.php', 'TIDY_NODETYPE_ASP' => 'tidy/tidy.php', 'TIDY_NODETYPE_CDATA' => 'tidy/tidy.php', diff --git a/standard/standard_defines.php b/standard/standard_defines.php index e7b9a1e38..ed759df0e 100644 --- a/standard/standard_defines.php +++ b/standard/standard_defines.php @@ -1425,3 +1425,82 @@ * @link https://php.net/manual/en/network.constants.php */ define('LOG_PERROR', 32); + +/** + * @since 8.2 + */ +define('DECIMAL_POINT', 65536); +/** + * @since 8.2 + */ +define('THOUSANDS_SEP', 65537); +/** + * @since 8.2 + */ +define('GROUPING', 65538); + +/** + * @since 8.2 + */ +define('ERA_YEAR', 131117); + +/** + * @since 8.2 + */ +define('INT_CURR_SYMBOL', 262144); +/** + * @since 8.2 + */ +define('CURRENCY_SYMBOL', 262145); +/** + * @since 8.2 + */ +define('MON_DECIMAL_POINT', 262146); +/** + * @since 8.2 + */ +define('MON_THOUSANDS_SEP', 262147); +/** + * @since 8.2 + */ +define('MON_GROUPING', 262148); +/** + * @since 8.2 + */ +define('POSITIVE_SIGN', 262149); +/** + * @since 8.2 + */ +define('NEGATIVE_SIGN', 262150); +/** + * @since 8.2 + */ +define('INT_FRAC_DIGITS', 262151); +/** + * @since 8.2 + */ +define('FRAC_DIGITS', 262152); +/** + * @since 8.2 + */ +define('P_CS_PRECEDES', 262153); +/** + * @since 8.2 + */ +define('P_SEP_BY_SPACE', 262154); +/** + * @since 8.2 + */ +define('N_CS_PRECEDES', 262155); +/** + * @since 8.2 + */ +define('N_SEP_BY_SPACE', 262156); +/** + * @since 8.2 + */ +define('P_SIGN_POSN', 262157); +/** + * @since 8.2 + */ +define('N_SIGN_POSN', 262158); From 1ef9ac4617526c0b5392d93d7fda1a26dffcd5a3 Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Wed, 7 Sep 2022 11:30:00 +0200 Subject: [PATCH 171/419] initial 8.2.0RC1 commit --- tests/DockerImages/8.2/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DockerImages/8.2/Dockerfile b/tests/DockerImages/8.2/Dockerfile index 157e5b059..03792e9a3 100644 --- a/tests/DockerImages/8.2/Dockerfile +++ b/tests/DockerImages/8.2/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.0beta3-alpine +FROM php:8.2.0RC1-alpine RUN set -eux; \ apk add --no-cache --virtual .build-deps \ From 37dd64dd3cec7b957dbfab754752f310b13ced84 Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Wed, 7 Sep 2022 12:24:31 +0200 Subject: [PATCH 172/419] added 2 new functions --- PhpStormStubsMap.php | 2 ++ libxml/libxml.php | 11 +++++++++++ openssl/openssl.php | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index d9e8f8347..9934c868e 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -3596,6 +3596,7 @@ final class PhpStormStubsMap 'libxml_clear_errors' => 'libxml/libxml.php', 'libxml_disable_entity_loader' => 'libxml/libxml.php', 'libxml_get_errors' => 'libxml/libxml.php', + 'libxml_get_external_entity_loader' => 'libxml/libxml.php', 'libxml_get_last_error' => 'libxml/libxml.php', 'libxml_set_external_entity_loader' => 'libxml/libxml.php', 'libxml_set_streams_context' => 'libxml/libxml.php', @@ -4465,6 +4466,7 @@ final class PhpStormStubsMap 'opendir' => 'standard/standard_7.php', 'openlog' => 'standard/standard_7.php', 'openssl_cipher_iv_length' => 'openssl/openssl.php', + 'openssl_cipher_key_length' => 'openssl/openssl.php', 'openssl_cms_decrypt' => 'openssl/openssl.php', 'openssl_cms_encrypt' => 'openssl/openssl.php', 'openssl_cms_read' => 'openssl/openssl.php', diff --git a/libxml/libxml.php b/libxml/libxml.php index 3f1ed641f..16b6694d5 100644 --- a/libxml/libxml.php +++ b/libxml/libxml.php @@ -146,6 +146,17 @@ function libxml_disable_entity_loader(bool $disable = true): bool {} */ function libxml_set_external_entity_loader(?callable $resolver_function): bool {} +/** + * Returns the currently installed external entity loader, i.e. the value which was passed to + * libxml_set_external_entity_loader() or null if no loader was installed and the default entity loader will be used. + * This allows libraries to save and restore the loader, controlling entity expansion without interfering with the rest + * of the application. + * + * @return callable|null + * @since 8.2 + */ +function libxml_get_external_entity_loader(): ?callable {} + /** * libxml version like 20605 or 20617 * @link https://php.net/manual/en/libxml.constants.php diff --git a/openssl/openssl.php b/openssl/openssl.php index fec92102f..7669ec148 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -757,6 +757,15 @@ function openssl_decrypt( */ function openssl_cipher_iv_length(string $cipher_algo): int|false {} +/** + * This function works in exactly the same way as openssl_cipher_iv_length but for a key length. This is especially + * useful to make sure that the right key length is provided to openssl_encrypt and openssl_decrypt. + * @param string $cipher_algo + * @return int|false + * @since 8.2 + */ +function openssl_cipher_key_length(string $cipher_algo): int|false {} + /** * Generate signature * @link https://php.net/manual/en/function.openssl-sign.php From abb980b0da9ad73ff89788925308a7902f0ada20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fedor?= Date: Tue, 16 Aug 2022 02:39:39 +0200 Subject: [PATCH 173/419] Add missing allocate, capacity, pop for DS\PriorityQueue --- ds/ds.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ds/ds.php b/ds/ds.php index fb48d456e..7c5220aa7 100644 --- a/ds/ds.php +++ b/ds/ds.php @@ -2432,6 +2432,22 @@ class PriorityQueue implements Collection */ public function count(): int {} + /** + * Allocates enough memory for a required capacity + * @link https://www.php.net/manual/en/ds-priorityqueue.allocate.php + * + * @param int $capacity + */ + public function allocate(int $capacity): void {} + + /** + * Returns the current capacity + * @link https://www.php.net/manual/en/ds-priorityqueue.capacity.php + * + * @return int + */ + public function capacity(): int {} + /** * Removes all values from the collection. * @link https://www.php.net/manual/en/ds-collection.clear.php @@ -2463,6 +2479,15 @@ public function isEmpty(): bool {} */ public function peek() {} + /** + * Removes and returns the value with the highest priority + * @link https://www.php.net/manual/en/ds-priorityqueue.pop.php + * + * @return mixed The removed value which was at the front of the queue. + * @throws UnderflowException if empty. + */ + public function pop() {} + /** * Pushes a value with a given priority into the queue. * From 69c577c546a0acfad82357186b4f563d69ffe231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fedor?= Date: Thu, 8 Sep 2022 23:53:52 +0200 Subject: [PATCH 174/419] Fix code style issues --- ds/ds.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ds/ds.php b/ds/ds.php index 7c5220aa7..8272ef5ad 100644 --- a/ds/ds.php +++ b/ds/ds.php @@ -2439,7 +2439,7 @@ public function count(): int {} * @param int $capacity */ public function allocate(int $capacity): void {} - + /** * Returns the current capacity * @link https://www.php.net/manual/en/ds-priorityqueue.capacity.php @@ -2447,7 +2447,7 @@ public function allocate(int $capacity): void {} * @return int */ public function capacity(): int {} - + /** * Removes all values from the collection. * @link https://www.php.net/manual/en/ds-collection.clear.php @@ -2487,7 +2487,7 @@ public function peek() {} * @throws UnderflowException if empty. */ public function pop() {} - + /** * Pushes a value with a given priority into the queue. * From 68bc31a3a926f998272170875171a07b3a2639e0 Mon Sep 17 00:00:00 2001 From: i582 <51853996+i582@users.noreply.github.com> Date: Fri, 9 Sep 2022 20:17:04 +0300 Subject: [PATCH 175/419] added template annotations for WeakReference --- Core/Core_c.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index bc68191fe..ca4374abf 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -711,6 +711,7 @@ public function count(): int; * Weak references allow the programmer to retain a reference to an * object which does not prevent the object from being destroyed. * They are useful for implementing cache like structures. + * @template T * @link https://www.php.net/manual/en/class.weakreference.php * @since 7.4 */ @@ -726,7 +727,9 @@ public function __construct() {} /** * Create a new weak reference. * @link https://www.php.net/manual/en/weakreference.create.php - * @return WeakReference the freshly instantiated object. + * @template TIn + * @param TIn $object + * @return WeakReference the freshly instantiated object. * @since 7.4 */ public static function create(object $object): WeakReference {} @@ -735,7 +738,7 @@ public static function create(object $object): WeakReference {} * Gets a weakly referenced object. If the object has already been * destroyed, NULL is returned. * @link https://www.php.net/manual/en/weakreference.get.php - * @return object|null + * @return T|null * @since 7.4 */ public function get(): ?object {} From a0201096bfc8745d4f0e67d6229dbcb5b0b84f1a Mon Sep 17 00:00:00 2001 From: i582 <51853996+i582@users.noreply.github.com> Date: Fri, 9 Sep 2022 20:24:02 +0300 Subject: [PATCH 176/419] added "of object" for @template --- Core/Core_c.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index ca4374abf..e353ec870 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -711,7 +711,7 @@ public function count(): int; * Weak references allow the programmer to retain a reference to an * object which does not prevent the object from being destroyed. * They are useful for implementing cache like structures. - * @template T + * @template T of object * @link https://www.php.net/manual/en/class.weakreference.php * @since 7.4 */ @@ -727,7 +727,7 @@ public function __construct() {} /** * Create a new weak reference. * @link https://www.php.net/manual/en/weakreference.create.php - * @template TIn + * @template TIn of object * @param TIn $object * @return WeakReference the freshly instantiated object. * @since 7.4 From fbfe73bcec08770db9e0214c2c59325decd209d0 Mon Sep 17 00:00:00 2001 From: i582 <51853996+i582@users.noreply.github.com> Date: Fri, 9 Sep 2022 20:26:38 +0300 Subject: [PATCH 177/419] added comment for $object --- Core/Core_c.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index e353ec870..72b919770 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -728,7 +728,7 @@ public function __construct() {} * Create a new weak reference. * @link https://www.php.net/manual/en/weakreference.create.php * @template TIn of object - * @param TIn $object + * @param TIn $object Any object * @return WeakReference the freshly instantiated object. * @since 7.4 */ From c14de4f19754d450e790ecf6c97e5e42e30c0790 Mon Sep 17 00:00:00 2001 From: i582 <51853996+i582@users.noreply.github.com> Date: Fri, 9 Sep 2022 20:27:54 +0300 Subject: [PATCH 178/419] fixed style --- Core/Core_c.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index 72b919770..8a2fcb513 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -728,8 +728,8 @@ public function __construct() {} * Create a new weak reference. * @link https://www.php.net/manual/en/weakreference.create.php * @template TIn of object - * @param TIn $object Any object - * @return WeakReference the freshly instantiated object. + * @param TIn $object Any object. + * @return WeakReference The freshly instantiated object. * @since 7.4 */ public static function create(object $object): WeakReference {} From 301f8e2614c72000a87a0747bfc7c02a2ce6bc9f Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Fri, 23 Sep 2022 18:42:14 +0200 Subject: [PATCH 179/419] argc/argv type inference --- superglobals/_superglobals.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superglobals/_superglobals.php b/superglobals/_superglobals.php index 72b78adf2..c21c9b846 100644 --- a/superglobals/_superglobals.php +++ b/superglobals/_superglobals.php @@ -184,6 +184,7 @@ /** * @xglobal $argc int + * @type int<1, max> * * The number of arguments passed to script * @@ -200,7 +201,7 @@ *

* https://secure.php.net/manual/en/reserved.variables.php */ -$argv = []; +$argv = [1 + 1 => "a" . "b"]; /** * @xglobal $HTTP_RAW_POST_DATA string From eb37154d91147537004a2ffdadf3d48b02ee20d4 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Mon, 26 Sep 2022 18:44:55 +0200 Subject: [PATCH 180/419] Provide expected arguments for psr LoggerInterface::log --- meta/psr/log/.phpstorm.meta.php | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 meta/psr/log/.phpstorm.meta.php diff --git a/meta/psr/log/.phpstorm.meta.php b/meta/psr/log/.phpstorm.meta.php new file mode 100644 index 000000000..054240a8c --- /dev/null +++ b/meta/psr/log/.phpstorm.meta.php @@ -0,0 +1,5 @@ + Date: Mon, 26 Sep 2022 18:45:38 +0200 Subject: [PATCH 181/419] Express possibility of multiple values in function signature --- meta/.phpstorm.meta.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 935bd0aeb..013be309c 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -109,11 +109,11 @@ function sql_injection_subst($argNum) { override(\simplexml_load_string(1), map(["" => "$1"])); override(\simplexml_import_dom(1), map(["" => "$1"])); - function expectedArguments($functionReference, $argumentIndex, $values) { + function expectedArguments($functionReference, $argumentIndex, ...$values) { return "expectedArguments " . $functionReference . "at " . $argumentIndex . ": " . $values; } - function registerArgumentsSet($setName, $values) { + function registerArgumentsSet($setName, ...$values) { return "registerArgumentsSet " . $setName . ": " . $values; } From 93545b964fd2962087148fcaf42de87582139e71 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Tue, 27 Sep 2022 10:00:24 +0200 Subject: [PATCH 182/419] Mute test for Psr Log interface --- tests/StubsMetaExpectedArgumentsTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/StubsMetaExpectedArgumentsTest.php b/tests/StubsMetaExpectedArgumentsTest.php index a5728d760..e08a99b8a 100644 --- a/tests/StubsMetaExpectedArgumentsTest.php +++ b/tests/StubsMetaExpectedArgumentsTest.php @@ -30,6 +30,7 @@ class StubsMetaExpectedArgumentsTest extends AbstractBaseStubsTestCase { + private const PSR_LOG_LOGGER_NAMESPACE_PREFIX = "Psr\\Log\\"; /** * @var ExpectedFunctionArgumentsInfo[] */ @@ -104,11 +105,15 @@ public function testFunctionReferencesExists() $expr = $argument->getFunctionReference(); if ($expr instanceof FuncCall) { $fqn = self::toPresentableFqn($expr->name->toCodeString()); - self::assertArrayHasKey($fqn, self::$functionsFqns, "Can't resolve function " . $fqn); + if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX)) { + self::assertArrayHasKey($fqn, self::$functionsFqns, "Can't resolve function " . $fqn); + } } elseif ($expr instanceof StaticCall) { if ((string)$expr->name !== '__construct') { $fqn = self::getClassMemberFqn($expr->class->toCodeString(), (string)$expr->name); - self::assertArrayHasKey($fqn, self::$methodsFqns, "Can't resolve method " . $fqn); + if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX)) { + self::assertArrayHasKey($fqn, self::$methodsFqns, "Can't resolve method " . $fqn); + } } } elseif ($expr !== null) { self::fail('First argument should be function reference or method reference, got: ' . $expr::class); From cdfe1fa535e7c2f3d7592010783a9760122ca47c Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Tue, 27 Sep 2022 10:08:22 +0200 Subject: [PATCH 183/419] Run CS Fixer --- tests/StubsMetaExpectedArgumentsTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/StubsMetaExpectedArgumentsTest.php b/tests/StubsMetaExpectedArgumentsTest.php index e08a99b8a..b50391259 100644 --- a/tests/StubsMetaExpectedArgumentsTest.php +++ b/tests/StubsMetaExpectedArgumentsTest.php @@ -31,6 +31,7 @@ class StubsMetaExpectedArgumentsTest extends AbstractBaseStubsTestCase { private const PSR_LOG_LOGGER_NAMESPACE_PREFIX = "Psr\\Log\\"; + /** * @var ExpectedFunctionArgumentsInfo[] */ From 934657a9f693d8ec20d239c47654576f21bfada7 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Tue, 27 Sep 2022 10:39:10 +0200 Subject: [PATCH 184/419] Mute test for Psr Log interface for constant-exists test --- tests/StubsMetaExpectedArgumentsTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/StubsMetaExpectedArgumentsTest.php b/tests/StubsMetaExpectedArgumentsTest.php index b50391259..cbe9dd6fa 100644 --- a/tests/StubsMetaExpectedArgumentsTest.php +++ b/tests/StubsMetaExpectedArgumentsTest.php @@ -133,7 +133,9 @@ public function testConstantsExists() foreach ($expectedArguments as $constantReference) { if ($constantReference instanceof ClassConstFetch) { $fqn = self::getClassMemberFqn($constantReference->class->toCodeString(), (string)$constantReference->name); - self::assertArrayHasKey($fqn, self::$constantsFqns, "Can't resolve class constant " . $fqn); + if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX)) { + self::assertArrayHasKey($fqn, self::$constantsFqns, "Can't resolve class constant " . $fqn); + } } elseif ($constantReference instanceof ConstFetch) { $fqn = self::toPresentableFqn($constantReference->name->toCodeString()); self::assertArrayHasKey($fqn, self::$constantsFqns, "Can't resolve constant " . $fqn); From 27be10cbdc7a653b940830bef10b6288341e2cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Sat, 24 Sep 2022 16:25:07 +0200 Subject: [PATCH 185/419] Fix typo --- redis/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.php b/redis/Redis.php index 215f36be9..733d09f1a 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -2750,7 +2750,7 @@ public function sort($key, $option = null) {} * Returns an associative array of strings and integers * * @param string $option Optional. The option to provide redis. - * SERVER | CLIENTS | MEMORY | PERSISTENCE | STATS | REPLICATION | CPU | CLASTER | KEYSPACE | COMANDSTATS + * SERVER | CLIENTS | MEMORY | PERSISTENCE | STATS | REPLICATION | CPU | CLUSTER | KEYSPACE | COMMANDSTATS * * Returns an associative array of strings and integers, with the following keys: * - redis_version From 86de90f615e9aa1422c516c0fdf37e3362f1f8dd Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 25 Sep 2022 18:38:42 +0100 Subject: [PATCH 186/419] var_export: Fix outputting typo --- standard/standard_4.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_4.php b/standard/standard_4.php index c1e64534e..cecb532f0 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -209,7 +209,7 @@ function var_dump(...$vars): void {} *

* @param bool $return [optional]

* If used and set to true, var_export will return - * the variable representation instead of outputing it. + * the variable representation instead of outputting it. *

* @return string|null the variable representation when the return * parameter is used and evaluates to true. Otherwise, this function will From 4d331ab4966645b750ad1249aa05bcdb9ec04289 Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Tue, 27 Sep 2022 11:53:34 +0200 Subject: [PATCH 187/419] https://youtrack.jetbrains.com/issue/WI-68898 narrower types for 3 stream_get_ functions note: muted related problems --- standard/standard_6.php | 4 ++-- standard/standard_9.php | 2 +- tests/TestData/mutedProblems.json | 33 +++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/standard/standard_6.php b/standard/standard_6.php index 95c1ee89d..4da7b8cae 100644 --- a/standard/standard_6.php +++ b/standard/standard_6.php @@ -983,7 +983,7 @@ function stream_wrapper_restore(string $protocol): bool {} /** * Retrieve list of registered streams * @link https://php.net/manual/en/function.stream-get-wrappers.php - * @return array an indexed array containing the name of all stream wrappers + * @return list an indexed array containing the name of all stream wrappers * available on the running system. */ #[Pure(true)] @@ -992,7 +992,7 @@ function stream_get_wrappers(): array {} /** * Retrieve list of registered socket transports * @link https://php.net/manual/en/function.stream-get-transports.php - * @return array an indexed array of socket transports names. + * @return list an indexed array of socket transports names. */ #[Pure(true)] function stream_get_transports(): array {} diff --git a/standard/standard_9.php b/standard/standard_9.php index f2732d580..4a2e1acab 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -1036,7 +1036,7 @@ function str_rot13(string $string): string {} /** * Retrieve list of registered filters * @link https://php.net/manual/en/function.stream-get-filters.php - * @return array an indexed array containing the name of all stream filters + * @return list an indexed array containing the name of all stream filters * available. */ #[Pure(true)] diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index 4bf530a11..e04804c68 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -991,6 +991,39 @@ ] } ] + }, + { + "name": "stream_get_filters", + "problems": [ + { + "description": "has type mismatch in signature and phpdoc", + "versions": [ + "ALL" + ] + } + ] + }, + { + "name": "stream_get_transports", + "problems": [ + { + "description": "has type mismatch in signature and phpdoc", + "versions": [ + "ALL" + ] + } + ] + }, + { + "name": "stream_get_wrappers", + "problems": [ + { + "description": "has type mismatch in signature and phpdoc", + "versions": [ + "ALL" + ] + } + ] } ], "classes": [ From 749cad55f4ecf88d21d0bafbc17e6e708fafe291 Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Tue, 27 Sep 2022 12:53:31 +0200 Subject: [PATCH 188/419] https://youtrack.jetbrains.com/issue/WI-68897 added array shape for pathinfo @return added ExpectedValues for $flags --- standard/standard_1.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/standard/standard_1.php b/standard/standard_1.php index 72c8281a6..86fe7b1e0 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -251,7 +251,7 @@ function dirname(string $path, #[PhpStormStubsElementAvailable(from: '7.0')] int * PATHINFO_FILENAME. It * defaults to return all elements. *

- * @return string[]|string The following associative array elements are returned: + * @return array{dirname: string, basename: string, extension: string, filename: string} The following associative array elements are returned: * dirname, basename, * extension (if any), and filename. *

@@ -260,7 +260,12 @@ function dirname(string $path, #[PhpStormStubsElementAvailable(from: '7.0')] int * string if not all elements are requested. */ #[Pure(true)] -function pathinfo(string $path, int $flags = PATHINFO_ALL): array|string {} +function pathinfo(string $path, #[ExpectedValues(flags: [ + PATHINFO_DIRNAME, + PATHINFO_BASENAME, + PATHINFO_EXTENSION, + PATHINFO_FILENAME +])] int $flags = PATHINFO_ALL): array|string {} /** * Un-quotes a quoted string From 2da8020b23f8a2f3e4683b3e1e703fee093c9da5 Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Tue, 27 Sep 2022 12:55:13 +0200 Subject: [PATCH 189/419] fixed missed union type --- standard/standard_1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_1.php b/standard/standard_1.php index 86fe7b1e0..1b67bc7e9 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -251,7 +251,7 @@ function dirname(string $path, #[PhpStormStubsElementAvailable(from: '7.0')] int * PATHINFO_FILENAME. It * defaults to return all elements. *

- * @return array{dirname: string, basename: string, extension: string, filename: string} The following associative array elements are returned: + * @return string|array{dirname: string, basename: string, extension: string, filename: string} The following associative array elements are returned: * dirname, basename, * extension (if any), and filename. *

From db41c3271333c61447f4e862e57917fd9167a6b7 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Mon, 3 Oct 2022 18:26:47 +0200 Subject: [PATCH 190/419] ArrayShape for getimagesize --- standard/standard_0.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/standard/standard_0.php b/standard/standard_0.php index 1b0343814..997e26e26 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -2,6 +2,7 @@ // Start of standard v.5.3.2-0.dotdeb.1 +use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\ExpectedValues; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; @@ -912,6 +913,7 @@ function iptcembed(string $iptc_data, string $filename, int $spool = 0): string| * On failure, false is returned. *

*/ +#[ArrayShape([0 => "int", 1 => "int", 2 => "int", 3 => "string", "bits" => "int", "channels" => "int", "mime" => "string"])] function getimagesize(string $filename, &$image_info): array|false {} /** From 2abb19e65e4503975b9da5619c8a98c2ef30751b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Tue, 4 Oct 2022 12:16:46 +0200 Subject: [PATCH 191/419] Add stub for getClosureCalledClass --- Reflection/ReflectionFunctionAbstract.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Reflection/ReflectionFunctionAbstract.php b/Reflection/ReflectionFunctionAbstract.php index aefe0c3fa..435fedf89 100644 --- a/Reflection/ReflectionFunctionAbstract.php +++ b/Reflection/ReflectionFunctionAbstract.php @@ -132,6 +132,15 @@ public function getClosureThis(): ?object {} #[TentativeType] public function getClosureScopeClass(): ?ReflectionClass {} + /** + * @return ReflectionClass|null Returns the class on success or {@see null} + * on failure. + * @since 8.0 + */ + #[Pure] + #[TentativeType] + public function getClosureCalledClass(): ?ReflectionClass {} + /** * Gets doc comment * From 04323bb57238473eb4b1abd008375e447e19b0c1 Mon Sep 17 00:00:00 2001 From: Ahmed Ammar Date: Wed, 5 Oct 2022 22:32:42 +0200 Subject: [PATCH 192/419] fix docblock variable type for SoapFault Check this bug for more context: https://github.com/phpstan/phpstan/issues/8111 --- soap/soap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soap/soap.php b/soap/soap.php index 2d88becd1..f51bf2f25 100644 --- a/soap/soap.php +++ b/soap/soap.php @@ -878,7 +878,7 @@ class SoapFault extends Exception * @param string $actor [optional]

* A string identifying the actor that caused the error. *

- * @param string $details [optional]

+ * @param mixed $details [optional]

* More details about the cause of the error. *

* @param string $name [optional]

From af69214052e8b3d417ec5d6ceed3a22e4f206ef0 Mon Sep 17 00:00:00 2001 From: Brad <28307684+mad-briller@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:24:33 +0100 Subject: [PATCH 193/419] fpm_get_status may return false if the fpm scoreboard is locked or unavailable. --- fpm/fpm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fpm/fpm.php b/fpm/fpm.php index 6bd6d1c0c..4a6550ccc 100644 --- a/fpm/fpm.php +++ b/fpm/fpm.php @@ -2,9 +2,9 @@ /** * Returns FPM status info array * @since 7.3 - * @return array + * @return array|false */ -function fpm_get_status(): array {} +function fpm_get_status(): array|false {} /** * This function flushes all response data to the client and finishes the request. From 606e0616b8014f3b3329254ce25eeedd0d494fd7 Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Tue, 11 Oct 2022 21:02:27 +0200 Subject: [PATCH 194/419] zip.php: refactor "mixed" phpdocs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⇾ replace "mixed" with something useful for the developers --- zip/zip.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zip/zip.php b/zip/zip.php index fa4c6040b..48ceae7a7 100644 --- a/zip/zip.php +++ b/zip/zip.php @@ -630,7 +630,7 @@ class ZipArchive implements Countable * ZipArchive::OVERWRITE *

* - * @return mixed Error codes + * @return int|true Error codes *

* Returns TRUE on success or the error code. *

@@ -1154,7 +1154,7 @@ public function unchangeName(#[LanguageLevelTypeAware(['8.0' => 'string'], defau * @param string $pathto

* Location where to extract the files. *

- * @param mixed $files [optional]

+ * @param string[]|string|null $files [optional]

* The entries to extract. It accepts either a single entry name or * an array of names. *

From 5983aca1e6cf799a4c867c678d69b25cbdc22fbe Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Wed, 12 Oct 2022 12:29:26 +0200 Subject: [PATCH 195/419] added template-covariant to the list of valid tags since we support it --- tests/StubsPhpDocTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/StubsPhpDocTest.php b/tests/StubsPhpDocTest.php index ec182bd8d..3df55b8bf 100644 --- a/tests/StubsPhpDocTest.php +++ b/tests/StubsPhpDocTest.php @@ -206,6 +206,7 @@ private static function checkContainsOnlyValidTags(BasePHPElement $element, stri 'template', 'template-implements', // https://github.com/JetBrains/phpstorm-stubs/pull/1212#issuecomment-907263735 'template-extends', + 'template-covariant', 'uses', 'var', 'version', From ccff41f1a6b40ff4ecfaa4964fa5007fa78f6225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Harkes?= Date: Mon, 29 Aug 2022 21:23:13 +0200 Subject: [PATCH 196/419] Add cavariance to iterator --- Core/Core_c.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index 8a2fcb513..93f091f69 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -25,7 +25,7 @@ interface iterable {} * * @link https://php.net/manual/en/class.traversable.php * @template TKey - * @template TValue + * @template-covariant TValue * * @template-implements iterable */ @@ -35,7 +35,7 @@ interface Traversable extends iterable {} * Interface to create an external Iterator. * @link https://php.net/manual/en/class.iteratoraggregate.php * @template TKey - * @template TValue + * @template-covariant TValue * @template-implements Traversable */ interface IteratorAggregate extends Traversable @@ -56,7 +56,7 @@ public function getIterator(): Traversable; * themselves internally. * @link https://php.net/manual/en/class.iterator.php * @template TKey - * @template TValue + * @template-covariant TValue * @template-implements Traversable */ interface Iterator extends Traversable From 4023e47766da651ef3de010db5a84063426be684 Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Wed, 12 Oct 2022 16:01:46 +0200 Subject: [PATCH 197/419] redis stubs fixes based on latest psalm stubs --- redis/Redis.php | 1115 ++++++++++++++++++++++++++++------------ redis/RedisCluster.php | 660 ++++++++++++++++++------ 2 files changed, 1282 insertions(+), 493 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index 733d09f1a..04c24fc3d 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -132,7 +132,9 @@ class Redis * ], * ]); */ - public function __construct($options = null) {} + public function __construct($options = null) + { + } /** * Connects to a Redis instance. @@ -167,7 +169,8 @@ public function connect( $retry_interval = 0, $read_timeout = 0, $context = null - ) {} + ) { + } /** * Connects to a Redis instance. @@ -193,7 +196,8 @@ public function open( $retry_interval = 0, $read_timeout = 0, $context = null - ) {} + ) { + } /** * A method to determine if a phpredis object thinks it's connected to a server @@ -202,7 +206,9 @@ public function open( * * @throws RedisException */ - public function isConnected() {} + public function isConnected() + { + } /** * Retrieve our host or unix socket that we're connected to @@ -211,7 +217,9 @@ public function isConnected() {} * * @throws RedisException */ - public function getHost() {} + public function getHost() + { + } /** * Get the port we're connected to @@ -220,7 +228,9 @@ public function getHost() {} * * @throws RedisException */ - public function getPort() {} + public function getPort() + { + } /** * Get the database number phpredis is pointed to @@ -230,7 +240,9 @@ public function getPort() {} * * @throws RedisException */ - public function getDbNum() {} + public function getDbNum() + { + } /** * Get the (write) timeout in use for phpredis @@ -239,7 +251,9 @@ public function getDbNum() {} * * @throws RedisException */ - public function getTimeout() {} + public function getTimeout() + { + } /** * Get the read timeout specified to phpredis or FALSE if we're not connected @@ -249,7 +263,9 @@ public function getTimeout() {} * * @throws RedisException */ - public function getReadTimeout() {} + public function getReadTimeout() + { + } /** * Gets the persistent ID that phpredis is using @@ -261,7 +277,9 @@ public function getReadTimeout() {} * * @throws RedisException */ - public function getPersistentID() {} + public function getPersistentID() + { + } /** * Get the password used to authenticate the phpredis connection @@ -272,7 +290,9 @@ public function getPersistentID() {} * * @throws RedisException */ - public function getAuth() {} + public function getAuth() + { + } /** * Connects to a Redis instance or reuse a connection already established with pconnect/popen. @@ -324,7 +344,8 @@ public function pconnect( $retry_interval = 0, $read_timeout = 0, $context = null - ) {} + ) { + } /** * @param string $host @@ -348,7 +369,8 @@ public function popen( $retry_interval = 0, $read_timeout = 0, $context = null - ) {} + ) { + } /** * Disconnects from the Redis instance. @@ -361,7 +383,9 @@ public function popen( * * @throws RedisException */ - public function close() {} + public function close() + { + } /** * Swap one Redis database with another atomically @@ -383,7 +407,9 @@ public function close() {} * $redis->swapdb(0, 1); *
*/ - public function swapdb(int $db1, int $db2) {} + public function swapdb(int $db1, int $db2) + { + } /** * Set client option @@ -414,7 +440,9 @@ public function swapdb(int $db1, int $db2) {} * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY); *
*/ - public function setOption($option, $value) {} + public function setOption($option, $value) + { + } /** * Get client option @@ -430,7 +458,9 @@ public function setOption($option, $value) {} * // return option value * $redis->getOption(Redis::OPT_SERIALIZER); */ - public function getOption($option) {} + public function getOption($option) + { + } /** * Check the current connection status @@ -449,7 +479,9 @@ public function getOption($option) {} * // If passed an argument, that argument is returned. Here 'hello' will be returned * $redis->ping('hello'); */ - public function ping($message = null) {} + public function ping($message = null) + { + } /** * Sends a string to Redis, which replies with the same string @@ -462,7 +494,9 @@ public function ping($message = null) {} * * @link https://redis.io/commands/echo */ - public function echo($message) {} + public function echo($message) + { + } /** * Get the value related to the specified key @@ -493,7 +527,9 @@ public function echo($message) {} * } *
*/ - public function get($key) {} + public function get($key) + { + } /** * Set the string value in argument as value of the key. @@ -530,7 +566,9 @@ public function get($key) {} * * @link https://redis.io/commands/set */ - public function set($key, $value, $timeout = null) {} + public function set($key, string $value, mixed $timeout = null) + { + } /** * Set the string value in argument as value of the key, with a time to live. @@ -546,7 +584,9 @@ public function set($key, $value, $timeout = null) {} * @link https://redis.io/commands/setex * @example $redis->setex('key', 3600, 'value'); // sets key → value, with 1h TTL. */ - public function setex($key, $expire, $value) {} + public function setex($key, $expire, string $value) + { + } /** * Set the value and expiration in milliseconds of a key. @@ -563,7 +603,9 @@ public function setex($key, $expire, $value) {} * @link https://redis.io/commands/psetex * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL. */ - public function psetex($key, $expire, $value) {} + public function psetex($key, $expire, string $value) + { + } /** * Set the string value in argument as value of the key if the key doesn't already exist in the database. @@ -582,7 +624,9 @@ public function psetex($key, $expire, $value) {} * $redis->setnx('key', 'value'); // return FALSE *
*/ - public function setnx($key, $value) {} + public function setnx(string $key, string $value) + { + } /** * Remove specified keys. @@ -590,7 +634,7 @@ public function setnx($key, $value) {} * @param int|string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param int|string ...$otherKeys * - * @return int|Redis Number of keys deleted or Redis if in multimode + * @return false|int|Redis Number of keys deleted or Redis if in multimode * * @throws RedisException * @@ -606,7 +650,9 @@ public function setnx($key, $value) {} * $redis->del(['key3', 'key4']); // return 2 *
*/ - public function del($key1, ...$otherKeys) {} + public function del($key1, ...$otherKeys) + { + } /** * Remove specified keys. @@ -614,12 +660,14 @@ public function del($key1, ...$otherKeys) {} * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param string ...$otherKeys * - * @return int|Redis Number of keys deleted or Redis if in multimode + * @return false|int|Redis Number of keys deleted or Redis if in multimode * * @throws RedisException */ #[Deprecated(replacement: "%class%->del(%parametersList%)")] - public function delete($key, ...$otherKeys) {} + public function delete($key, ...$otherKeys) + { + } /** * Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking. @@ -628,7 +676,7 @@ public function delete($key, ...$otherKeys) {} * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param string ...$other_keys * - * @return int|Redis Number of keys unlinked or Redis if in multimode + * @return false|int|Redis Number of keys unlinked or Redis if in multimode * * @throws RedisException * @@ -643,7 +691,9 @@ public function delete($key, ...$otherKeys) {} * $redis->unlink(array('key3', 'key4')); // return 2 *
*/ - public function unlink($key, ...$other_keys) {} + public function unlink($key, ...$other_keys) + { + } /** * Enter and exit transactional mode. @@ -676,7 +726,9 @@ public function unlink($key, ...$other_keys) {} * // 3 => 'val2'); *
*/ - public function multi($mode = Redis::MULTI) {} + public function multi($mode = Redis::MULTI) + { + } /** * Returns a Redis instance which can simply transmitted faster to the server. @@ -707,7 +759,9 @@ public function multi($mode = Redis::MULTI) {} * // 4 => '+PONG'); *
*/ - public function pipeline() {} + public function pipeline() + { + } /** * @return void|array|Redis returns Redis if in multimode @@ -717,7 +771,9 @@ public function pipeline() {} * @see multi() * @link https://redis.io/commands/exec */ - public function exec() {} + public function exec() + { + } /** * Flushes all previously queued commands in a transaction and restores the connection state to normal. @@ -729,7 +785,9 @@ public function exec() {} * @see multi() * @link https://redis.io/commands/discard */ - public function discard() {} + public function discard() + { + } /** * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, @@ -753,7 +811,9 @@ public function discard() {} * // $ret = FALSE if x has been modified between the call to WATCH and the call to EXEC. *
*/ - public function watch($key, ...$other_keys) {} + public function watch($key, ...$other_keys) + { + } /** * @throws RedisException @@ -762,44 +822,28 @@ public function watch($key, ...$other_keys) {} * @return bool|Redis * @link https://redis.io/commands/unwatch */ - public function unwatch() {} + public function unwatch() + { + } /** - * Subscribe to channels. + * Subscribes the client to the specified channels. * - * Warning: this function will probably change in the future. + * Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, SSUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, SUNSUBSCRIBE, PUNSUBSCRIBE, PING, RESET and QUIT commands. * - * @param string[] $channels an array of channels to subscribe - * @param string|array|callable $callback either a string or an array($instance, 'method_name'). - * The callback function receives 3 parameters: the redis instance, the channel name, and the message. + * @param string $channel + * @param string ...$other_channels * - * @return mixed|null|Redis Any non-null return value in the callback will be returned to the caller or Redis if in multimode + * @return false|array|Redis * * @throws RedisException * * @link https://redis.io/commands/subscribe - * @example - *
-     * function f($redis, $chan, $msg) {
-     *  switch($chan) {
-     *      case 'chan-1':
-     *          ...
-     *          break;
-     *
-     *      case 'chan-2':
-     *                     ...
-     *          break;
-     *
-     *      case 'chan-2':
-     *          ...
-     *          break;
-     *      }
-     * }
-     *
-     * $redis->subscribe(array('chan-1', 'chan-2', 'chan-3'), 'f'); // subscribe to 3 chans
-     * 
+ * @since 2.0 */ - public function subscribe($channels, $callback) {} + public function subscribe(string $channel, string ...$other_channels) + { + } /** * Subscribe to channels by pattern @@ -823,7 +867,9 @@ public function subscribe($channels, $callback) {} * $redis->psubscribe(array('chan-1', 'chan-2', 'chan-3'), 'f') *
*/ - public function psubscribe($patterns, $callback) {} + public function psubscribe($patterns, $callback) + { + } /** * Publish messages to channels. @@ -833,14 +879,16 @@ public function psubscribe($patterns, $callback) {} * @param string $channel a channel to publish to * @param string $message string * - * @return int|Redis Number of clients that received the message or Redis if in multimode + * @return false|int|Redis Number of clients that received the message or Redis if in multimode * * @throws RedisException * * @link https://redis.io/commands/publish * @example $redis->publish('chan-1', 'hello, world!'); // send message. */ - public function publish($channel, $message) {} + public function publish($channel, $message) + { + } /** * A command allowing you to get information on the Redis pub/sub system @@ -867,12 +915,15 @@ public function publish($channel, $message) {} * $redis->pubsub('numpat'); // Get the number of pattern subscribers *
*/ - public function pubsub($keyword, $argument = null) {} + public function pubsub($keyword, $argument = null) + { + } /** * Stop listening for messages posted to the given channels. * - * @param array $channels an array of channels to usubscribe + * @param string $channel + * @param string ...$other_channels * * @return bool|array * @@ -880,20 +931,24 @@ public function pubsub($keyword, $argument = null) {} * * @link https://redis.io/commands/unsubscribe */ - public function unsubscribe($channels) {} + public function unsubscribe(string $channel, string ...$other_channels) + { + } /** * Stop listening for messages posted to the given channels. * * @param array $patterns an array of glob-style patterns to unsubscribe * - * @return bool|array + * @return false|array * * @throws RedisException * * @link https://redis.io/commands/punsubscribe */ - public function punsubscribe($patterns) {} + public function punsubscribe(array $patterns) + { + } /** * Verify if the specified key/keys exists @@ -920,14 +975,16 @@ public function punsubscribe($patterns) {} * $redis->exists('foo', 'bar', 'baz'); // 3 *
*/ - public function exists($key) {} + public function exists($key) + { + } /** * Increment the number stored at key by one. * * @param string $key * - * @return int|Redis the new value or Redis if in multimode + * @return false|int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -940,7 +997,9 @@ public function exists($key) {} * $redis->incr('key1'); // 4 *
*/ - public function incr($key) {} + public function incr($key) + { + } /** * Increment the float value of a key by the given amount @@ -960,7 +1019,9 @@ public function incr($key) {} * $redis->get('x'); // float(4.5) *
*/ - public function incrByFloat($key, $increment) {} + public function incrByFloat($key, $increment) + { + } /** * Increment the number stored at key by one. @@ -969,7 +1030,7 @@ public function incrByFloat($key, $increment) {} * @param string $key key * @param int $value value that will be added to key (only for incrBy) * - * @return int|Redis the new value or Redis if in multimode + * @return false|int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -983,14 +1044,16 @@ public function incrByFloat($key, $increment) {} * $redis->incrBy('key1', 10); // 14 *
*/ - public function incrBy($key, $value) {} + public function incrBy($key, $value) + { + } /** * Decrement the number stored at key by one. * * @param string $key * - * @return int|Redis the new value or Redis if in multimode + * @return false|int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -1002,7 +1065,9 @@ public function incrBy($key, $value) {} * $redis->decr('key1'); // -3 *
*/ - public function decr($key) {} + public function decr($key) + { + } /** * Decrement the number stored at key by one. @@ -1011,7 +1076,7 @@ public function decr($key) {} * @param string $key * @param int $value that will be subtracted to key (only for decrBy) * - * @return int|Redis the new value or Redis if in multimode + * @return false|int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -1024,7 +1089,9 @@ public function decr($key) {} * $redis->decrBy('key1', 10); // -13 *
*/ - public function decrBy($key, $value) {} + public function decrBy($key, $value) + { + } /** * Adds the string values to the head (left) of the list. @@ -1052,7 +1119,9 @@ public function decrBy($key, $value) {} * // } *
*/ - public function lPush($key, ...$value1) {} + public function lPush($key, ...$value1) + { + } /** * Adds the string values to the tail (right) of the list. @@ -1080,7 +1149,9 @@ public function lPush($key, ...$value1) {} * // } *
*/ - public function rPush($key, ...$value1) {} + public function rPush($key, ...$value1) + { + } /** * Adds the string value to the head (left) of the list if the list exists. @@ -1103,7 +1174,9 @@ public function rPush($key, ...$value1) {} * // key1 now points to the following list: [ 'A', 'B', 'C' ] *
*/ - public function lPushx($key, $value) {} + public function lPushx($key, string $value) + { + } /** * Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure. @@ -1126,7 +1199,9 @@ public function lPushx($key, $value) {} * // key1 now points to the following list: [ 'A', 'B', 'C' ] *
*/ - public function rPushx($key, $value) {} + public function rPushx($key, string $value) + { + } /** * Returns and removes the first element of the list. @@ -1147,7 +1222,9 @@ public function rPushx($key, $value) {} * $redis->lPop('key1'); // key1 => [ 'B', 'C' ] *
*/ - public function lPop($key, $count = 0) {} + public function lPop($key, $count = 0) + { + } /** * Returns and removes the last element of the list. @@ -1168,7 +1245,9 @@ public function lPop($key, $count = 0) {} * $redis->rPop('key1'); // key1 => [ 'A', 'B' ] *
*/ - public function rPop($key, $count = 0) {} + public function rPop($key, $count = 0) + { + } /** * Is a blocking lPop primitive. If at least one of the lists contains at least one element, @@ -1213,7 +1292,9 @@ public function rPop($key, $count = 0) {} * // array('key1', 'A') is returned *
*/ - public function blPop($key, $timeout_or_key, ...$extra_args) {} + public function blPop($key, $timeout_or_key, ...$extra_args) + { + } /** * Is a blocking rPop primitive. If at least one of the lists contains at least one element, @@ -1259,7 +1340,9 @@ public function blPop($key, $timeout_or_key, ...$extra_args) {} * // array('key1', 'A') is returned *
*/ - public function brPop($key, $timeout_or_key, ...$extra_args) {} + public function brPop($key, $timeout_or_key, ...$extra_args) + { + } /** * Returns the size of a list identified by Key. If the list didn't exist or is empty, @@ -1283,19 +1366,23 @@ public function brPop($key, $timeout_or_key, ...$extra_args) {} * $redis->lLen('key1'); // 2 *
*/ - public function lLen($key) {} + public function lLen($key) + { + } /** * @link https://redis.io/commands/llen * * @param string $key * - * @return int|Redis The size of the list identified by Key exists or Redis if in multimode + * @return false|int|Redis The size of the list identified by Key exists or Redis if in multimode * * @throws RedisException */ #[Deprecated(replacement: '%class%->lLen(%parametersList%)')] - public function lSize($key) {} + public function lSize($key) + { + } /** * Return the specified element of the list stored at the specified key. @@ -1322,7 +1409,9 @@ public function lSize($key) {} * $redis->lIndex('key1', 10); // `FALSE` *
*/ - public function lIndex($key, $index) {} + public function lIndex($key, $index) + { + } /** * @link https://redis.io/commands/lindex @@ -1334,7 +1423,9 @@ public function lIndex($key, $index) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->lIndex(%parametersList%)')] - public function lGet($key, $index) {} + public function lGet($key, $index) + { + } /** * Set the list at index with the new value. @@ -1359,7 +1450,9 @@ public function lGet($key, $index) {} * $redis->lIndex('key1', 0); // 'X' *
*/ - public function lSet($key, $index, $value) {} + public function lSet($key, $index, string $value) + { + } /** * Returns the specified elements of the list stored at the specified key in @@ -1383,7 +1476,9 @@ public function lSet($key, $index, $value) {} * $redis->lRange('key1', 0, -1); // array('A', 'B', 'C') *
*/ - public function lRange($key, $start, $end) {} + public function lRange($key, $start, $end) + { + } /** * @link https://redis.io/commands/lrange @@ -1396,7 +1491,9 @@ public function lRange($key, $start, $end) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->lRange(%parametersList%)')] - public function lGetRange($key, $start, $end) {} + public function lGetRange($key, $start, $end) + { + } /** * Trims an existing list so that it will contain only a specified range of elements. @@ -1420,7 +1517,9 @@ public function lGetRange($key, $start, $end) {} * $redis->lRange('key1', 0, -1); // array('A', 'B') *
*/ - public function lTrim($key, $start, $stop) {} + public function lTrim($key, $start, $stop) + { + } /** * @link https://redis.io/commands/ltrim @@ -1432,7 +1531,9 @@ public function lTrim($key, $start, $stop) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->lTrim(%parametersList%)')] - public function listTrim($key, $start, $stop) {} + public function listTrim($key, $start, $stop) + { + } /** * Removes the first count occurrences of the value element from the list. @@ -1462,7 +1563,9 @@ public function listTrim($key, $start, $stop) {} * $redis->lRange('key1', 0, -1); // array('C', 'B', 'A') *
*/ - public function lRem($key, $value, $count) {} + public function lRem($key, $value, $count) + { + } /** * @link https://redis.io/commands/lremove @@ -1474,7 +1577,9 @@ public function lRem($key, $value, $count) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->lRem(%parametersList%)')] - public function lRemove($key, $value, $count) {} + public function lRemove($key, $value, $count) + { + } /** * Insert value in the list before or after the pivot value. the parameter options @@ -1486,7 +1591,7 @@ public function lRemove($key, $value, $count) {} * @param mixed $pivot * @param string|mixed $value * - * @return int|Redis The number of the elements in the list, -1 if the pivot didn't exists or Redis if in multimode + * @return false|int|Redis The number of the elements in the list, -1 if the pivot didn't exists or Redis if in multimode * * @throws RedisException * @@ -1509,19 +1614,20 @@ public function lRemove($key, $value, $count) {} * $redis->lInsert('key1', Redis::AFTER, 'W', 'value'); // -1 *
*/ - public function lInsert($key, $position, $pivot, $value) {} + public function lInsert($key, $position, $pivot, $value) + { + } /** * Adds a values to the set value stored at key. * - * @param string $key Required key - * @param string|mixed ...$value1 Variadic list of values + * @param string $key Required key + * @param string $value + * @param mixed ...$other_values Variadic list of values * * @return int|bool|Redis The number of elements added to the set or Redis if in multimode * If this value is already in the set, FALSE is returned * - * @throws RedisException - * * @link https://redis.io/commands/sadd * @example *
@@ -1529,17 +1635,18 @@ public function lInsert($key, $position, $pivot, $value) {}
      * $redis->sAdd('k', 'v1', 'v2', 'v3');    // int(2)
      * 
*/ - public function sAdd($key, ...$value1) {} + public function sAdd(string $key, string $value, mixed ...$other_values) + { + } /** * Removes the specified members from the set value stored at key. * - * @param string $key - * @param string|mixed ...$member1 Variadic list of members - * - * @return int|Redis The number of elements removed from the set or Redis if in multimode + * @param string $key + * @param string $value + * @param string|mixed ...$other_values Variadic list of members * - * @throws RedisException + * @return false|int|Redis The number of elements removed from the set or Redis if in multimode * * @link https://redis.io/commands/srem * @example @@ -1553,7 +1660,9 @@ public function sAdd($key, ...$value1) {} * // } *
*/ - public function sRem($key, ...$member1) {} + public function sRem(string $key, string $value, ...$other_values) + { + } /** * @link https://redis.io/commands/srem @@ -1564,14 +1673,16 @@ public function sRem($key, ...$member1) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->sRem(%parametersList%)')] - public function sRemove($key, ...$member1) {} + public function sRemove($key, ...$member1) + { + } /** * Moves the specified member from the set at srcKey to the set at dstKey. * * @param string $srcKey * @param string $dstKey - * @param string|mixed $member + * @param string $member * * @return bool|Redis If the operation is successful, return TRUE or Redis if in multimode * If the srcKey and/or dstKey didn't exist, and/or the member didn't exist in srcKey, FALSE is returned. @@ -1590,7 +1701,9 @@ public function sRemove($key, ...$member1) {} * // 'key2' => {'set21', 'set22', 'set13'} *
*/ - public function sMove($srcKey, $dstKey, $member) {} + public function sMove($srcKey, $dstKey, string $member) + { + } /** * Checks if value is a member of the set stored at the key key. @@ -1613,7 +1726,9 @@ public function sMove($srcKey, $dstKey, $member) {} * $redis->sIsMember('key1', 'setX'); // FALSE *
*/ - public function sIsMember($key, $value) {} + public function sIsMember(string $key, string $value) + { + } /** * @link https://redis.io/commands/sismember @@ -1624,14 +1739,16 @@ public function sIsMember($key, $value) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->sIsMember(%parametersList%)')] - public function sContains($key, $value) {} + public function sContains($key, $value) + { + } /** * Returns the cardinality of the set identified by key. * * @param string $key * - * @return int|Redis the cardinality of the set identified by key, 0 if the set doesn't exist or Redis if in multimode + * @return false|int|Redis the cardinality of the set identified by key, 0 if the set doesn't exist or Redis if in multimode * * @throws RedisException * @@ -1645,7 +1762,9 @@ public function sContains($key, $value) {} * $redis->sCard('keyX'); // 0 *
*/ - public function sCard($key) {} + public function sCard($key) + { + } /** * Removes and returns a random element from the set value at Key. @@ -1678,7 +1797,9 @@ public function sCard($key) {} * // } *
*/ - public function sPop($key, $count = 0) {} + public function sPop($key, $count = 0) + { + } /** * Returns a random element(s) from the set value at Key, without removing it. @@ -1710,7 +1831,9 @@ public function sPop($key, $count = 0) {} * // } *
*/ - public function sRandMember($key, $count = 0) {} + public function sRandMember($key, $count = 0) + { + } /** * Returns the members of a set resulting from the intersection of all the sets @@ -1749,7 +1872,9 @@ public function sRandMember($key, $count = 0) {} * //} *
*/ - public function sInter($key1, ...$otherKeys) {} + public function sInter($key1, ...$otherKeys) + { + } /** * Performs a sInter command and stores the result in a new set. @@ -1789,7 +1914,9 @@ public function sInter($key1, ...$otherKeys) {} * //} *
*/ - public function sInterStore($dstKey, $key1, ...$otherKeys) {} + public function sInterStore($dstKey, $key1, ...$otherKeys) + { + } /** * Performs the union between N sets and returns it. @@ -1825,7 +1952,9 @@ public function sInterStore($dstKey, $key1, ...$otherKeys) {} * //} *
*/ - public function sUnion($key1, ...$otherKeys) {} + public function sUnion($key1, ...$otherKeys) + { + } /** * Performs the same action as sUnion, but stores the result in the first key @@ -1834,7 +1963,7 @@ public function sUnion($key1, ...$otherKeys) {} * @param string $key1 first key for union * @param string ...$otherKeys variadic list of keys corresponding to sets in redis * - * @return int|Redis Any number of keys corresponding to sets in redis or Redis if in multimode + * @return false|int|Redis Any number of keys corresponding to sets in redis or Redis if in multimode * * @throws RedisException * @@ -1866,7 +1995,9 @@ public function sUnion($key1, ...$otherKeys) {} * //} *
*/ - public function sUnionStore($dstKey, $key1, ...$otherKeys) {} + public function sUnionStore($dstKey, $key1, ...$otherKeys) + { + } /** * Performs the difference between N sets and returns it. @@ -1901,7 +2032,9 @@ public function sUnionStore($dstKey, $key1, ...$otherKeys) {} * //} *
*/ - public function sDiff($key1, ...$otherKeys) {} + public function sDiff($key1, ...$otherKeys) + { + } /** * Performs the same action as sDiff, but stores the result in the first key @@ -1939,7 +2072,9 @@ public function sDiff($key1, ...$otherKeys) {} * //} *
*/ - public function sDiffStore($dstKey, $key1, ...$otherKeys) {} + public function sDiffStore($dstKey, $key1, ...$otherKeys) + { + } /** * Returns the contents of a set. @@ -1971,7 +2106,13 @@ public function sDiffStore($dstKey, $key1, ...$otherKeys) {} * // The order is random and corresponds to redis' own internal representation of the set structure. *
*/ - public function sMembers($key) {} + public function sMembers($key) + { + } + + public function sMisMember(string $key, string $member, string ...$other_members): array|false + { + } /** * @link https://redis.io/commands/smembers @@ -1982,7 +2123,9 @@ public function sMembers($key) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->sMembers(%parametersList%)')] - public function sGetMembers($key) {} + public function sGetMembers($key) + { + } /** * Scan a set for members @@ -2007,7 +2150,9 @@ public function sGetMembers($key) {} * } *
*/ - public function sScan($key, &$iterator, $pattern = null, $count = 0) {} + public function sScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Sets a value and returns the previous entry at that key. @@ -2027,7 +2172,9 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) {} * $newValue = $redis->get('x')' // return 'lol' *
*/ - public function getSet($key, $value) {} + public function getSet($key, string $value) + { + } /** * Returns a random key @@ -2043,7 +2190,9 @@ public function getSet($key, $value) {} * $surprise = $redis->get($key); // who knows what's in there. *
*/ - public function randomKey() {} + public function randomKey() + { + } /** * Switches to a given database @@ -2064,7 +2213,9 @@ public function randomKey() {} * $redis->get('x'); // will return 42 *
*/ - public function select($dbIndex) {} + public function select($dbIndex) + { + } /** * Moves a key to a different database. @@ -2086,7 +2237,9 @@ public function select($dbIndex) {} * $redis->get('x'); // will return 42 *
*/ - public function move($key, $dbIndex) {} + public function move($key, $dbIndex) + { + } /** * Renames a key @@ -2107,7 +2260,9 @@ public function move($key, $dbIndex) {} * $redis->get('x'); // → `FALSE` *
*/ - public function rename($srcKey, $dstKey) {} + public function rename($srcKey, $dstKey) + { + } /** * @link https://redis.io/commands/rename @@ -2118,7 +2273,9 @@ public function rename($srcKey, $dstKey) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->rename(%parametersList%)')] - public function renameKey($srcKey, $dstKey) {} + public function renameKey($srcKey, $dstKey) + { + } /** * Renames a key @@ -2142,7 +2299,9 @@ public function renameKey($srcKey, $dstKey) {} * $redis->get('x'); // → `FALSE` *
*/ - public function renameNx($srcKey, $dstKey) {} + public function renameNx($srcKey, $dstKey) + { + } /** * Sets an expiration date (a timeout) on an item @@ -2163,7 +2322,9 @@ public function renameNx($srcKey, $dstKey) {} * $redis->get('x'); // will return `FALSE`, as 'x' has expired. *
*/ - public function expire($key, $ttl) {} + public function expire($key, $ttl) + { + } /** * Sets an expiration date (a timeout in milliseconds) on an item @@ -2184,7 +2345,9 @@ public function expire($key, $ttl) {} * $redis->pttl('x'); // 11500 *
*/ - public function pExpire($key, $ttl) {} + public function pExpire($key, $ttl) + { + } /** * @link https://redis.io/commands/expire @@ -2196,7 +2359,9 @@ public function pExpire($key, $ttl) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->expire(%parametersList%)')] - public function setTimeout($key, $ttl) {} + public function setTimeout($key, $ttl) + { + } /** * Sets an expiration date (a timestamp) on an item. @@ -2218,7 +2383,9 @@ public function setTimeout($key, $ttl) {} * $redis->get('x'); // will return `FALSE`, as 'x' has expired. *
*/ - public function expireAt($key, $timestamp) {} + public function expireAt($key, $timestamp) + { + } /** * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds @@ -2239,7 +2406,9 @@ public function expireAt($key, $timestamp) {} * echo $redis->pttl('x'); // 218270120575 *
*/ - public function pExpireAt($key, $timestamp) {} + public function pExpireAt($key, $timestamp) + { + } /** * Returns the keys that match a certain pattern. @@ -2257,7 +2426,9 @@ public function pExpireAt($key, $timestamp) {} * $keyWithUserPrefix = $redis->keys('user*'); *
*/ - public function keys($pattern) {} + public function keys($pattern) + { + } /** * @param string $pattern @@ -2266,12 +2437,14 @@ public function keys($pattern) {} * @link https://redis.io/commands/keys */ #[Deprecated(replacement: '%class%->keys(%parametersList%)')] - public function getKeys($pattern) {} + public function getKeys($pattern) + { + } /** * Returns the current database's size * - * @return int|Redis DB size, in number of keys or Redis if in multimode + * @return false|int|Redis DB size, in number of keys or Redis if in multimode * * @throws RedisException * @@ -2282,7 +2455,9 @@ public function getKeys($pattern) {} * echo "Redis has $count keys\n"; *
*/ - public function dbSize() {} + public function dbSize() + { + } /** * Authenticate the connection using a password. @@ -2297,7 +2472,9 @@ public function dbSize() {} * @link https://redis.io/commands/auth * @example $redis->auth('foobared'); */ - public function auth($credentials) {} + public function auth($credentials) + { + } /** * Starts the background rewrite of AOF (Append-Only File) @@ -2309,7 +2486,9 @@ public function auth($credentials) {} * @link https://redis.io/commands/bgrewriteaof * @example $redis->bgrewriteaof(); */ - public function bgrewriteaof() {} + public function bgrewriteaof() + { + } /** * Changes the slave status @@ -2330,7 +2509,9 @@ public function bgrewriteaof() {} * $redis->slaveof(); *
*/ - public function slaveof($host = '127.0.0.1', $port = 6379) {} + public function slaveof($host = '127.0.0.1', $port = 6379) + { + } /** * Access the Redis slowLog @@ -2361,7 +2542,9 @@ public function slaveof($host = '127.0.0.1', $port = 6379) {} * * @link https://redis.io/commands/slowlog */ - public function slowLog(string $operation, int $length = null) {} + public function slowLog(string $operation, int $length = null) + { + } /** * Describes the object pointed to by a key. @@ -2387,7 +2570,9 @@ public function slowLog(string $operation, int $length = null) {} * $redis->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds). *
*/ - public function object($subcommand, $key) {} + public function object($subcommand, $key) + { + } /** * Performs a synchronous save. @@ -2400,7 +2585,9 @@ public function object($subcommand, $key) {} * @link https://redis.io/commands/save * @example $redis->save(); */ - public function save() {} + public function save() + { + } /** * Performs a background save. @@ -2413,19 +2600,23 @@ public function save() {} * @link https://redis.io/commands/bgsave * @example $redis->bgSave(); */ - public function bgsave() {} + public function bgsave() + { + } /** * Returns the timestamp of the last disk save. * - * @return int|Redis timestamp or Redis if in multimode + * @return false|int|Redis timestamp or Redis if in multimode * * @throws RedisException * * @link https://redis.io/commands/lastsave * @example $redis->lastSave(); */ - public function lastSave() {} + public function lastSave() + { + } /** * Blocks the current client until all the previous write commands are successfully transferred and @@ -2442,14 +2633,16 @@ public function lastSave() {} * @link https://redis.io/commands/wait * @example $redis->wait(2, 1000); */ - public function wait($numSlaves, $timeout) {} + public function wait($numSlaves, $timeout) + { + } /** * Returns the type of data pointed by a given key. * * @param string $key * - * @return int|Redis returns Redis if in multimode + * @return false|int|Redis returns Redis if in multimode * Depending on the type of the data pointed by the key, * this method will return the following value: * - string: Redis::REDIS_STRING @@ -2465,7 +2658,9 @@ public function wait($numSlaves, $timeout) {} * @link https://redis.io/commands/type * @example $redis->type('key'); */ - public function type($key) {} + public function type(string $key) + { + } /** * Append specified string to the string stored in specified key. @@ -2473,7 +2668,7 @@ public function type($key) {} * @param string $key * @param string|mixed $value * - * @return int|Redis Size of the value after the append or Redis if in multimode + * @return false|int|Redis Size of the value after the append or Redis if in multimode * * @throws RedisException * @@ -2485,7 +2680,9 @@ public function type($key) {} * $redis->get('key'); // 'value1value2' *
*/ - public function append($key, $value) {} + public function append($key, string $value) + { + } /** * Return a substring of a larger string @@ -2506,7 +2703,9 @@ public function append($key, $value) {} * $redis->getRange('key', -5, -1); // 'value' *
*/ - public function getRange($key, $start, $end) {} + public function getRange($key, $start, $end) + { + } /** * Return a substring of a larger string @@ -2518,7 +2717,9 @@ public function getRange($key, $start, $end) {} * @throws RedisException */ #[Deprecated] - public function substr($key, $start, $end) {} + public function substr($key, $start, $end) + { + } /** * Changes a substring of a larger string. @@ -2527,7 +2728,7 @@ public function substr($key, $start, $end) {} * @param int $offset * @param string $value * - * @return int|Redis the length of the string after it was modified or Redis if in multimode + * @return false|int|Redis the length of the string after it was modified or Redis if in multimode * * @throws RedisException * @@ -2539,13 +2740,15 @@ public function substr($key, $start, $end) {} * $redis->get('key'); // "Hello redis" *
*/ - public function setRange($key, $offset, $value) {} + public function setRange($key, $offset, $value) + { + } /** * Get the length of a string value. * * @param string $key - * @return int|Redis returns Redis if in multimode + * @return false|int|Redis returns Redis if in multimode * * @throws RedisException * @@ -2556,7 +2759,9 @@ public function setRange($key, $offset, $value) {} * $redis->strlen('key'); // 5 *
*/ - public function strlen($key) {} + public function strlen($key) + { + } /** * Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the @@ -2568,7 +2773,7 @@ public function strlen($key) {} * @param int $start * @param int $end * - * @return int|Redis The command returns the position of the first bit set to 1 or 0 according to the request or Redis if in multimode + * @return false|int|Redis The command returns the position of the first bit set to 1 or 0 according to the request or Redis if in multimode * If we look for set bits (the bit argument is 1) and the string is empty or composed of just * zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string * only contains bit set to 1, the function returns the first bit not part of the string on the @@ -2593,7 +2798,9 @@ public function strlen($key) {} * $redis->bitpos('key', 0, 1, 5); // int(-1) *
*/ - public function bitpos($key, $bit, $start = 0, $end = -1) {} + public function bitpos($key, $bit, $start = 0, $end = -1) + { + } /** * Return a single bit out of a larger string @@ -2601,7 +2808,7 @@ public function bitpos($key, $bit, $start = 0, $end = -1) {} * @param string $key * @param int $offset * - * @return int|Redis the bit value (0 or 1) or Redis if in multimode + * @return false|int|Redis the bit value (0 or 1) or Redis if in multimode * * @throws RedisException * @@ -2613,7 +2820,9 @@ public function bitpos($key, $bit, $start = 0, $end = -1) {} * $redis->getBit('key', 1); // 1 *
*/ - public function getBit($key, $offset) {} + public function getBit($key, $offset) + { + } /** * Changes a single bit of a string. @@ -2622,7 +2831,7 @@ public function getBit($key, $offset) {} * @param int $offset * @param bool|int $value bool or int (1 or 0) * - * @return int|Redis 0 or 1, the value of the bit before it was set or Redis if in multimode + * @return false|int|Redis 0 or 1, the value of the bit before it was set or Redis if in multimode * * @throws RedisException * @@ -2635,7 +2844,9 @@ public function getBit($key, $offset) {} * $redis->get('key'); // chr(0x2f) = "/" = b("0010 1111") *
*/ - public function setBit($key, $offset, $value) {} + public function setBit($key, $offset, $value) + { + } /** * Count bits in a string @@ -2644,7 +2855,7 @@ public function setBit($key, $offset, $value) {} * @param int $start * @param int $end * - * @return int|Redis The number of bits set to 1 in the value behind the input key or Redis if in multimode + * @return false|int|Redis The number of bits set to 1 in the value behind the input key or Redis if in multimode * * @throws RedisException * @@ -2658,7 +2869,9 @@ public function setBit($key, $offset, $value) {} * var_dump( $redis->bitCount('bit', 0, 2) ); // int(11) *
*/ - public function bitCount($key, $start = 0, $end = -1) {} + public function bitCount($key, $start = 0, $end = -1) + { + } /** * Bitwise operation on multiple keys. @@ -2668,7 +2881,7 @@ public function bitCount($key, $start = 0, $end = -1) {} * @param string $key1 first key * @param string ...$otherKeys variadic list of keys * - * @return int|Redis The size of the string stored in the destination key or Redis if in multimode + * @return False|int|Redis The size of the string stored in the destination key or Redis if in multimode * * @throws RedisException * @@ -2684,7 +2897,9 @@ public function bitCount($key, $start = 0, $end = -1) {} * $redis->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11 *
*/ - public function bitOp($operation, $retKey, $key1, ...$otherKeys) {} + public function bitOp($operation, $retKey, $key1, ...$otherKeys) + { + } /** * Removes all entries from the current database. @@ -2696,7 +2911,9 @@ public function bitOp($operation, $retKey, $key1, ...$otherKeys) {} * @link https://redis.io/commands/flushdb * @example $redis->flushDB(); */ - public function flushDB($async = null) {} + public function flushDB($async = null) + { + } /** * Removes all entries from all databases. @@ -2710,7 +2927,9 @@ public function flushDB($async = null) {} * @link https://redis.io/commands/flushall * @example $redis->flushAll(); */ - public function flushAll($async = null) {} + public function flushAll($async = null) + { + } /** * Sort @@ -2744,7 +2963,9 @@ public function flushAll($async = null) {} * var_dump($redis->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5 *
*/ - public function sort($key, $option = null) {} + public function sort($key, $option = null) + { + } /** * Returns an associative array of strings and integers @@ -2811,7 +3032,9 @@ public function sort($key, $option = null) {} * $redis->info("CPU"); // just CPU information from Redis INFO *
*/ - public function info($option = null) {} + public function info($option = null) + { + } /** * Returns an indexed array whose first element is the role @@ -2826,7 +3049,9 @@ public function info($option = null) {} * $redis->role(); *
*/ - public function role() {} + public function role() + { + } /** * Resets the statistics reported by Redis using the INFO command (`info()` function). @@ -2845,7 +3070,9 @@ public function role() {} * @link https://redis.io/commands/config-resetstat */ #[Deprecated(replacement: '%class%->rawCommand(\'CONFIG\', \'RESETSTAT\');')] - public function resetStat() {} + public function resetStat() + { + } /** * Returns the time to live left for a given key, in seconds. If the key doesn't exist, FALSE is returned. @@ -2863,7 +3090,9 @@ public function resetStat() {} * $redis->ttl('key'); // int(123) *
*/ - public function ttl($key) {} + public function ttl($key) + { + } /** * Returns a time to live left for a given key, in milliseconds. @@ -2883,7 +3112,9 @@ public function ttl($key) {} * $redis->pttl('key'); // int(122999) *
*/ - public function pttl($key) {} + public function pttl($key) + { + } /** * Remove the expiration timer from a key. @@ -2897,13 +3128,15 @@ public function pttl($key) {} * @link https://redis.io/commands/persist * @example $redis->persist('key'); */ - public function persist($key) {} + public function persist($key) + { + } /** * Sets multiple key-value pairs in one atomic command. * MSETNX only returns TRUE if all the keys were set (see SETNX). * - * @param array $array Pairs: array(key => value, ...) + * @param array $array Pairs: array(key => value, ...) * * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * @@ -2920,7 +3153,9 @@ public function persist($key) {} * // string(6) "value1" *
*/ - public function mSet(array $array) {} + public function mSet($array) + { + } /** * Get the values of all the specified keys. @@ -2942,7 +3177,9 @@ public function mSet(array $array) {} *
*/ #[Deprecated(replacement: '%class%->mGet(%parametersList%)')] - public function getMultiple(array $keys) {} + public function getMultiple(array $keys) + { + } /** * Returns the values of all specified keys. @@ -2952,7 +3189,7 @@ public function getMultiple(array $keys) {} * * @param array $array * - * @return array|Redis returns Redis if in multimode + * @return false|list|Redis returns Redis if in multimode * * @throws RedisException * @@ -2972,18 +3209,22 @@ public function getMultiple(array $keys) {} * // } *
*/ - public function mGet(array $array) {} + public function mGet(array $array) + { + } /** * @see mset() - * @param array $array - * @return int|Redis 1 (if the keys were set) or 0 (no key was set) or Redis if in multimode + * @param array $array + * @return false|int|Redis 1 (if the keys were set) or 0 (no key was set) or Redis if in multimode * * @throws RedisException * * @link https://redis.io/commands/msetnx */ - public function msetnx(array $array) {} + public function msetnx(array $array) + { + } /** * Pops a value from the tail of a list, and pushes it to the front of another list. @@ -3030,7 +3271,9 @@ public function msetnx(array $array) {} * //} *
*/ - public function rPopLPush($srcKey, $dstKey) {} + public function rPopLPush($srcKey, $dstKey) + { + } /** * A blocking version of rPopLPush, with an integral timeout in the third parameter. @@ -3045,7 +3288,9 @@ public function rPopLPush($srcKey, $dstKey) {} * * @link https://redis.io/commands/brpoplpush */ - public function bRPopLPush($srcKey, $dstKey, $timeout) {} + public function bRPopLPush($srcKey, $dstKey, $timeout) + { + } /** * Adds the specified member with a given score to the sorted set stored at key @@ -3059,7 +3304,7 @@ public function bRPopLPush($srcKey, $dstKey, $timeout) {} * @param float|string|mixed $scoreN Optional score or value if options omitted * @param string|float|mixed $valueN Optional value or score if options omitted * - * @return int|Redis Number of values added or Redis if in multimode + * @return false|int|Redis Number of values added or Redis if in multimode * * @throws RedisException * @@ -3091,7 +3336,9 @@ public function bRPopLPush($srcKey, $dstKey, $timeout) {} * // ["v6"]=> float(8) *
*/ - public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) {} + public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) + { + } /** * Returns a range of elements from the ordered set stored at the specified key, @@ -3121,7 +3368,9 @@ public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $v * $redis->zRange('key1', 0, -1, true); // array('val0' => 0, 'val2' => 2, 'val10' => 10) *
*/ - public function zRange($key, $start, $end, $withscores = null) {} + public function zRange($key, $start, $end, $withscores = null) + { + } /** * Deletes a specified member from the ordered set. @@ -3130,7 +3379,7 @@ public function zRange($key, $start, $end, $withscores = null) {} * @param string|mixed $member1 * @param string|mixed ...$otherMembers * - * @return int|Redis Number of deleted values or Redis if in multimode + * @return false|int|Redis Number of deleted values or Redis if in multimode * * @throws RedisException * @@ -3147,7 +3396,9 @@ public function zRange($key, $start, $end, $withscores = null) {} * // } *
*/ - public function zRem($key, $member1, ...$otherMembers) {} + public function zRem($key, $member1, ...$otherMembers) + { + } /** * @link https://redis.io/commands/zrem @@ -3156,12 +3407,14 @@ public function zRem($key, $member1, ...$otherMembers) {} * @param string|mixed $member1 * @param string|mixed ...$otherMembers * - * @return int|Redis Number of deleted values or Redis if in multimode + * @return false|int|Redis Number of deleted values or Redis if in multimode * * @throws RedisException */ #[Deprecated(replacement: '%class%->zRem(%parametersList%)')] - public function zDelete($key, $member1, ...$otherMembers) {} + public function zDelete($key, $member1, ...$otherMembers) + { + } /** * Returns the elements of the sorted set stored at the specified key in the range [start, end] @@ -3192,7 +3445,9 @@ public function zDelete($key, $member1, ...$otherMembers) {} * $redis->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0) *
*/ - public function zRevRange($key, $start, $end, $withscore = null) {} + public function zRevRange($key, $start, $end, $withscore = null) + { + } /** * Returns the elements of the sorted set stored at the specified key which have scores in the @@ -3224,20 +3479,24 @@ public function zRevRange($key, $start, $end, $withscore = null) {} * $redis->zRangeByScore('key', 0, 3, array('withscores' => TRUE, 'limit' => array(1, 1)); // array('val2' => 2) *
*/ - public function zRangeByScore($key, $start, $end, array $options = []) {} + public function zRangeByScore($key, $start, $end, array $options = []) + { + } /** - * @see zRangeByScore() * @param string $key - * @param int $start - * @param int $end - * @param array $options + * @param string $start + * @param string $end + * @param array $options * * @return array|Redis returns Redis if in multimode * * @throws RedisException + * @see zRangeByScore() */ - public function zRevRangeByScore($key, $start, $end, array $options = []) {} + public function zRevRangeByScore(string $key, string $start, string $end, array $options = []) + { + } /** * Returns a lexigraphical range of members in a sorted set, assuming the members have the same score. The @@ -3245,11 +3504,11 @@ public function zRevRangeByScore($key, $start, $end, array $options = []) {} * '-' (negative inf) or '+' (positive inf). The command must be called with either three *or* five * arguments or will return FALSE. * - * @param string $key The ZSET you wish to run against. - * @param int $min The minimum alphanumeric value you wish to get. - * @param int $max The maximum alphanumeric value you wish to get. - * @param int $offset Optional argument if you wish to start somewhere other than the first element. - * @param int $limit Optional argument if you wish to limit the number of elements returned. + * @param string $key The ZSET you wish to run against. + * @param string $min The minimum alphanumeric value you wish to get. + * @param string $max The maximum alphanumeric value you wish to get. + * @param int $offset Optional argument if you wish to start somewhere other than the first element. + * @param int $limit Optional argument if you wish to limit the number of elements returned. * * @return array|false|Redis Array containing the values in the specified range or Redis if in multimode * @@ -3267,23 +3526,59 @@ public function zRevRangeByScore($key, $start, $end, array $options = []) {} * $redis->zRangeByLex('key', '-', '[c'); // array('b', 'c') *
*/ - public function zRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} + public function zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) + { + } + + public function zMscore(string $key, string $member, string ...$other_members): array|false + { + } + + public function zPopMax(string $key, int $value = null): array|false + { + } + + public function zPopMin(string $key, int $value = null): array|false + { + } + + public function zRandMember(string $key, array $options = null): string|array|false + { + } /** - * @see zRangeByLex() - * @param string $key - * @param int $min - * @param int $max - * @param int $offset - * @param int $limit + * @param string $key + * @param string $min + * @param string $max + * @param int $offset + * @param int $limit * - * @return array|Redis returns Redis if in multimode + * @return false|array|Redis returns Redis if in multimode * * @throws RedisException * + * @see zRangeByLex() * @link https://redis.io/commands/zrevrangebylex */ - public function zRevRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} + public function zRevRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) + { + } + + /** + * Removes all elements in the sorted set stored at key between the lexicographical range specified by min and max. + * Applies when all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering. + * + * @param string $key The ZSET you wish to run against. + * @param string $min The minimum alphanumeric value you wish to get. + * @param string $max The maximum alphanumeric value you wish to get. + * + * @return int|false the number of elements removed. + * @link https://redis.io/commands/zremrangebylex + */ + public function zRemRangeByLex(string $key, string $min, string $max) + { + } + /** * Returns the number of elements of the sorted set stored at the specified key which have @@ -3294,7 +3589,7 @@ public function zRevRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} * @param string $start * @param string $end * - * @return int|Redis the size of a corresponding zRangeByScore or Redis if in multimode + * @return false|int|Redis the size of a corresponding zRangeByScore or Redis if in multimode * * @throws RedisException * @@ -3307,7 +3602,9 @@ public function zRevRangeByLex($key, $min, $max, $offset = -1, $limit = -1) {} * $redis->zCount('key', 0, 3); // 2, corresponding to array('val0', 'val2') *
*/ - public function zCount($key, $start, $end) {} + public function zCount($key, $start, $end) + { + } /** * Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end]. @@ -3316,7 +3613,7 @@ public function zCount($key, $start, $end) {} * @param string $start double or "+inf" or "-inf" as a string * @param string $end double or "+inf" or "-inf" as a string * - * @return int|Redis The number of values deleted from the sorted set or Redis if in multimode + * @return false|int|Redis The number of values deleted from the sorted set or Redis if in multimode * * @throws RedisException * @@ -3329,7 +3626,9 @@ public function zCount($key, $start, $end) {} * $redis->zRemRangeByScore('key', '0', '3'); // 2 *
*/ - public function zRemRangeByScore($key, $start, $end) {} + public function zRemRangeByScore($key, $start, $end) + { + } /** * @param string $key @@ -3339,7 +3638,9 @@ public function zRemRangeByScore($key, $start, $end) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->zRemRangeByScore(%parametersList%)')] - public function zDeleteRangeByScore($key, $start, $end) {} + public function zDeleteRangeByScore($key, $start, $end) + { + } /** * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. @@ -3348,7 +3649,7 @@ public function zDeleteRangeByScore($key, $start, $end) {} * @param int $start * @param int $end * - * @return int|Redis The number of values deleted from the sorted set or Redis if in multimode + * @return false|int|Redis The number of values deleted from the sorted set or Redis if in multimode * * @throws RedisException * @@ -3362,7 +3663,9 @@ public function zDeleteRangeByScore($key, $start, $end) {} * $redis->zRange('key', 0, -1, array('withscores' => TRUE)); // array('three' => 3) *
*/ - public function zRemRangeByRank($key, $start, $end) {} + public function zRemRangeByRank($key, $start, $end) + { + } /** * @link https://redis.io/commands/zremrangebyscore @@ -3374,14 +3677,16 @@ public function zRemRangeByRank($key, $start, $end) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->zRemRangeByRank(%parametersList%)')] - public function zDeleteRangeByRank($key, $start, $end) {} + public function zDeleteRangeByRank($key, $start, $end) + { + } /** * Returns the cardinality of an ordered set. * * @param string $key * - * @return int|Redis the set's cardinality or Redis if in multimode + * @return false|int|Redis the set's cardinality or Redis if in multimode * * @throws RedisException * @@ -3394,16 +3699,24 @@ public function zDeleteRangeByRank($key, $start, $end) {} * $redis->zCard('key'); // 3 *
*/ - public function zCard($key) {} + public function zCard($key) + { + } + + public function zdiff(array $keys, array $options = null): array|false + { + } /** * @param string $key - * @return int|Redis returns Redis if in multimode + * @return false|int|Redis returns Redis if in multimode * * @throws RedisException */ #[Deprecated(replacement: '%class%->zCard(%parametersList%)')] - public function zSize($key) {} + public function zSize($key) + { + } /** * Returns the score of a given member in the specified sorted set. @@ -3422,7 +3735,9 @@ public function zSize($key) {} * $redis->zScore('key', 'val2'); // 2.5 *
*/ - public function zScore($key, $member) {} + public function zScore($key, $member) + { + } /** * Returns the rank of a given member in the specified sorted set, starting at 0 for the item @@ -3447,7 +3762,9 @@ public function zScore($key, $member) {} * $redis->zRevRank('key', 'two'); // 0 *
*/ - public function zRank($key, $member) {} + public function zRank($key, $member) + { + } /** * @see zRank() @@ -3460,7 +3777,9 @@ public function zRank($key, $member) {} * * @link https://redis.io/commands/zrevrank */ - public function zRevRank($key, $member) {} + public function zRevRank($key, $member) + { + } /** * Increments the score of a member from a sorted set by a given amount. @@ -3482,7 +3801,9 @@ public function zRevRank($key, $member) {} * $redis->zIncrBy('key', 1, 'member1'); // 3.5 *
*/ - public function zIncrBy($key, $value, $member) {} + public function zIncrBy($key, $value, $member) + { + } /** * Creates an union of sorted sets given in second argument. @@ -3498,7 +3819,7 @@ public function zIncrBy($key, $value, $member) {} * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": defines the behaviour to use on * duplicate entries during the zUnionStore * - * @return int|Redis The number of values in the new sorted set or Redis if in multimode + * @return false|int|Redis The number of values in the new sorted set or Redis if in multimode * * @throws RedisException * @@ -3525,7 +3846,9 @@ public function zIncrBy($key, $value, $member) {} * $redis->zUnionStore('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1') *
*/ - public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggregateFunction = null) {} + public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggregateFunction = null) + { + } /** * @param string $Output @@ -3536,7 +3859,9 @@ public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggrega * @throws RedisException */ #[Deprecated(replacement: '%class%->zUnionStore(%parametersList%)')] - public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} + public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + { + } /** * Creates an intersection of sorted sets given in second argument. @@ -3552,7 +3877,7 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": * defines the behaviour to use on duplicate entries during the zInterStore. * - * @return int|Redis The number of values in the new sorted set or Redis if in multimode + * @return false|int|Redis The number of values in the new sorted set or Redis if in multimode * * @throws RedisException * @@ -3583,7 +3908,9 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * $redis->zInterStore('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1') *
*/ - public function zInterStore($output, $zSetKeys, array $weights = null, $aggregateFunction = null) {} + public function zInterStore($output, $zSetKeys, array $weights = null, $aggregateFunction = null) + { + } /** * @param $Output @@ -3593,7 +3920,9 @@ public function zInterStore($output, $zSetKeys, array $weights = null, $aggregat * @throws RedisException */ #[Deprecated(replacement: '%class%->zInterStore(%parametersList%)')] - public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} + public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + { + } /** * Scan a sorted set for members, with optional pattern and count @@ -3618,7 +3947,9 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * } *
*/ - public function zScan($key, &$iterator, $pattern = null, $count = 0) {} + public function zScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Block until Redis can pop the highest or lowest scoring members from one or more ZSETs. @@ -3628,7 +3959,7 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * @param string|int|array $timeout_or_key ... * @param mixed ...$extra_args * - * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode + * @return false|array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode * if the timeout was reached without an element to pop. * * @throws RedisException @@ -3646,14 +3977,16 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * $redis->bzPopMax('zs1', 'zs2', 5); *
*/ - public function bzPopMax($key, $timeout_or_key, ...$extra_args) {} + public function bzPopMax($key, $timeout_or_key, ...$extra_args) + { + } /** * @param string|array $key * @param string|int|array $timeout_or_key ... * @param mixed ...$extra_args * - * @return array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode + * @return false|array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode * if the timeout was reached without an element to pop. * * @throws RedisException @@ -3662,7 +3995,9 @@ public function bzPopMax($key, $timeout_or_key, ...$extra_args) {} * @since >= 5.0 * @link https://redis.io/commands/bzpopmin */ - public function bzPopMin($key, $timeout_or_key, ...$extra_args) {} + public function bzPopMin($key, $timeout_or_key, ...$extra_args) + { + } /** * Can pop the highest scoring members from one ZSET. @@ -3685,7 +4020,9 @@ public function bzPopMin($key, $timeout_or_key, ...$extra_args) {} * $redis->zPopMax('zs1', 3); *
*/ - public function zPopMax($key, $count = null) {} + public function zPopMax($key, $count = null) + { + } /** * Can pop the lowest scoring members from one ZSET. @@ -3708,7 +4045,9 @@ public function zPopMax($key, $count = null) {} * $redis->zPopMin('zs1', 3); *
*/ - public function zPopMin($key, $count = null) {} + public function zPopMin($key, $count = null) + { + } /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. @@ -3734,7 +4073,9 @@ public function zPopMin($key, $count = null) {} * $redis->hGet('h', 'key1'); // returns "plop" *
*/ - public function hSet($key, $hashKey, $value) {} + public function hSet($key, $hashKey, string $value) + { + } /** * Adds a value to the hash stored at key only if this field isn't already in the hash. @@ -3756,7 +4097,9 @@ public function hSet($key, $hashKey, $value) {} * wasn't replaced. *
*/ - public function hSetNx($key, $hashKey, $value) {} + public function hSetNx($key, $hashKey, $value) + { + } /** * Gets a value from the hash stored at key. @@ -3771,7 +4114,9 @@ public function hSetNx($key, $hashKey, $value) {} * * @link https://redis.io/commands/hget */ - public function hGet($key, $hashKey) {} + public function hGet($key, $hashKey) + { + } /** * Returns the length of a hash, in number of items @@ -3791,7 +4136,9 @@ public function hGet($key, $hashKey) {} * $redis->hLen('h'); // returns 2 *
*/ - public function hLen($key) {} + public function hLen($key) + { + } /** * Removes a values from the hash stored at key. @@ -3826,7 +4173,9 @@ public function hLen($key) {} * // } *
*/ - public function hDel($key, $hashKey1, ...$otherHashKeys) {} + public function hDel($key, $hashKey1, ...$otherHashKeys) + { + } /** * Returns the keys in a hash, as an array of strings. @@ -3861,7 +4210,9 @@ public function hDel($key, $hashKey1, ...$otherHashKeys) {} * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hKeys($key) {} + public function hKeys($key) + { + } /** * Returns the values in a hash, as an array of strings. @@ -3896,7 +4247,9 @@ public function hKeys($key) {} * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hVals($key) {} + public function hVals($key) + { + } /** * Returns the whole hash, as an array of strings indexed by strings. @@ -3931,7 +4284,9 @@ public function hVals($key) {} * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hGetAll($key) {} + public function hGetAll($key) + { + } /** * Verify if the specified member exists in a key. @@ -3951,7 +4306,9 @@ public function hGetAll($key) {} * $redis->hExists('h', 'NonExistingKey'); // FALSE * */ - public function hExists($key, $hashKey) {} + public function hExists($key, $hashKey) + { + } /** * Increments the value of a member from a hash by a given amount. @@ -3960,7 +4317,7 @@ public function hExists($key, $hashKey) {} * @param string $hashKey * @param int $value (integer) value that will be added to the member's value * - * @return int|Redis the new value or Redis if in multimode + * @return false|int|Redis the new value or Redis if in multimode * * @throws RedisException * @@ -3972,7 +4329,9 @@ public function hExists($key, $hashKey) {} * $redis->hIncrBy('h', 'x', 1); // h[x] ← 2 + 1. Returns 3 * */ - public function hIncrBy($key, $hashKey, $value) {} + public function hIncrBy($key, $hashKey, $value) + { + } /** * Increment the float value of a hash field by the given amount @@ -4005,7 +4364,9 @@ public function hIncrBy($key, $hashKey, $value) {} * } * */ - public function hIncrByFloat($key, $field, $increment) {} + public function hIncrByFloat($key, $field, $increment) + { + } /** * Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast. @@ -4026,7 +4387,9 @@ public function hIncrByFloat($key, $field, $increment) {} * $redis->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now. * */ - public function hMSet($key, $hashKeys) {} + public function hMSet($key, $hashKeys) + { + } /** * Retrieve the values associated to the specified fields in the hash. @@ -4048,7 +4411,9 @@ public function hMSet($key, $hashKeys) {} * $redis->hMGet('h', array('field1', 'field2')); // returns array('field1' => 'value1', 'field2' => 'value2') * */ - public function hMGet($key, $hashKeys) {} + public function hMGet($key, $hashKeys) + { + } /** * Scan a HASH value for members, with an optional pattern and count. @@ -4073,7 +4438,9 @@ public function hMGet($key, $hashKeys) {} * // } * */ - public function hScan($key, &$iterator, $pattern = null, $count = 0) {} + public function hScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Get the string length of the value associated with field in the hash stored at key @@ -4081,7 +4448,7 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) {} * @param string $key * @param string $field * - * @return int|Redis the string length of the value associated with field, or zero when field is not present in the hash or Redis if in multimode + * @return false|int|Redis the string length of the value associated with field, or zero when field is not present in the hash or Redis if in multimode * or key does not exist at all. * * @throws RedisException @@ -4089,7 +4456,9 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) {} * @link https://redis.io/commands/hstrlen * @since >= 3.2 */ - public function hStrLen(string $key, string $field) {} + public function hStrLen(string $key, string $field) + { + } /** * Add one or more geospatial items to the specified key. @@ -4101,7 +4470,7 @@ public function hStrLen(string $key, string $field) {} * @param string $member * @param mixed ...$other_triples * - * @return int|Redis The number of elements added to the geospatial key or Redis if in multimode + * @return false|int|Redis The number of elements added to the geospatial key or Redis if in multimode * * @throws RedisException * @@ -4120,7 +4489,9 @@ public function hStrLen(string $key, string $field) {} * ); // 2 * */ - public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) {} + public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) + { + } /** * Retrieve Geohash strings for one or more elements of a geospatial index. @@ -4128,7 +4499,7 @@ public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) * @param string $key * @param string ...$member variadic list of members * - * @return array|Redis One or more Redis Geohash encoded strings or Redis if in multimode + * @return false|array|Redis One or more Redis Geohash encoded strings or Redis if in multimode * * @throws RedisException * @@ -4148,7 +4519,9 @@ public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) * // } * */ - public function geoHash($key, ...$member) {} + public function geoHash($key, ...$member) + { + } /** * Return longitude, latitude positions for each requested member. @@ -4181,7 +4554,17 @@ public function geoHash($key, ...$member) {} * } * */ - public function geoPos(string $key, string ...$member) {} + public function geoPos(string $key, string ...$member) + { + } + + public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false + { + } + + public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false + { + } /** * Return the distance between two members in a geospatial set. @@ -4234,7 +4617,9 @@ public function geoPos(string $key, string ...$member) {} * bool(false) * */ - public function geoDist($key, $member1, $member2, $unit = null) {} + public function geoDist($key, $member1, $member2, $unit = null) + { + } /** * Return members of a set with geospatial information that are within the radius specified by the caller. @@ -4336,7 +4721,9 @@ public function geoDist($key, $member1, $member2, $unit = null) {} * } * */ - public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $options = []) {} + public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $options = []) + { + } /** * This method is identical to geoRadius except that instead of passing a longitude and latitude as the "source" @@ -4378,7 +4765,9 @@ public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $op * } * */ - public function geoRadiusByMember($key, $member, $radius, $units, array $options = []) {} + public function geoRadiusByMember($key, $member, $radius, $units, array $options = []) + { + } /** * Get or Set the redis config keys. @@ -4398,7 +4787,9 @@ public function geoRadiusByMember($key, $member, $radius, $units, array $options * $redis->config("SET", "dir", "/var/run/redis/dumps/"); * */ - public function config($operation, $key, $value = null) {} + public function config($operation, $key, $value = null) + { + } /** * Evaluate a LUA script serverside @@ -4427,7 +4818,9 @@ public function config($operation, $key, $value = null) {} * $redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}"); * */ - public function eval($script, $args = [], $numKeys = 0) {} + public function eval($script, $args = [], $numKeys = 0) + { + } /** * @param string $script @@ -4438,7 +4831,9 @@ public function eval($script, $args = [], $numKeys = 0) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->eval(%parametersList%)')] - public function evaluate($script, $args = [], $numKeys = 0) {} + public function evaluate($script, $args = [], $numKeys = 0) + { + } /** * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. @@ -4462,7 +4857,9 @@ public function evaluate($script, $args = [], $numKeys = 0) {} * $redis->evalSha($sha); // Returns 1 * */ - public function evalSha($scriptSha, $args = [], $numKeys = 0) {} + public function evalSha($scriptSha, $args = [], $numKeys = 0) + { + } /** * @param string $scriptSha @@ -4472,7 +4869,9 @@ public function evalSha($scriptSha, $args = [], $numKeys = 0) {} * @throws RedisException */ #[Deprecated(replacement: '%class%->evalSha(%parametersList%)')] - public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {} + public function evaluateSha($scriptSha, $args = [], $numKeys = 0) + { + } /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. @@ -4500,7 +4899,9 @@ public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {} * SCRIPT KILL will return true if a script was able to be killed and false if not * SCRIPT EXISTS will return an array with TRUE or FALSE for each passed script */ - public function script($command, ...$script) {} + public function script($command, ...$script) + { + } /** * The last error message (if any) @@ -4516,7 +4917,9 @@ public function script($command, ...$script) {} * // "ERR Error compiling script (new function): user_script:1: '=' expected near '-'" * */ - public function getLastError() {} + public function getLastError() + { + } /** * Clear the last error message @@ -4536,7 +4939,9 @@ public function getLastError() {} * // NULL * */ - public function clearLastError() {} + public function clearLastError() + { + } /** * Issue the CLIENT command with various arguments. @@ -4571,7 +4976,9 @@ public function clearLastError() {} * $redis->client('kill', ); // Kill the process at ip:port * */ - public function client($command, $value = null) {} + public function client($command, $value = null) + { + } /** * A utility method to prefix the value with the prefix setting for phpredis. @@ -4589,7 +4996,9 @@ public function client($command, $value = null) {} * $redis->_prefix('my-value'); // Will return 'my-prefix:my-value' * */ - public function _prefix($value) {} + public function _prefix($value) + { + } /** * A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the @@ -4606,7 +5015,9 @@ public function _prefix($value) {} * $redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3) * */ - public function _unserialize($value) {} + public function _unserialize($value) + { + } /** * A utility method to serialize values manually. This method allows you to serialize a value with whatever @@ -4628,7 +5039,9 @@ public function _unserialize($value) {} * $redis->_serialize("foo"); // Returns 's:3:"foo";' * */ - public function _serialize($value) {} + public function _serialize($value) + { + } /** * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. @@ -4646,7 +5059,9 @@ public function _serialize($value) {} * $val = $redis->dump('foo'); // $val will be the Redis encoded key value * */ - public function dump($key) {} + public function dump($key) + { + } /** * Restore a key from the result of a DUMP operation. @@ -4667,7 +5082,9 @@ public function dump($key) {} * $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo' * */ - public function restore($key, $ttl, $value) {} + public function restore($key, $ttl, $value) + { + } /** * Migrates a key to a different Redis instance. @@ -4690,12 +5107,14 @@ public function restore($key, $ttl, $value) {} * $redis->migrate('backup', 6379, 'foo', 0, 3600); * */ - public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) {} + public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) + { + } /** * Return the current Redis server time. * - * @return array If successful, the time will come back as an associative array with element zero being the + * @return false|array If successful, the time will come back as an associative array with element zero being the * unix timestamp, and element one being microseconds. * * @throws RedisException @@ -4710,7 +5129,9 @@ public function migrate($host, $port, $key, $db, $timeout, $copy = false, $repla * // } * */ - public function time() {} + public function time() + { + } /** * Scan the keyspace for keys @@ -4734,7 +5155,9 @@ public function time() {} * } * */ - public function scan(&$iterator, $pattern = null, $count = 0) {} + public function scan(&$iterator, $pattern = null, $count = 0) + { + } /** * Adds all the element arguments to the HyperLogLog data structure stored at the key. @@ -4749,7 +5172,9 @@ public function scan(&$iterator, $pattern = null, $count = 0) {} * @link https://redis.io/commands/pfadd * @example $redis->pfAdd('key', array('elem1', 'elem2')) */ - public function pfAdd($key, array $elements) {} + public function pfAdd($key, array $elements) + { + } /** * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data @@ -4757,7 +5182,7 @@ public function pfAdd($key, array $elements) {} * * @param string|array $key * - * @return int|Redis returns Redis if in multimode + * @return false|int|Redis returns Redis if in multimode * * @throws RedisException * @@ -4770,7 +5195,9 @@ public function pfAdd($key, array $elements) {} * $redis->pfCount(array('key1', 'key2')); // int(3) * */ - public function pfCount($key) {} + public function pfCount($key) + { + } /** * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality @@ -4792,7 +5219,9 @@ public function pfCount($key) {} * $redis->pfCount('key3'); // int(3) * */ - public function pfMerge($destKey, array $sourceKeys) {} + public function pfMerge($destKey, array $sourceKeys) + { + } /** * Send arbitrary things to the redis server. @@ -4810,18 +5239,22 @@ public function pfMerge($destKey, array $sourceKeys) {} * $redis->rawCommand('GET", 'key'); // string(5) "value" * */ - public function rawCommand($command, ...$arguments) {} + public function rawCommand($command, ...$arguments) + { + } /** * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. * - * @return int|Redis Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE or Redis if in multimode + * @return false|int|Redis Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE or Redis if in multimode * * @throws RedisException * * @example $redis->getMode(); */ - public function getMode() {} + public function getMode() + { + } /** * Acknowledge one or more messages on behalf of a consumer group. @@ -4830,7 +5263,7 @@ public function getMode() {} * @param string $group * @param array $messages * - * @return int|Redis The number of messages Redis reports as acknowledged or Redis if in multimode + * @return false|int|Redis The number of messages Redis reports as acknowledged or Redis if in multimode * * @throws RedisException * @@ -4840,7 +5273,9 @@ public function getMode() {} * $redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']); * */ - public function xAck($stream, $group, $messages) {} + public function xAck($stream, $group, $messages) + { + } /** * Add a message to a stream @@ -4864,7 +5299,9 @@ public function xAck($stream, $group, $messages) {} * $redis->xAdd('mystream', "*", ['field' => 'value'], 10, true); * */ - public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) {} + public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) + { + } /** * Claim ownership of one or more pending messages @@ -4872,11 +5309,11 @@ public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, * @param string $key * @param string $group * @param string $consumer - * @param int $minIdleTime + * @param int $min_iddle * @param array $ids * @param array $options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID'] * - * @return array|Redis Either an array of message IDs along with corresponding data, or just an array of IDs or Redis if in multimode + * @return false|array|Redis Either an array of message IDs along with corresponding data, or just an array of IDs or Redis if in multimode * (if the 'JUSTID' option was passed). * * @throws RedisException @@ -4901,7 +5338,9 @@ public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, * ); * */ - public function xClaim($key, $group, $consumer, $minIdleTime, $ids, $options = []) {} + public function xClaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options) + { + } /** * Delete one or more messages from a stream @@ -4909,7 +5348,7 @@ public function xClaim($key, $group, $consumer, $minIdleTime, $ids, $options = [ * @param string $key * @param array $ids * - * @return int|Redis The number of messages removed or Redis if in multimode + * @return false|int|Redis The number of messages removed or Redis if in multimode * * @throws RedisException * @@ -4919,7 +5358,9 @@ public function xClaim($key, $group, $consumer, $minIdleTime, $ids, $options = [ * $redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']); * */ - public function xDel($key, $ids) {} + public function xDel($key, $ids) + { + } /** * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER' @@ -4940,7 +5381,9 @@ public function xDel($key, $ids) {} * $redis->xGroup('DESTROY', 'mystream', 'mygroup'); * */ - public function xGroup($operation, $key = null, $group = null, $msgId = null, $mkStream = false) {} + public function xGroup($operation, $key = null, $group = null, $msgId = null, $mkStream = false) + { + } /** * Get information about a stream or consumer groups @@ -4959,14 +5402,16 @@ public function xGroup($operation, $key = null, $group = null, $msgId = null, $m * $redis->xInfo('STREAM', 'mystream'); * */ - public function xInfo($operation, $stream = null, $group = null) {} + public function xInfo($operation, $stream = null, $group = null) + { + } /** * Get the length of a given stream. * * @param string $stream * - * @return int|Redis The number of messages in the stream or Redis if in multimode + * @return false|int|Redis The number of messages in the stream or Redis if in multimode * * @throws RedisException * @@ -4976,7 +5421,9 @@ public function xInfo($operation, $stream = null, $group = null) {} * $redis->xLen('mystream'); * */ - public function xLen($stream) {} + public function xLen($stream) + { + } /** * Get information about pending messages in a given stream @@ -5000,7 +5447,9 @@ public function xLen($stream) {} * $redis->xPending('mystream', 'mygroup', '-', '+', 1, 'consumer-1'); * */ - public function xPending($stream, $group, $start = null, $end = null, $count = -1, $consumer = null) {} + public function xPending($stream, $group, $start = null, $end = null, $count = -1, $consumer = null) + { + } /** * Get a range of messages from a given stream @@ -5023,7 +5472,9 @@ public function xPending($stream, $group, $start = null, $end = null, $count = - * $redis->xRange('mystream', '-', '+', 2); * */ - public function xRange($stream, $start, $end, $count = -1) {} + public function xRange($stream, $start, $end, $count = -1) + { + } /** * Read data from one or more streams and only return IDs greater than sent in the command. @@ -5042,7 +5493,9 @@ public function xRange($stream, $start, $end, $count = -1) {} * $redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']); * */ - public function xRead($streams, $count = -1, $block = -1) {} + public function xRead($streams, $count = -1, $block = -1) + { + } /** * This method is similar to xRead except that it supports reading messages for a specific consumer group. @@ -5066,7 +5519,9 @@ public function xRead($streams, $count = -1, $block = -1) {} * $redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000); * */ - public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) {} + public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) + { + } /** * This is identical to xRange except the results come back in reverse order. @@ -5087,7 +5542,9 @@ public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) * $redis->xRevRange('mystream', '+', '-'); * */ - public function xRevRange($stream, $end, $start, $count = -1) {} + public function xRevRange($stream, $end, $start, $count = -1) + { + } /** * Trim the stream length to a given maximum. @@ -5098,7 +5555,7 @@ public function xRevRange($stream, $end, $start, $count = -1) {} * @param int $maxLen * @param bool $isApproximate * - * @return int|Redis The number of messages trimed from the stream or Redis if in multimode + * @return false|int|Redis The number of messages trimed from the stream or Redis if in multimode * * @throws RedisException * @@ -5111,7 +5568,9 @@ public function xRevRange($stream, $end, $start, $count = -1) {} * $redis->xTrim('mystream', 100, true); * */ - public function xTrim($stream, $maxLen, $isApproximate) {} + public function xTrim($stream, $maxLen, $isApproximate) + { + } /** * Adds a values to the set value stored at key. @@ -5133,7 +5592,11 @@ public function xTrim($stream, $maxLen, $isApproximate) {} * $redis->sAddArray('k', array('v1', 'v2', 'v3')); // boolean * */ - public function sAddArray($key, array $values) {} + public function sAddArray($key, array $values) + { + } } -class RedisException extends Exception {} +class RedisException extends Exception +{ +} diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index d8f9feee5..402eae4b4 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -105,12 +105,16 @@ class RedisCluster * $redisClusterDev = new RedisCluster('test'); * */ - public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null) {} + public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null) + { + } /** * Disconnects from the RedisCluster instance, except when pconnect is used. */ - public function close() {} + public function close() + { + } /** * Get the value related to the specified key @@ -126,7 +130,9 @@ public function close() {} * $redisCluster->get('key'); * */ - public function get($key) {} + public function get($key) + { + } /** * Set the string value in argument as value of the key. @@ -156,7 +162,9 @@ public function get($key) {} * $redisCluster->set('key', 'value', Array('xx', 'px'=>1000)); * */ - public function set($key, $value, $timeout = null) {} + public function set($key, $value, $timeout = null) + { + } /** * Returns the values of all specified keys. @@ -188,7 +196,9 @@ public function set($key, $value, $timeout = null) {} * // } * */ - public function mget(array $array) {} + public function mget(array $array) + { + } /** * Sets multiple key-value pairs in one atomic command. @@ -208,7 +218,9 @@ public function mget(array $array) {} * // string(6) "value1" * */ - public function mset(array $array) {} + public function mset(array $array) + { + } /** * @see mset() @@ -218,7 +230,9 @@ public function mset(array $array) {} * @return int 1 (if the keys were set) or 0 (no key was set) * @link https://redis.io/commands/msetnx */ - public function msetnx(array $array) {} + public function msetnx(array $array) + { + } /** * Remove specified keys. @@ -239,7 +253,9 @@ public function msetnx(array $array) {} * $redisCluster->del(array('key3', 'key4')); // return 2 * */ - public function del($key1, ...$otherKeys) {} + public function del($key1, ...$otherKeys) + { + } /** * Set the string value in argument as value of the key, with a time to live. @@ -255,7 +271,9 @@ public function del($key1, ...$otherKeys) {} * $redisCluster->setex('key', 3600, 'value'); // sets key → value, with 1h TTL. * */ - public function setex($key, $ttl, $value) {} + public function setex($key, $ttl, $value) + { + } /** * PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds @@ -272,7 +290,9 @@ public function setex($key, $ttl, $value) {} * $redisCluster->psetex('key', 1000, 'value'); // sets key → value, with 1s TTL. * */ - public function psetex($key, $ttl, $value) {} + public function psetex($key, $ttl, $value) + { + } /** * Set the string value in argument as value of the key if the key doesn't already exist in the database. @@ -288,7 +308,9 @@ public function psetex($key, $ttl, $value) {} * $redisCluster->setnx('key', 'value'); // return FALSE * */ - public function setnx($key, $value) {} + public function setnx($key, $value) + { + } /** * Sets a value and returns the previous entry at that key. @@ -305,7 +327,9 @@ public function setnx($key, $value) {} * $newValue = $redisCluster->get('x'); // return 'lol' * */ - public function getSet($key, $value) {} + public function getSet($key, $value) + { + } /** * Verify if the specified key exists. @@ -321,7 +345,9 @@ public function getSet($key, $value) {} * $redisCluster->exists('NonExistingKey'); // FALSE * */ - public function exists($key) {} + public function exists($key) + { + } /** * Returns the keys that match a certain pattern. @@ -336,7 +362,9 @@ public function exists($key) {} * $keyWithUserPrefix = $redisCluster->keys('user*'); * */ - public function keys($pattern) {} + public function keys($pattern) + { + } /** * Returns the type of data pointed by a given key. @@ -356,7 +384,9 @@ public function keys($pattern) {} * @link https://redis.io/commands/type * @example $redisCluster->type('key'); */ - public function type($key) {} + public function type($key) + { + } /** * Returns and removes the first element of the list. @@ -386,7 +416,9 @@ public function type($key) {} * // } * */ - public function lPop($key) {} + public function lPop($key) + { + } /** * Returns and removes the last element of the list. @@ -416,7 +448,9 @@ public function lPop($key) {} * // } * */ - public function rPop($key) {} + public function rPop($key) + { + } /** * Set the list at index with the new value. @@ -438,7 +472,9 @@ public function rPop($key) {} * $redisCluster->lGet('key1', 0); // 'X' * */ - public function lSet($key, $index, $value) {} + public function lSet($key, $index, $value) + { + } /** * Removes and returns a random element from the set value at Key. @@ -460,7 +496,9 @@ public function lSet($key, $index, $value) {} * var_dump($redisCluster->sMembers('key1'));// 'key1' => {'set2'} * */ - public function sPop($key) {} + public function sPop($key) + { + } /** * Adds the string values to the head (left) of the list. Creates the list if the key didn't exist. @@ -486,7 +524,9 @@ public function sPop($key) {} * // } * */ - public function lPush($key, $value1, $value2 = null, $valueN = null) {} + public function lPush($key, $value1, $value2 = null, $valueN = null) + { + } /** * Adds the string values to the tail (right) of the list. Creates the list if the key didn't exist. @@ -512,7 +552,9 @@ public function lPush($key, $value1, $value2 = null, $valueN = null) {} * // } * */ - public function rPush($key, $value1, $value2 = null, $valueN = null) {} + public function rPush($key, $value1, $value2 = null, $valueN = null) + { + } /** * BLPOP is a blocking list pop primitive. @@ -555,7 +597,9 @@ public function rPush($key, $value1, $value2 = null, $valueN = null) {} * // array('key1', 'A') is returned * */ - public function blPop(array $keys, $timeout) {} + public function blPop(array $keys, $timeout) + { + } /** * BRPOP is a blocking list pop primitive. @@ -601,7 +645,9 @@ public function blPop(array $keys, $timeout) {} * // array('key1', 'A') is returned * */ - public function brPop(array $keys, $timeout) {} + public function brPop(array $keys, $timeout) + { + } /** * Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure. @@ -621,7 +667,9 @@ public function brPop(array $keys, $timeout) {} * // key1 now points to the following list: [ 'A', 'B', 'C' ] * */ - public function rPushx($key, $value) {} + public function rPushx($key, $value) + { + } /** * Adds the string value to the head (left) of the list if the list exists. @@ -641,7 +689,9 @@ public function rPushx($key, $value) {} * // key1 now points to the following list: [ 'C', 'B', 'A' ] * */ - public function lPushx($key, $value) {} + public function lPushx($key, $value) + { + } /** * Insert value in the list before or after the pivot value. the parameter options @@ -673,7 +723,9 @@ public function lPushx($key, $value) {} * $redisCluster->lInsert('key1', RedisCluster::AFTER, 'W', 'value'); // -1 * */ - public function lInsert($key, $position, $pivot, $value) {} + public function lInsert($key, $position, $pivot, $value) + { + } /** * Return the specified element of the list stored at the specified key. @@ -696,7 +748,9 @@ public function lInsert($key, $position, $pivot, $value) {} * $redisCluster->lGet('key1', 10); // `FALSE` * */ - public function lIndex($key, $index) {} + public function lIndex($key, $index) + { + } /** * Removes the first count occurrences of the value element from the list. @@ -723,7 +777,9 @@ public function lIndex($key, $index) {} * $redisCluster->lRange('key1', 0, -1); // array('C', 'B', 'A') * */ - public function lRem($key, $value, $count) {} + public function lRem($key, $value, $count) + { + } /** * A blocking version of rpoplpush, with an integral timeout in the third parameter. @@ -735,7 +791,9 @@ public function lRem($key, $value, $count) {} * @return string|false The element that was moved in case of success, FALSE in case of timeout. * @link https://redis.io/commands/brpoplpush */ - public function brpoplpush($srcKey, $dstKey, $timeout) {} + public function brpoplpush($srcKey, $dstKey, $timeout) + { + } /** * Pops a value from the tail of a list, and pushes it to the front of another list. @@ -779,7 +837,9 @@ public function brpoplpush($srcKey, $dstKey, $timeout) {} * //} * */ - public function rpoplpush($srcKey, $dstKey) {} + public function rpoplpush($srcKey, $dstKey) + { + } /** * Returns the size of a list identified by Key. If the list didn't exist or is empty, @@ -800,7 +860,9 @@ public function rpoplpush($srcKey, $dstKey) {} * $redisCluster->lLen('key1'); // 2 * */ - public function lLen($key) {} + public function lLen($key) + { + } /** * Returns the set cardinality (number of elements) of the set stored at key. @@ -818,7 +880,9 @@ public function lLen($key) {} * $redisCluster->sCard('keyX'); // 0 * */ - public function sCard($key) {} + public function sCard($key) + { + } /** * Returns all the members of the set value stored at key. @@ -850,7 +914,9 @@ public function sCard($key) {} * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function sMembers($key) {} + public function sMembers($key) + { + } /** * Returns if member is a member of the set stored at key. @@ -870,7 +936,9 @@ public function sMembers($key) {} * $redisCluster->sIsMember('key1', 'setX'); // FALSE * */ - public function sIsMember($key, $value) {} + public function sIsMember($key, $value) + { + } /** * Adds a values to the set value stored at key. @@ -889,7 +957,9 @@ public function sIsMember($key, $value) {} * $redisCluster->sAdd('k', 'v1', 'v2', 'v3'); // int(2) * */ - public function sAdd($key, $value1, $value2 = null, $valueN = null) {} + public function sAdd($key, $value1, $value2 = null, $valueN = null) + { + } /** * Adds a values to the set value stored at key. @@ -905,7 +975,9 @@ public function sAdd($key, $value1, $value2 = null, $valueN = null) {} * //This is a feature in php only. Same as $redisCluster->sAdd('k', 'v1', 'v2', 'v3'); * */ - public function sAddArray($key, array $valueArray) {} + public function sAddArray($key, array $valueArray) + { + } /** * Removes the specified members from the set value stored at key. @@ -928,7 +1000,9 @@ public function sAddArray($key, array $valueArray) {} * // } * */ - public function sRem($key, $member1, $member2 = null, $memberN = null) {} + public function sRem($key, $member1, $member2 = null, $memberN = null) + { + } /** * Performs the union between N sets and returns it. @@ -966,7 +1040,9 @@ public function sRem($key, $member1, $member2 = null, $memberN = null) {} * //} * */ - public function sUnion($key1, $key2, $keyN = null) {} + public function sUnion($key1, $key2, $keyN = null) + { + } /** * Performs the same action as sUnion, but stores the result in the first key @@ -1007,7 +1083,9 @@ public function sUnion($key1, $key2, $keyN = null) {} * //} * */ - public function sUnionStore($dstKey, $key1, $key2, $keyN = null) {} + public function sUnionStore($dstKey, $key1, $key2, $keyN = null) + { + } /** * Returns the members of a set resulting from the intersection of all the sets @@ -1046,7 +1124,9 @@ public function sUnionStore($dstKey, $key1, $key2, $keyN = null) {} * //} * */ - public function sInter($key1, $key2, $keyN = null) {} + public function sInter($key1, $key2, $keyN = null) + { + } /** * Performs a sInter command and stores the result in a new set. @@ -1085,7 +1165,9 @@ public function sInter($key1, $key2, $keyN = null) {} * //} * */ - public function sInterStore($dstKey, $key1, $key2, $keyN = null) {} + public function sInterStore($dstKey, $key1, $key2, $keyN = null) + { + } /** * Performs the difference between N sets and returns it. @@ -1120,7 +1202,9 @@ public function sInterStore($dstKey, $key1, $key2, $keyN = null) {} * //} * */ - public function sDiff($key1, $key2, $keyN = null) {} + public function sDiff($key1, $key2, $keyN = null) + { + } /** * Performs the same action as sDiff, but stores the result in the first key @@ -1158,7 +1242,9 @@ public function sDiff($key1, $key2, $keyN = null) {} * //} * */ - public function sDiffStore($dstKey, $key1, $key2, $keyN = null) {} + public function sDiffStore($dstKey, $key1, $key2, $keyN = null) + { + } /** * Returns a random element(s) from the set value at Key, without removing it. @@ -1187,7 +1273,9 @@ public function sDiffStore($dstKey, $key1, $key2, $keyN = null) {} * // } * */ - public function sRandMember($key, $count = null) {} + public function sRandMember($key, $count = null) + { + } /** * Get the length of a string value. @@ -1202,7 +1290,9 @@ public function sRandMember($key, $count = null) {} * $redisCluster->strlen('key'); // 5 * */ - public function strlen($key) {} + public function strlen($key) + { + } /** * Remove the expiration timer from a key. @@ -1213,7 +1303,9 @@ public function strlen($key) {} * @link https://redis.io/commands/persist * @example $redisCluster->persist('key'); */ - public function persist($key) {} + public function persist($key) + { + } /** * Returns the remaining time to live of a key that has a timeout. @@ -1228,7 +1320,9 @@ public function persist($key) {} * @link https://redis.io/commands/ttl * @example $redisCluster->ttl('key'); */ - public function ttl($key) {} + public function ttl($key) + { + } /** * Returns the remaining time to live of a key that has an expire set, @@ -1243,7 +1337,9 @@ public function ttl($key) {} * @link https://redis.io/commands/pttl * @example $redisCluster->pttl('key'); */ - public function pttl($key) {} + public function pttl($key) + { + } /** * Returns the cardinality of an ordered set. @@ -1260,7 +1356,9 @@ public function pttl($key) {} * $redisCluster->zCard('key'); // 3 * */ - public function zCard($key) {} + public function zCard($key) + { + } /** * Returns the number of elements of the sorted set stored at the specified key which have @@ -1281,7 +1379,9 @@ public function zCard($key) {} * $redisCluster->zCount('key', 0, 3); // 2, corresponding to array('val0', 'val2') * */ - public function zCount($key, $start, $end) {} + public function zCount($key, $start, $end) + { + } /** * Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end]. @@ -1300,7 +1400,9 @@ public function zCount($key, $start, $end) {} * $redisCluster->zRemRangeByScore('key', '0', '3'); // 2 * */ - public function zRemRangeByScore($key, $start, $end) {} + public function zRemRangeByScore($key, $start, $end) + { + } /** * Returns the score of a given member in the specified sorted set. @@ -1316,7 +1418,9 @@ public function zRemRangeByScore($key, $start, $end) {} * $redisCluster->zScore('key', 'val2'); // 2.5 * */ - public function zScore($key, $member) {} + public function zScore($key, $member) + { + } /** * Adds the specified member with a given score to the sorted set stored at key. @@ -1343,7 +1447,9 @@ public function zScore($key, $member) {} * // } * */ - public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) {} + public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) + { + } /** * Increments the score of a member from a sorted set by a given amount. @@ -1362,7 +1468,9 @@ public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $sc * $redisCluster->zIncrBy('key', 1, 'member1'); // 3.5 * */ - public function zIncrBy($key, $value, $member) {} + public function zIncrBy($key, $value, $member) + { + } /** * Returns the length of a hash, in number of items @@ -1379,7 +1487,9 @@ public function zIncrBy($key, $value, $member) {} * $redisCluster->hLen('h'); // returns 2 * */ - public function hLen($key) {} + public function hLen($key) + { + } /** * Returns the keys in a hash, as an array of strings. @@ -1412,7 +1522,9 @@ public function hLen($key) {} * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hKeys($key) {} + public function hKeys($key) + { + } /** * Returns the values in a hash, as an array of strings. @@ -1445,7 +1557,9 @@ public function hKeys($key) {} * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hVals($key) {} + public function hVals($key) + { + } /** * Gets a value from the hash stored at key. @@ -1463,7 +1577,9 @@ public function hVals($key) {} * $redisCluster->hGet('h', 'a'); // 'X' * */ - public function hGet($key, $hashKey) {} + public function hGet($key, $hashKey) + { + } /** * Returns the whole hash, as an array of strings indexed by strings. @@ -1496,7 +1612,9 @@ public function hGet($key, $hashKey) {} * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hGetAll($key) {} + public function hGetAll($key) + { + } /** * Verify if the specified member exists in a key. @@ -1513,7 +1631,9 @@ public function hGetAll($key) {} * $redisCluster->hExists('h', 'NonExistingKey'); // FALSE * */ - public function hExists($key, $hashKey) {} + public function hExists($key, $hashKey) + { + } /** * Increments the value of a member from a hash by a given amount. @@ -1531,7 +1651,9 @@ public function hExists($key, $hashKey) {} * $redisCluster->hIncrBy('h', 'x', 1); // h[x] ← 2 + 1. Returns 3 * */ - public function hIncrBy($key, $hashKey, $value) {} + public function hIncrBy($key, $hashKey, $value) + { + } /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. @@ -1554,7 +1676,9 @@ public function hIncrBy($key, $hashKey, $value) {} * $redisCluster->hGet('h', 'key1'); // returns "plop" * */ - public function hSet($key, $hashKey, $value) {} + public function hSet($key, $hashKey, $value) + { + } /** * Adds a value to the hash stored at key only if this field isn't already in the hash. @@ -1573,7 +1697,9 @@ public function hSet($key, $hashKey, $value) {} * field wasn't replaced. * */ - public function hSetNx($key, $hashKey, $value) {} + public function hSetNx($key, $hashKey, $value) + { + } /** * Retrieve the values associated to the specified fields in the hash. @@ -1593,7 +1719,9 @@ public function hSetNx($key, $hashKey, $value) {} * 'value2') * */ - public function hMGet($key, $hashKeys) {} + public function hMGet($key, $hashKeys) + { + } /** * Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast. @@ -1611,7 +1739,9 @@ public function hMGet($key, $hashKeys) {} * $redisCluster->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now. * */ - public function hMSet($key, $hashKeys) {} + public function hMSet($key, $hashKeys) + { + } /** * Removes a values from the hash stored at key. @@ -1646,7 +1776,9 @@ public function hMSet($key, $hashKeys) {} * // } * */ - public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) {} + public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) + { + } /** * Increment the float value of a hash field by the given amount @@ -1675,7 +1807,9 @@ public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) {} * // } * */ - public function hIncrByFloat($key, $field, $increment) {} + public function hIncrByFloat($key, $field, $increment) + { + } /** * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. @@ -1691,7 +1825,9 @@ public function hIncrByFloat($key, $field, $increment) {} * $val = $redisCluster->dump('foo'); // $val will be the Redis encoded key value * */ - public function dump($key) {} + public function dump($key) + { + } /** * Returns the rank of a given member in the specified sorted set, starting at 0 for the item @@ -1713,7 +1849,9 @@ public function dump($key) {} * $redisCluster->zRevRank('key', 'two'); // 0 * */ - public function zRank($key, $member) {} + public function zRank($key, $member) + { + } /** * @see zRank() @@ -1724,7 +1862,9 @@ public function zRank($key, $member) {} * @return int the item's score * @link https://redis.io/commands/zrevrank */ - public function zRevRank($key, $member) {} + public function zRevRank($key, $member) + { + } /** * Increment the number stored at key by one. @@ -1741,7 +1881,9 @@ public function zRevRank($key, $member) {} * $redisCluster->incr('key1'); // 4 * */ - public function incr($key) {} + public function incr($key) + { + } /** * Decrement the number stored at key by one. @@ -1757,7 +1899,9 @@ public function incr($key) {} * $redisCluster->decr('key1'); // -3 * */ - public function decr($key) {} + public function decr($key) + { + } /** * Increment the number stored at key by one. If the second argument is filled, it will be used as the integer @@ -1777,7 +1921,9 @@ public function decr($key) {} * $redisCluster->incrBy('key1', 10); // 14 * */ - public function incrBy($key, $value) {} + public function incrBy($key, $value) + { + } /** * Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer @@ -1796,7 +1942,9 @@ public function incrBy($key, $value) {} * $redisCluster->decrBy('key1', 10); // -13 * */ - public function decrBy($key, $value) {} + public function decrBy($key, $value) + { + } /** * Increment the float value of a key by the given amount @@ -1814,7 +1962,9 @@ public function decrBy($key, $value) {} * var_dump( $redisCluster->get('x') ); // string(3) "4.5" * */ - public function incrByFloat($key, $increment) {} + public function incrByFloat($key, $increment) + { + } /** * Sets an expiration date (a timeout) on an item. @@ -1832,7 +1982,9 @@ public function incrByFloat($key, $increment) {} * $redisCluster->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expire($key, $ttl) {} + public function expire($key, $ttl) + { + } /** * Sets an expiration date (a timeout in milliseconds) on an item. @@ -1850,7 +2002,9 @@ public function expire($key, $ttl) {} * $redisCluster->pttl('x'); // 11500 * */ - public function pExpire($key, $ttl) {} + public function pExpire($key, $ttl) + { + } /** * Sets an expiration date (a timestamp) on an item. @@ -1869,7 +2023,9 @@ public function pExpire($key, $ttl) {} * $redisCluster->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expireAt($key, $timestamp) {} + public function expireAt($key, $timestamp) + { + } /** * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds @@ -1887,7 +2043,9 @@ public function expireAt($key, $timestamp) {} * $redisCluster->pttl('x'); // 218270120575 * */ - public function pExpireAt($key, $timestamp) {} + public function pExpireAt($key, $timestamp) + { + } /** * Append specified string to the string stored in specified key. @@ -1904,7 +2062,9 @@ public function pExpireAt($key, $timestamp) {} * $redisCluster->get('key'); // 'value1value2' * */ - public function append($key, $value) {} + public function append($key, $value) + { + } /** * Return a single bit out of a larger string @@ -1921,7 +2081,9 @@ public function append($key, $value) {} * $redisCluster->getBit('key', 1); // 1 * */ - public function getBit($key, $offset) {} + public function getBit($key, $offset) + { + } /** * Changes a single bit of a string. @@ -1940,7 +2102,9 @@ public function getBit($key, $offset) {} * $redisCluster->get('key'); // chr(0x2f) = "/" = b("0010 1111") * */ - public function setBit($key, $offset, $value) {} + public function setBit($key, $offset, $value) + { + } /** * Bitwise operation on multiple keys. @@ -1964,7 +2128,9 @@ public function setBit($key, $offset, $value) {} * $redisCluster->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11 * */ - public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) {} + public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) + { + } /** * Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the @@ -1998,7 +2164,9 @@ public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) {} * $redisCluster->bitpos('key', 0, 1, 5); // int(-1) * */ - public function bitpos($key, $bit, $start = 0, $end = null) {} + public function bitpos($key, $bit, $start = 0, $end = null) + { + } /** * Count bits in a string. @@ -2016,7 +2184,9 @@ public function bitpos($key, $bit, $start = 0, $end = null) {} * var_dump( $redisCluster->bitCount('bit', 0, 2) ); // int(11) * */ - public function bitCount($key) {} + public function bitCount($key) + { + } /** * @see lIndex() @@ -2026,7 +2196,9 @@ public function bitCount($key) {} * * @link https://redis.io/commands/lindex */ - public function lGet($key, $index) {} + public function lGet($key, $index) + { + } /** * Return a substring of a larger string @@ -2044,7 +2216,9 @@ public function lGet($key, $index) {} * $redisCluster->getRange('key', -5, -1); // 'value' * */ - public function getRange($key, $start, $end) {} + public function getRange($key, $start, $end) + { + } /** * Trims an existing list so that it will contain only a specified range of elements. @@ -2065,7 +2239,9 @@ public function getRange($key, $start, $end) {} * $redisCluster->lRange('key1', 0, -1); // array('A', 'B') * */ - public function lTrim($key, $start, $stop) {} + public function lTrim($key, $start, $stop) + { + } /** * Returns the specified elements of the list stored at the specified key in @@ -2086,7 +2262,9 @@ public function lTrim($key, $start, $stop) {} * $redisCluster->lRange('key1', 0, -1); // array('A', 'B', 'C') * */ - public function lRange($key, $start, $end) {} + public function lRange($key, $start, $end) + { + } /** * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. @@ -2106,7 +2284,9 @@ public function lRange($key, $start, $end) {} * $redisCluster->zRange('key', 0, -1, true); // array('three' => 3) * */ - public function zRemRangeByRank($key, $start, $end) {} + public function zRemRangeByRank($key, $start, $end) + { + } /** * Publish messages to channels. Warning: this function will probably change in the future. @@ -2118,7 +2298,9 @@ public function zRemRangeByRank($key, $start, $end) {} * @return int Number of clients that received the message * @example $redisCluster->publish('chan-1', 'hello, world!'); // send message. */ - public function publish($channel, $message) {} + public function publish($channel, $message) + { + } /** * Renames a key. @@ -2136,7 +2318,9 @@ public function publish($channel, $message) {} * $redisCluster->get('x'); // → `FALSE` * */ - public function rename($srcKey, $dstKey) {} + public function rename($srcKey, $dstKey) + { + } /** * Renames a key. @@ -2157,7 +2341,9 @@ public function rename($srcKey, $dstKey) {} * $redisCluster->get('x'); // → `FALSE` * */ - public function renameNx($srcKey, $dstKey) {} + public function renameNx($srcKey, $dstKey) + { + } /** * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data @@ -2175,7 +2361,9 @@ public function renameNx($srcKey, $dstKey) {} * $redisCluster->pfCount(array('key1', 'key2')); // int(3) * */ - public function pfCount($key) {} + public function pfCount($key) + { + } /** * Adds all the element arguments to the HyperLogLog data structure stored at the key. @@ -2187,7 +2375,9 @@ public function pfCount($key) {} * @link https://redis.io/commands/pfadd * @example $redisCluster->pfAdd('key', array('elem1', 'elem2')) */ - public function pfAdd($key, array $elements) {} + public function pfAdd($key, array $elements) + { + } /** * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality @@ -2206,7 +2396,9 @@ public function pfAdd($key, array $elements) {} * $redisCluster->pfCount('key3'); // int(3) * */ - public function pfMerge($destKey, array $sourceKeys) {} + public function pfMerge($destKey, array $sourceKeys) + { + } /** * Changes a substring of a larger string. @@ -2224,7 +2416,9 @@ public function pfMerge($destKey, array $sourceKeys) {} * $redisCluster->get('key'); // "Hello redis" * */ - public function setRange($key, $offset, $value) {} + public function setRange($key, $offset, $value) + { + } /** * Restore a key from the result of a DUMP operation. @@ -2242,7 +2436,9 @@ public function setRange($key, $offset, $value) {} * $redisCluster->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo' * */ - public function restore($key, $ttl, $value) {} + public function restore($key, $ttl, $value) + { + } /** * Moves the specified member from the set at srcKey to the set at dstKey. @@ -2265,7 +2461,9 @@ public function restore($key, $ttl, $value) {} * // 'key2' => {'set21', 'set22', 'set13'} * */ - public function sMove($srcKey, $dstKey, $member) {} + public function sMove($srcKey, $dstKey, $member) + { + } /** * Returns a range of elements from the ordered set stored at the specified key, @@ -2292,7 +2490,9 @@ public function sMove($srcKey, $dstKey, $member) {} * $redisCluster->zRange('key1', 0, -1, true); // array('val0' => 0, 'val2' => 2, 'val10' => 10) * */ - public function zRange($key, $start, $end, $withscores = null) {} + public function zRange($key, $start, $end, $withscores = null) + { + } /** * Returns the elements of the sorted set stored at the specified key in the range [start, end] @@ -2320,7 +2520,9 @@ public function zRange($key, $start, $end, $withscores = null) {} * $redisCluster->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0) * */ - public function zRevRange($key, $start, $end, $withscore = null) {} + public function zRevRange($key, $start, $end, $withscore = null) + { + } /** * Returns the elements of the sorted set stored at the specified key which have scores in the @@ -2355,7 +2557,9 @@ public function zRevRange($key, $start, $end, $withscore = null) {} * // array('val2'=> 2) * */ - public function zRangeByScore($key, $start, $end, array $options = []) {} + public function zRangeByScore($key, $start, $end, array $options = []) + { + } /** * @see zRangeByScore() @@ -2367,7 +2571,9 @@ public function zRangeByScore($key, $start, $end, array $options = []) {} * * @return array */ - public function zRevRangeByScore($key, $start, $end, array $options = []) {} + public function zRevRangeByScore($key, $start, $end, array $options = []) + { + } /** * Returns a range of members in a sorted set, by lexicographical range @@ -2391,7 +2597,9 @@ public function zRevRangeByScore($key, $start, $end, array $options = []) {} * $redisCluster->zRevRangeByLex('key', '(c','-'); // array('b', 'a') * */ - public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) {} + public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) + { + } /** * @see zRangeByLex() @@ -2405,7 +2613,9 @@ public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) {} * @return array * @link https://redis.io/commands/zrevrangebylex */ - public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) {} + public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) + { + } /** * Count the number of members in a sorted set between a given lexicographical range. @@ -2424,16 +2634,18 @@ public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) * $redisCluster->zLexCount('key', '[b', '[f'); // 5 * */ - public function zLexCount($key, $min, $max) {} + public function zLexCount($key, $min, $max) + { + } /** * Remove all members in a sorted set between the given lexicographical range. * - * @param string $key The ZSET you wish to run against. - * @param int $min The minimum alphanumeric value you wish to get. - * @param int $max The maximum alphanumeric value you wish to get. + * @param string $key The ZSET you wish to run against. + * @param string $min The minimum alphanumeric value you wish to get. + * @param string $max The maximum alphanumeric value you wish to get. * - * @return array the number of elements removed. + * @return int|false the number of elements removed. * @link https://redis.io/commands/zremrangebylex * @example *
@@ -2444,7 +2656,9 @@ public function zLexCount($key, $min, $max) {}
      * $redisCluster->zRange('key',0,-1);// array('a','b','e','f','g')
      * 
*/ - public function zRemRangeByLex($key, $min, $max) {} + public function zRemRangeByLex(string $key, string $min, string $max) + { + } /** * Add multiple sorted sets and store the resulting sorted set in a new key @@ -2479,7 +2693,9 @@ public function zRemRangeByLex($key, $min, $max) {} * $redisCluster->zUnionStore('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3','val1') * */ - public function zUnionStore($Output, $ZSetKeys, ?array $Weights = null, $aggregateFunction = 'SUM') {} + public function zUnionStore($Output, $ZSetKeys, ?array $Weights = null, $aggregateFunction = 'SUM') + { + } /** * Intersect multiple sorted sets and store the resulting sorted set in a new key @@ -2518,7 +2734,9 @@ public function zUnionStore($Output, $ZSetKeys, ?array $Weights = null, $aggrega * $redisCluster->zInterStore('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1') * */ - public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} + public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + { + } /** * Deletes a specified member from the ordered set. @@ -2543,7 +2761,9 @@ public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregat * // } * */ - public function zRem($key, $member1, $member2 = null, $memberN = null) {} + public function zRem($key, $member1, $member2 = null, $memberN = null) + { + } /** * Sort @@ -2574,7 +2794,9 @@ public function zRem($key, $member1, $member2 = null, $memberN = null) {} * var_dump($redisCluster->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5 * */ - public function sort($key, $option = null) {} + public function sort($key, $option = null) + { + } /** * Describes the object pointed to by a key. @@ -2596,7 +2818,9 @@ public function sort($key, $option = null) {} * $redisCluster->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds). * */ - public function object($string = '', $key = '') {} + public function object($string = '', $key = '') + { + } /** * Subscribe to channels. Warning: this function will probably change in the future. @@ -2629,7 +2853,9 @@ public function object($string = '', $key = '') {} * $redisCluster->subscribe(array('chan-1', 'chan-2', 'chan-3'), 'f'); // subscribe to 3 chans * */ - public function subscribe($channels, $callback) {} + public function subscribe($channels, $callback) + { + } /** * Subscribe to channels by pattern @@ -2650,7 +2876,9 @@ public function subscribe($channels, $callback) {} * } * */ - public function psubscribe($patterns, $callback) {} + public function psubscribe($patterns, $callback) + { + } /** * Unsubscribes the client from the given channels, or from all of them if none is given. @@ -2658,7 +2886,9 @@ public function psubscribe($patterns, $callback) {} * @param $channels * @param $callback */ - public function unSubscribe($channels, $callback) {} + public function unSubscribe($channels, $callback) + { + } /** * Unsubscribes the client from the given patterns, or from all of them if none is given. @@ -2666,7 +2896,9 @@ public function unSubscribe($channels, $callback) {} * @param $channels * @param $callback */ - public function punSubscribe($channels, $callback) {} + public function punSubscribe($channels, $callback) + { + } /** * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. @@ -2687,7 +2919,9 @@ public function punSubscribe($channels, $callback) {} * $redisCluster->evalSha($sha); // Returns 1 * */ - public function evalSha($scriptSha, $args = [], $numKeys = 0) {} + public function evalSha($scriptSha, $args = [], $numKeys = 0) + { + } /** * Scan the keyspace for keys. @@ -2709,7 +2943,9 @@ public function evalSha($scriptSha, $args = [], $numKeys = 0) {} * } * */ - public function scan(&$iterator, $node, $pattern = null, $count = 0) {} + public function scan(&$iterator, $node, $pattern = null, $count = 0) + { + } /** * Scan a set for members. @@ -2731,7 +2967,9 @@ public function scan(&$iterator, $node, $pattern = null, $count = 0) {} * } * */ - public function sScan($key, &$iterator, $pattern = null, $count = 0) {} + public function sScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Scan a sorted set for members, with optional pattern and count. @@ -2753,7 +2991,9 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) {} * } * */ - public function zScan($key, &$iterator, $pattern = null, $count = 0) {} + public function zScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Scan a HASH value for members, with an optional pattern and count. @@ -2775,7 +3015,9 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * } * */ - public function hScan($key, &$iterator, $pattern = null, $count = 0) {} + public function hScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. @@ -2783,7 +3025,9 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) {} * @return int Either RedisCluster::ATOMIC, RedisCluster::MULTI or RedisCluster::PIPELINE * @example $redisCluster->getMode(); */ - public function getMode() {} + public function getMode() + { + } /** * The last error message (if any) @@ -2796,7 +3040,9 @@ public function getMode() {} * // "ERR Error compiling script (new function): user_script:1: '=' expected near '-'" * */ - public function getLastError() {} + public function getLastError() + { + } /** * Clear the last error message @@ -2813,7 +3059,9 @@ public function getLastError() {} * // NULL * */ - public function clearLastError() {} + public function clearLastError() + { + } /** * Get client option @@ -2825,7 +3073,9 @@ public function clearLastError() {} * // return RedisCluster::SERIALIZER_NONE, RedisCluster::SERIALIZER_PHP, or RedisCluster::SERIALIZER_IGBINARY. * $redisCluster->getOption(RedisCluster::OPT_SERIALIZER); */ - public function getOption($option) {} + public function getOption($option) + { + } /** * Set client option. @@ -2842,7 +3092,9 @@ public function getOption($option) {} * $redisCluster->setOption(RedisCluster::OPT_PREFIX, 'myAppName:'); // use custom prefix on all keys * */ - public function setOption($option, $value) {} + public function setOption($option, $value) + { + } /** * A utility method to prefix the value with the prefix setting for phpredis. @@ -2856,7 +3108,9 @@ public function setOption($option, $value) {} * $redisCluster->_prefix('my-value'); // Will return 'my-prefix:my-value' * */ - public function _prefix($value) {} + public function _prefix($value) + { + } /** * A utility method to serialize values manually. This method allows you to serialize a value with whatever @@ -2878,7 +3132,9 @@ public function _prefix($value) {} * $redisCluster->_serialize("foo"); // Returns 's:3:"foo";' * */ - public function _serialize($value) {} + public function _serialize($value) + { + } /** * A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the @@ -2895,7 +3151,9 @@ public function _serialize($value) {} * $redisCluster->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3) * */ - public function _unserialize($value) {} + public function _unserialize($value) + { + } /** * Return all redis master nodes @@ -2906,7 +3164,9 @@ public function _unserialize($value) {} * $redisCluster->_masters(); // Will return [[0=>'127.0.0.1','6379'],[0=>'127.0.0.1','6380']] * */ - public function _masters() {} + public function _masters() + { + } /** * Enter and exit transactional mode. @@ -2936,20 +3196,26 @@ public function _masters() {} * // 3 => 'val2'); * */ - public function multi($mode = RedisCluster::MULTI) {} + public function multi($mode = RedisCluster::MULTI) + { + } /** * @see multi() * @return void|array * @link https://redis.io/commands/exec */ - public function exec() {} + public function exec() + { + } /** * @see multi() * @link https://redis.io/commands/discard */ - public function discard() {} + public function discard() + { + } /** * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, @@ -2969,13 +3235,17 @@ public function discard() {} * // $ret = FALSE if x has been modified between the call to WATCH and the call to EXEC. * */ - public function watch($key) {} + public function watch($key) + { + } /** * @see watch() * @link https://redis.io/commands/unwatch */ - public function unwatch() {} + public function unwatch() + { + } /** * Performs a synchronous save at a specific node. @@ -2989,7 +3259,9 @@ public function unwatch() {} * $redisCluster->save('x'); //key * $redisCluster->save(['127.0.0.1',6379]); //[host,port] */ - public function save($nodeParams) {} + public function save($nodeParams) + { + } /** * Performs a background save at a specific node. @@ -3000,7 +3272,9 @@ public function save($nodeParams) {} * If a save is already running, this command will fail and return FALSE. * @link https://redis.io/commands/bgsave */ - public function bgsave($nodeParams) {} + public function bgsave($nodeParams) + { + } /** * Removes all entries from the current database at a specific node. @@ -3010,7 +3284,9 @@ public function bgsave($nodeParams) {} * @return bool Always TRUE. * @link https://redis.io/commands/flushdb */ - public function flushDB($nodeParams) {} + public function flushDB($nodeParams) + { + } /** * Removes all entries from all databases at a specific node. @@ -3020,7 +3296,9 @@ public function flushDB($nodeParams) {} * @return bool Always TRUE. * @link https://redis.io/commands/flushall */ - public function flushAll($nodeParams) {} + public function flushAll($nodeParams) + { + } /** * Returns the current database's size at a specific node. @@ -3035,7 +3313,9 @@ public function flushAll($nodeParams) {} * echo "Redis has $count keys\n"; * */ - public function dbSize($nodeParams) {} + public function dbSize($nodeParams) + { + } /** * Starts the background rewrite of AOF (Append-Only File) at a specific node. @@ -3046,7 +3326,9 @@ public function dbSize($nodeParams) {} * @link https://redis.io/commands/bgrewriteaof * @example $redisCluster->bgrewriteaof('x'); */ - public function bgrewriteaof($nodeParams) {} + public function bgrewriteaof($nodeParams) + { + } /** * Returns the timestamp of the last disk save at a specific node. @@ -3057,7 +3339,9 @@ public function bgrewriteaof($nodeParams) {} * @link https://redis.io/commands/lastsave * @example $redisCluster->lastSave('x'); */ - public function lastSave($nodeParams) {} + public function lastSave($nodeParams) + { + } /** * Returns an associative array of strings and integers @@ -3210,7 +3494,9 @@ public function lastSave($nodeParams) {} * $redisCluster->info("CPU"); // just CPU information from Redis INFO * */ - public function info($option = null) {} + public function info($option = null) + { + } /** * @since redis >= 2.8.12. @@ -3226,7 +3512,9 @@ public function info($option = null) {} * // [ 0=>'master',1 => 3129659, 2 => [ ['127.0.0.1','9001','3129242'], ['127.0.0.1','9002','3129543'] ] ] * */ - public function role($nodeParams) {} + public function role($nodeParams) + { + } /** * Returns a random key at the specified node @@ -3241,7 +3529,9 @@ public function role($nodeParams) {} * $surprise = $redisCluster->get($key); // who knows what's in there. * */ - public function randomKey($nodeParams) {} + public function randomKey($nodeParams) + { + } /** * Return the specified node server time. @@ -3262,7 +3552,9 @@ public function randomKey($nodeParams) {} * // } * */ - public function time($nodeParams) {} + public function time($nodeParams) + { + } /** * Check the specified node status @@ -3273,7 +3565,9 @@ public function time($nodeParams) {} * above. * @link https://redis.io/commands/ping */ - public function ping($nodeParams) {} + public function ping($nodeParams) + { + } /** * Returns message. @@ -3283,14 +3577,18 @@ public function ping($nodeParams) {} * * @return mixed */ - public function echo($nodeParams, $msg) {} + public function echo($nodeParams, $msg) + { + } /** * Returns Array reply of details about all Redis Cluster commands. * * @return mixed array | bool */ - public function command() {} + public function command() + { + } /** * Send arbitrary things to the redis server at the specified node @@ -3301,7 +3599,9 @@ public function command() {} * * @return mixed */ - public function rawCommand($nodeParams, $command, $arguments) {} + public function rawCommand($nodeParams, $command, $arguments) + { + } /** * @since redis >= 3.0 @@ -3318,7 +3618,9 @@ public function rawCommand($nodeParams, $command, $arguments) {} * $redisCluster->cluster(['127.0.0.1',6379],'INFO'); * */ - public function cluster($nodeParams, $command, $arguments) {} + public function cluster($nodeParams, $command, $arguments) + { + } /** * Allows you to get information of the cluster client @@ -3327,7 +3629,9 @@ public function cluster($nodeParams, $command, $arguments) {} * @param string $subCmd can be: 'LIST', 'KILL', 'GETNAME', or 'SETNAME' * @param string $args optional arguments */ - public function client($nodeParams, $subCmd, $args) {} + public function client($nodeParams, $subCmd, $args) + { + } /** * Get or Set the redis config keys. @@ -3346,7 +3650,9 @@ public function client($nodeParams, $subCmd, $args) {} * $redisCluster->config(['127.0.0.1',6379], "SET", "dir", "/var/run/redis/dumps/"); * */ - public function config($nodeParams, $operation, $key, $value) {} + public function config($nodeParams, $operation, $key, $value) + { + } /** * A command allowing you to get information on the Redis pub/sub system. @@ -3373,7 +3679,9 @@ public function config($nodeParams, $operation, $key, $value) {} * $redisCluster->pubsub(['127.0.0.1',6379], 'numpat'); // Get the number of pattern subscribers * */ - public function pubsub($nodeParams, $keyword, $argument) {} + public function pubsub($nodeParams, $keyword, $argument) + { + } /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. @@ -3400,7 +3708,9 @@ public function pubsub($nodeParams, $keyword, $argument) {} * SCRIPT KILL will return true if a script was able to be killed and false if not * SCRIPT EXISTS will return an array with TRUE or FALSE for each passed script */ - public function script($nodeParams, $command, $script) {} + public function script($nodeParams, $command, $script) + { + } /** * This function is used in order to read and reset the Redis slow queries log. @@ -3415,7 +3725,9 @@ public function script($nodeParams, $command, $script) {} * $redisCluster->slowLog(['127.0.0.1',6379],'get','2'); * */ - public function slowLog($nodeParams, $command, $argument) {} + public function slowLog($nodeParams, $command, $argument) + { + } /** * Add one or more geospatial items in the geospatial index represented using a sorted set @@ -3432,7 +3744,9 @@ public function slowLog($nodeParams, $command, $argument) {} * $redisCluster->geoAdd('Sicily', 15.087269, 37.502669, "Catania"); // int(1) * */ - public function geoAdd($key, $longitude, $latitude, $member) {} + public function geoAdd($key, $longitude, $latitude, $member) + { + } /** * Returns members of a geospatial index as standard geohash strings @@ -3449,7 +3763,9 @@ public function geoAdd($key, $longitude, $latitude, $member) {} * $redisCluster->geohash('Sicily','Palermo','Catania');//['sqc8b49rny0','sqdtr74hyu0'] * */ - public function geohash($key, $member1, $member2 = null, $memberN = null) {} + public function geohash($key, $member1, $member2 = null, $memberN = null) + { + } /** * Returns longitude and latitude of members of a geospatial index @@ -3464,7 +3780,9 @@ public function geohash($key, $member1, $member2 = null, $memberN = null) {} * $redisCluster->geopos('Sicily','Palermo');//[['13.36138933897018433','38.11555639549629859']] * */ - public function geopos($key, $member1, $member2 = null, $memberN = null) {} + public function geopos($key, $member1, $member2 = null, $memberN = null) + { + } /** * Returns the distance between two members of a geospatial index @@ -3487,7 +3805,9 @@ public function geopos($key, $member1, $member2 = null, $memberN = null) {} * $redisCluster->geoDist('Sicily', 'Palermo','Catania', 'km'); // float(166.2742) * */ - public function geoDist($key, $member1, $member2, $unit = 'm') {} + public function geoDist($key, $member1, $member2, $unit = 'm') + { + } /** * Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point @@ -3553,7 +3873,9 @@ public function geoDist($key, $member1, $member2, $unit = 'm') {} * *
      */
-    public function geoRadius($key, $longitude, $latitude, $radius, $radiusUnit, array $options) {}
+    public function geoRadius($key, $longitude, $latitude, $radius, $radiusUnit, array $options)
+    {
+    }
 
     /**
      * Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member
@@ -3566,7 +3888,11 @@ public function geoRadius($key, $longitude, $latitude, $radius, $radiusUnit, arr
      * @param string $radiusUnit
      * @param array  $options
      */
-    public function geoRadiusByMember($key, $member, $radius, $radiusUnit, array $options) {}
+    public function geoRadiusByMember($key, $member, $radius, $radiusUnit, array $options)
+    {
+    }
 }
 
-class RedisClusterException extends Exception {}
+class RedisClusterException extends Exception
+{
+}

From 067694d2095ce68eb9c0837d384e4afe7730dfaf Mon Sep 17 00:00:00 2001
From: DmitryTronin 
Date: Wed, 12 Oct 2022 16:29:11 +0200
Subject: [PATCH 198/419] php cs fixer fixed

---
 redis/Redis.php        | 896 +++++++++++------------------------------
 redis/RedisCluster.php | 648 ++++++++---------------------
 2 files changed, 386 insertions(+), 1158 deletions(-)

diff --git a/redis/Redis.php b/redis/Redis.php
index 04c24fc3d..e15e7077c 100644
--- a/redis/Redis.php
+++ b/redis/Redis.php
@@ -132,9 +132,7 @@ class Redis
      *     ],
      * ]);
      */
-    public function __construct($options = null)
-    {
-    }
+    public function __construct($options = null) {}
 
     /**
      * Connects to a Redis instance.
@@ -206,9 +204,7 @@ public function open(
      *
      * @throws RedisException
      */
-    public function isConnected()
-    {
-    }
+    public function isConnected() {}
 
     /**
      * Retrieve our host or unix socket that we're connected to
@@ -217,9 +213,7 @@ public function isConnected()
      *
      * @throws RedisException
      */
-    public function getHost()
-    {
-    }
+    public function getHost() {}
 
     /**
      * Get the port we're connected to
@@ -228,9 +222,7 @@ public function getHost()
      *
      * @throws RedisException
      */
-    public function getPort()
-    {
-    }
+    public function getPort() {}
 
     /**
      * Get the database number phpredis is pointed to
@@ -240,9 +232,7 @@ public function getPort()
      *
      * @throws RedisException
      */
-    public function getDbNum()
-    {
-    }
+    public function getDbNum() {}
 
     /**
      * Get the (write) timeout in use for phpredis
@@ -251,9 +241,7 @@ public function getDbNum()
      *
      * @throws RedisException
      */
-    public function getTimeout()
-    {
-    }
+    public function getTimeout() {}
 
     /**
      * Get the read timeout specified to phpredis or FALSE if we're not connected
@@ -263,9 +251,7 @@ public function getTimeout()
      *
      * @throws RedisException
      */
-    public function getReadTimeout()
-    {
-    }
+    public function getReadTimeout() {}
 
     /**
      * Gets the persistent ID that phpredis is using
@@ -277,9 +263,7 @@ public function getReadTimeout()
      *
      * @throws RedisException
      */
-    public function getPersistentID()
-    {
-    }
+    public function getPersistentID() {}
 
     /**
      * Get the password used to authenticate the phpredis connection
@@ -290,9 +274,7 @@ public function getPersistentID()
      *
      * @throws RedisException
      */
-    public function getAuth()
-    {
-    }
+    public function getAuth() {}
 
     /**
      * Connects to a Redis instance or reuse a connection already established with pconnect/popen.
@@ -383,9 +365,7 @@ public function popen(
      *
      * @throws RedisException
      */
-    public function close()
-    {
-    }
+    public function close() {}
 
     /**
      * Swap one Redis database with another atomically
@@ -407,9 +387,7 @@ public function close()
      * $redis->swapdb(0, 1);
      * 
*/ - public function swapdb(int $db1, int $db2) - { - } + public function swapdb(int $db1, int $db2) {} /** * Set client option @@ -440,9 +418,7 @@ public function swapdb(int $db1, int $db2) * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY); * */ - public function setOption($option, $value) - { - } + public function setOption($option, $value) {} /** * Get client option @@ -458,9 +434,7 @@ public function setOption($option, $value) * // return option value * $redis->getOption(Redis::OPT_SERIALIZER); */ - public function getOption($option) - { - } + public function getOption($option) {} /** * Check the current connection status @@ -479,9 +453,7 @@ public function getOption($option) * // If passed an argument, that argument is returned. Here 'hello' will be returned * $redis->ping('hello'); */ - public function ping($message = null) - { - } + public function ping($message = null) {} /** * Sends a string to Redis, which replies with the same string @@ -494,9 +466,7 @@ public function ping($message = null) * * @link https://redis.io/commands/echo */ - public function echo($message) - { - } + public function echo($message) {} /** * Get the value related to the specified key @@ -527,9 +497,7 @@ public function echo($message) * } * */ - public function get($key) - { - } + public function get($key) {} /** * Set the string value in argument as value of the key. @@ -566,9 +534,7 @@ public function get($key) * * @link https://redis.io/commands/set */ - public function set($key, string $value, mixed $timeout = null) - { - } + public function set($key, string $value, mixed $timeout = null) {} /** * Set the string value in argument as value of the key, with a time to live. @@ -584,9 +550,7 @@ public function set($key, string $value, mixed $timeout = null) * @link https://redis.io/commands/setex * @example $redis->setex('key', 3600, 'value'); // sets key → value, with 1h TTL. */ - public function setex($key, $expire, string $value) - { - } + public function setex($key, $expire, string $value) {} /** * Set the value and expiration in milliseconds of a key. @@ -603,9 +567,7 @@ public function setex($key, $expire, string $value) * @link https://redis.io/commands/psetex * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL. */ - public function psetex($key, $expire, string $value) - { - } + public function psetex($key, $expire, string $value) {} /** * Set the string value in argument as value of the key if the key doesn't already exist in the database. @@ -624,9 +586,7 @@ public function psetex($key, $expire, string $value) * $redis->setnx('key', 'value'); // return FALSE * */ - public function setnx(string $key, string $value) - { - } + public function setnx(string $key, string $value) {} /** * Remove specified keys. @@ -650,9 +610,7 @@ public function setnx(string $key, string $value) * $redis->del(['key3', 'key4']); // return 2 * */ - public function del($key1, ...$otherKeys) - { - } + public function del($key1, ...$otherKeys) {} /** * Remove specified keys. @@ -665,9 +623,7 @@ public function del($key1, ...$otherKeys) * @throws RedisException */ #[Deprecated(replacement: "%class%->del(%parametersList%)")] - public function delete($key, ...$otherKeys) - { - } + public function delete($key, ...$otherKeys) {} /** * Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking. @@ -691,9 +647,7 @@ public function delete($key, ...$otherKeys) * $redis->unlink(array('key3', 'key4')); // return 2 * */ - public function unlink($key, ...$other_keys) - { - } + public function unlink($key, ...$other_keys) {} /** * Enter and exit transactional mode. @@ -726,9 +680,7 @@ public function unlink($key, ...$other_keys) * // 3 => 'val2'); * */ - public function multi($mode = Redis::MULTI) - { - } + public function multi($mode = Redis::MULTI) {} /** * Returns a Redis instance which can simply transmitted faster to the server. @@ -759,9 +711,7 @@ public function multi($mode = Redis::MULTI) * // 4 => '+PONG'); * */ - public function pipeline() - { - } + public function pipeline() {} /** * @return void|array|Redis returns Redis if in multimode @@ -771,9 +721,7 @@ public function pipeline() * @see multi() * @link https://redis.io/commands/exec */ - public function exec() - { - } + public function exec() {} /** * Flushes all previously queued commands in a transaction and restores the connection state to normal. @@ -785,9 +733,7 @@ public function exec() * @see multi() * @link https://redis.io/commands/discard */ - public function discard() - { - } + public function discard() {} /** * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, @@ -811,9 +757,7 @@ public function discard() * // $ret = FALSE if x has been modified between the call to WATCH and the call to EXEC. * */ - public function watch($key, ...$other_keys) - { - } + public function watch($key, ...$other_keys) {} /** * @throws RedisException @@ -822,9 +766,7 @@ public function watch($key, ...$other_keys) * @return bool|Redis * @link https://redis.io/commands/unwatch */ - public function unwatch() - { - } + public function unwatch() {} /** * Subscribes the client to the specified channels. @@ -841,9 +783,7 @@ public function unwatch() * @link https://redis.io/commands/subscribe * @since 2.0 */ - public function subscribe(string $channel, string ...$other_channels) - { - } + public function subscribe(string $channel, string ...$other_channels) {} /** * Subscribe to channels by pattern @@ -867,9 +807,7 @@ public function subscribe(string $channel, string ...$other_channels) * $redis->psubscribe(array('chan-1', 'chan-2', 'chan-3'), 'f') * */ - public function psubscribe($patterns, $callback) - { - } + public function psubscribe($patterns, $callback) {} /** * Publish messages to channels. @@ -886,9 +824,7 @@ public function psubscribe($patterns, $callback) * @link https://redis.io/commands/publish * @example $redis->publish('chan-1', 'hello, world!'); // send message. */ - public function publish($channel, $message) - { - } + public function publish($channel, $message) {} /** * A command allowing you to get information on the Redis pub/sub system @@ -915,9 +851,7 @@ public function publish($channel, $message) * $redis->pubsub('numpat'); // Get the number of pattern subscribers * */ - public function pubsub($keyword, $argument = null) - { - } + public function pubsub($keyword, $argument = null) {} /** * Stop listening for messages posted to the given channels. @@ -931,9 +865,7 @@ public function pubsub($keyword, $argument = null) * * @link https://redis.io/commands/unsubscribe */ - public function unsubscribe(string $channel, string ...$other_channels) - { - } + public function unsubscribe(string $channel, string ...$other_channels) {} /** * Stop listening for messages posted to the given channels. @@ -946,9 +878,7 @@ public function unsubscribe(string $channel, string ...$other_channels) * * @link https://redis.io/commands/punsubscribe */ - public function punsubscribe(array $patterns) - { - } + public function punsubscribe(array $patterns) {} /** * Verify if the specified key/keys exists @@ -975,9 +905,7 @@ public function punsubscribe(array $patterns) * $redis->exists('foo', 'bar', 'baz'); // 3 * */ - public function exists($key) - { - } + public function exists($key) {} /** * Increment the number stored at key by one. @@ -997,9 +925,7 @@ public function exists($key) * $redis->incr('key1'); // 4 * */ - public function incr($key) - { - } + public function incr($key) {} /** * Increment the float value of a key by the given amount @@ -1019,9 +945,7 @@ public function incr($key) * $redis->get('x'); // float(4.5) * */ - public function incrByFloat($key, $increment) - { - } + public function incrByFloat($key, $increment) {} /** * Increment the number stored at key by one. @@ -1044,9 +968,7 @@ public function incrByFloat($key, $increment) * $redis->incrBy('key1', 10); // 14 * */ - public function incrBy($key, $value) - { - } + public function incrBy($key, $value) {} /** * Decrement the number stored at key by one. @@ -1065,9 +987,7 @@ public function incrBy($key, $value) * $redis->decr('key1'); // -3 * */ - public function decr($key) - { - } + public function decr($key) {} /** * Decrement the number stored at key by one. @@ -1089,9 +1009,7 @@ public function decr($key) * $redis->decrBy('key1', 10); // -13 * */ - public function decrBy($key, $value) - { - } + public function decrBy($key, $value) {} /** * Adds the string values to the head (left) of the list. @@ -1119,9 +1037,7 @@ public function decrBy($key, $value) * // } * */ - public function lPush($key, ...$value1) - { - } + public function lPush($key, ...$value1) {} /** * Adds the string values to the tail (right) of the list. @@ -1149,9 +1065,7 @@ public function lPush($key, ...$value1) * // } * */ - public function rPush($key, ...$value1) - { - } + public function rPush($key, ...$value1) {} /** * Adds the string value to the head (left) of the list if the list exists. @@ -1174,9 +1088,7 @@ public function rPush($key, ...$value1) * // key1 now points to the following list: [ 'A', 'B', 'C' ] * */ - public function lPushx($key, string $value) - { - } + public function lPushx($key, string $value) {} /** * Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure. @@ -1199,9 +1111,7 @@ public function lPushx($key, string $value) * // key1 now points to the following list: [ 'A', 'B', 'C' ] * */ - public function rPushx($key, string $value) - { - } + public function rPushx($key, string $value) {} /** * Returns and removes the first element of the list. @@ -1222,9 +1132,7 @@ public function rPushx($key, string $value) * $redis->lPop('key1'); // key1 => [ 'B', 'C' ] * */ - public function lPop($key, $count = 0) - { - } + public function lPop($key, $count = 0) {} /** * Returns and removes the last element of the list. @@ -1245,9 +1153,7 @@ public function lPop($key, $count = 0) * $redis->rPop('key1'); // key1 => [ 'A', 'B' ] * */ - public function rPop($key, $count = 0) - { - } + public function rPop($key, $count = 0) {} /** * Is a blocking lPop primitive. If at least one of the lists contains at least one element, @@ -1292,9 +1198,7 @@ public function rPop($key, $count = 0) * // array('key1', 'A') is returned * */ - public function blPop($key, $timeout_or_key, ...$extra_args) - { - } + public function blPop($key, $timeout_or_key, ...$extra_args) {} /** * Is a blocking rPop primitive. If at least one of the lists contains at least one element, @@ -1340,9 +1244,7 @@ public function blPop($key, $timeout_or_key, ...$extra_args) * // array('key1', 'A') is returned * */ - public function brPop($key, $timeout_or_key, ...$extra_args) - { - } + public function brPop($key, $timeout_or_key, ...$extra_args) {} /** * Returns the size of a list identified by Key. If the list didn't exist or is empty, @@ -1366,9 +1268,7 @@ public function brPop($key, $timeout_or_key, ...$extra_args) * $redis->lLen('key1'); // 2 * */ - public function lLen($key) - { - } + public function lLen($key) {} /** * @link https://redis.io/commands/llen @@ -1380,9 +1280,7 @@ public function lLen($key) * @throws RedisException */ #[Deprecated(replacement: '%class%->lLen(%parametersList%)')] - public function lSize($key) - { - } + public function lSize($key) {} /** * Return the specified element of the list stored at the specified key. @@ -1409,9 +1307,7 @@ public function lSize($key) * $redis->lIndex('key1', 10); // `FALSE` * */ - public function lIndex($key, $index) - { - } + public function lIndex($key, $index) {} /** * @link https://redis.io/commands/lindex @@ -1423,9 +1319,7 @@ public function lIndex($key, $index) * @throws RedisException */ #[Deprecated(replacement: '%class%->lIndex(%parametersList%)')] - public function lGet($key, $index) - { - } + public function lGet($key, $index) {} /** * Set the list at index with the new value. @@ -1450,9 +1344,7 @@ public function lGet($key, $index) * $redis->lIndex('key1', 0); // 'X' * */ - public function lSet($key, $index, string $value) - { - } + public function lSet($key, $index, string $value) {} /** * Returns the specified elements of the list stored at the specified key in @@ -1476,9 +1368,7 @@ public function lSet($key, $index, string $value) * $redis->lRange('key1', 0, -1); // array('A', 'B', 'C') * */ - public function lRange($key, $start, $end) - { - } + public function lRange($key, $start, $end) {} /** * @link https://redis.io/commands/lrange @@ -1491,9 +1381,7 @@ public function lRange($key, $start, $end) * @throws RedisException */ #[Deprecated(replacement: '%class%->lRange(%parametersList%)')] - public function lGetRange($key, $start, $end) - { - } + public function lGetRange($key, $start, $end) {} /** * Trims an existing list so that it will contain only a specified range of elements. @@ -1517,9 +1405,7 @@ public function lGetRange($key, $start, $end) * $redis->lRange('key1', 0, -1); // array('A', 'B') * */ - public function lTrim($key, $start, $stop) - { - } + public function lTrim($key, $start, $stop) {} /** * @link https://redis.io/commands/ltrim @@ -1531,9 +1417,7 @@ public function lTrim($key, $start, $stop) * @throws RedisException */ #[Deprecated(replacement: '%class%->lTrim(%parametersList%)')] - public function listTrim($key, $start, $stop) - { - } + public function listTrim($key, $start, $stop) {} /** * Removes the first count occurrences of the value element from the list. @@ -1563,9 +1447,7 @@ public function listTrim($key, $start, $stop) * $redis->lRange('key1', 0, -1); // array('C', 'B', 'A') * */ - public function lRem($key, $value, $count) - { - } + public function lRem($key, $value, $count) {} /** * @link https://redis.io/commands/lremove @@ -1577,9 +1459,7 @@ public function lRem($key, $value, $count) * @throws RedisException */ #[Deprecated(replacement: '%class%->lRem(%parametersList%)')] - public function lRemove($key, $value, $count) - { - } + public function lRemove($key, $value, $count) {} /** * Insert value in the list before or after the pivot value. the parameter options @@ -1614,9 +1494,7 @@ public function lRemove($key, $value, $count) * $redis->lInsert('key1', Redis::AFTER, 'W', 'value'); // -1 * */ - public function lInsert($key, $position, $pivot, $value) - { - } + public function lInsert($key, $position, $pivot, $value) {} /** * Adds a values to the set value stored at key. @@ -1635,9 +1513,7 @@ public function lInsert($key, $position, $pivot, $value) * $redis->sAdd('k', 'v1', 'v2', 'v3'); // int(2) * */ - public function sAdd(string $key, string $value, mixed ...$other_values) - { - } + public function sAdd(string $key, string $value, mixed ...$other_values) {} /** * Removes the specified members from the set value stored at key. @@ -1660,9 +1536,7 @@ public function sAdd(string $key, string $value, mixed ...$other_values) * // } * */ - public function sRem(string $key, string $value, ...$other_values) - { - } + public function sRem(string $key, string $value, ...$other_values) {} /** * @link https://redis.io/commands/srem @@ -1673,9 +1547,7 @@ public function sRem(string $key, string $value, ...$other_values) * @throws RedisException */ #[Deprecated(replacement: '%class%->sRem(%parametersList%)')] - public function sRemove($key, ...$member1) - { - } + public function sRemove($key, ...$member1) {} /** * Moves the specified member from the set at srcKey to the set at dstKey. @@ -1701,9 +1573,7 @@ public function sRemove($key, ...$member1) * // 'key2' => {'set21', 'set22', 'set13'} * */ - public function sMove($srcKey, $dstKey, string $member) - { - } + public function sMove($srcKey, $dstKey, string $member) {} /** * Checks if value is a member of the set stored at the key key. @@ -1726,9 +1596,7 @@ public function sMove($srcKey, $dstKey, string $member) * $redis->sIsMember('key1', 'setX'); // FALSE * */ - public function sIsMember(string $key, string $value) - { - } + public function sIsMember(string $key, string $value) {} /** * @link https://redis.io/commands/sismember @@ -1739,9 +1607,7 @@ public function sIsMember(string $key, string $value) * @throws RedisException */ #[Deprecated(replacement: '%class%->sIsMember(%parametersList%)')] - public function sContains($key, $value) - { - } + public function sContains($key, $value) {} /** * Returns the cardinality of the set identified by key. @@ -1762,9 +1628,7 @@ public function sContains($key, $value) * $redis->sCard('keyX'); // 0 * */ - public function sCard($key) - { - } + public function sCard($key) {} /** * Removes and returns a random element from the set value at Key. @@ -1797,9 +1661,7 @@ public function sCard($key) * // } * */ - public function sPop($key, $count = 0) - { - } + public function sPop($key, $count = 0) {} /** * Returns a random element(s) from the set value at Key, without removing it. @@ -1831,9 +1693,7 @@ public function sPop($key, $count = 0) * // } * */ - public function sRandMember($key, $count = 0) - { - } + public function sRandMember($key, $count = 0) {} /** * Returns the members of a set resulting from the intersection of all the sets @@ -1872,9 +1732,7 @@ public function sRandMember($key, $count = 0) * //} * */ - public function sInter($key1, ...$otherKeys) - { - } + public function sInter($key1, ...$otherKeys) {} /** * Performs a sInter command and stores the result in a new set. @@ -1914,9 +1772,7 @@ public function sInter($key1, ...$otherKeys) * //} * */ - public function sInterStore($dstKey, $key1, ...$otherKeys) - { - } + public function sInterStore($dstKey, $key1, ...$otherKeys) {} /** * Performs the union between N sets and returns it. @@ -1952,9 +1808,7 @@ public function sInterStore($dstKey, $key1, ...$otherKeys) * //} * */ - public function sUnion($key1, ...$otherKeys) - { - } + public function sUnion($key1, ...$otherKeys) {} /** * Performs the same action as sUnion, but stores the result in the first key @@ -1995,9 +1849,7 @@ public function sUnion($key1, ...$otherKeys) * //} * */ - public function sUnionStore($dstKey, $key1, ...$otherKeys) - { - } + public function sUnionStore($dstKey, $key1, ...$otherKeys) {} /** * Performs the difference between N sets and returns it. @@ -2032,9 +1884,7 @@ public function sUnionStore($dstKey, $key1, ...$otherKeys) * //} * */ - public function sDiff($key1, ...$otherKeys) - { - } + public function sDiff($key1, ...$otherKeys) {} /** * Performs the same action as sDiff, but stores the result in the first key @@ -2072,9 +1922,7 @@ public function sDiff($key1, ...$otherKeys) * //} * */ - public function sDiffStore($dstKey, $key1, ...$otherKeys) - { - } + public function sDiffStore($dstKey, $key1, ...$otherKeys) {} /** * Returns the contents of a set. @@ -2106,13 +1954,9 @@ public function sDiffStore($dstKey, $key1, ...$otherKeys) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function sMembers($key) - { - } + public function sMembers($key) {} - public function sMisMember(string $key, string $member, string ...$other_members): array|false - { - } + public function sMisMember(string $key, string $member, string ...$other_members): array|false{} /** * @link https://redis.io/commands/smembers @@ -2123,9 +1967,7 @@ public function sMisMember(string $key, string $member, string ...$other_members * @throws RedisException */ #[Deprecated(replacement: '%class%->sMembers(%parametersList%)')] - public function sGetMembers($key) - { - } + public function sGetMembers($key) {} /** * Scan a set for members @@ -2150,9 +1992,7 @@ public function sGetMembers($key) * } * */ - public function sScan($key, &$iterator, $pattern = null, $count = 0) - { - } + public function sScan($key, &$iterator, $pattern = null, $count = 0) {} /** * Sets a value and returns the previous entry at that key. @@ -2172,9 +2012,7 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) * $newValue = $redis->get('x')' // return 'lol' * */ - public function getSet($key, string $value) - { - } + public function getSet($key, string $value) {} /** * Returns a random key @@ -2190,9 +2028,7 @@ public function getSet($key, string $value) * $surprise = $redis->get($key); // who knows what's in there. * */ - public function randomKey() - { - } + public function randomKey() {} /** * Switches to a given database @@ -2213,9 +2049,7 @@ public function randomKey() * $redis->get('x'); // will return 42 * */ - public function select($dbIndex) - { - } + public function select($dbIndex) {} /** * Moves a key to a different database. @@ -2237,9 +2071,7 @@ public function select($dbIndex) * $redis->get('x'); // will return 42 * */ - public function move($key, $dbIndex) - { - } + public function move($key, $dbIndex) {} /** * Renames a key @@ -2260,9 +2092,7 @@ public function move($key, $dbIndex) * $redis->get('x'); // → `FALSE` * */ - public function rename($srcKey, $dstKey) - { - } + public function rename($srcKey, $dstKey) {} /** * @link https://redis.io/commands/rename @@ -2273,9 +2103,7 @@ public function rename($srcKey, $dstKey) * @throws RedisException */ #[Deprecated(replacement: '%class%->rename(%parametersList%)')] - public function renameKey($srcKey, $dstKey) - { - } + public function renameKey($srcKey, $dstKey) {} /** * Renames a key @@ -2299,9 +2127,7 @@ public function renameKey($srcKey, $dstKey) * $redis->get('x'); // → `FALSE` * */ - public function renameNx($srcKey, $dstKey) - { - } + public function renameNx($srcKey, $dstKey) {} /** * Sets an expiration date (a timeout) on an item @@ -2322,9 +2148,7 @@ public function renameNx($srcKey, $dstKey) * $redis->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expire($key, $ttl) - { - } + public function expire($key, $ttl) {} /** * Sets an expiration date (a timeout in milliseconds) on an item @@ -2345,9 +2169,7 @@ public function expire($key, $ttl) * $redis->pttl('x'); // 11500 * */ - public function pExpire($key, $ttl) - { - } + public function pExpire($key, $ttl) {} /** * @link https://redis.io/commands/expire @@ -2359,9 +2181,7 @@ public function pExpire($key, $ttl) * @throws RedisException */ #[Deprecated(replacement: '%class%->expire(%parametersList%)')] - public function setTimeout($key, $ttl) - { - } + public function setTimeout($key, $ttl) {} /** * Sets an expiration date (a timestamp) on an item. @@ -2383,9 +2203,7 @@ public function setTimeout($key, $ttl) * $redis->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expireAt($key, $timestamp) - { - } + public function expireAt($key, $timestamp) {} /** * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds @@ -2406,9 +2224,7 @@ public function expireAt($key, $timestamp) * echo $redis->pttl('x'); // 218270120575 * */ - public function pExpireAt($key, $timestamp) - { - } + public function pExpireAt($key, $timestamp) {} /** * Returns the keys that match a certain pattern. @@ -2426,9 +2242,7 @@ public function pExpireAt($key, $timestamp) * $keyWithUserPrefix = $redis->keys('user*'); * */ - public function keys($pattern) - { - } + public function keys($pattern) {} /** * @param string $pattern @@ -2437,9 +2251,7 @@ public function keys($pattern) * @link https://redis.io/commands/keys */ #[Deprecated(replacement: '%class%->keys(%parametersList%)')] - public function getKeys($pattern) - { - } + public function getKeys($pattern) {} /** * Returns the current database's size @@ -2455,9 +2267,7 @@ public function getKeys($pattern) * echo "Redis has $count keys\n"; * */ - public function dbSize() - { - } + public function dbSize() {} /** * Authenticate the connection using a password. @@ -2472,9 +2282,7 @@ public function dbSize() * @link https://redis.io/commands/auth * @example $redis->auth('foobared'); */ - public function auth($credentials) - { - } + public function auth($credentials) {} /** * Starts the background rewrite of AOF (Append-Only File) @@ -2486,9 +2294,7 @@ public function auth($credentials) * @link https://redis.io/commands/bgrewriteaof * @example $redis->bgrewriteaof(); */ - public function bgrewriteaof() - { - } + public function bgrewriteaof() {} /** * Changes the slave status @@ -2509,9 +2315,7 @@ public function bgrewriteaof() * $redis->slaveof(); * */ - public function slaveof($host = '127.0.0.1', $port = 6379) - { - } + public function slaveof($host = '127.0.0.1', $port = 6379) {} /** * Access the Redis slowLog @@ -2542,9 +2346,7 @@ public function slaveof($host = '127.0.0.1', $port = 6379) * * @link https://redis.io/commands/slowlog */ - public function slowLog(string $operation, int $length = null) - { - } + public function slowLog(string $operation, int $length = null) {} /** * Describes the object pointed to by a key. @@ -2570,9 +2372,7 @@ public function slowLog(string $operation, int $length = null) * $redis->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds). * */ - public function object($subcommand, $key) - { - } + public function object($subcommand, $key) {} /** * Performs a synchronous save. @@ -2585,9 +2385,7 @@ public function object($subcommand, $key) * @link https://redis.io/commands/save * @example $redis->save(); */ - public function save() - { - } + public function save() {} /** * Performs a background save. @@ -2600,9 +2398,7 @@ public function save() * @link https://redis.io/commands/bgsave * @example $redis->bgSave(); */ - public function bgsave() - { - } + public function bgsave() {} /** * Returns the timestamp of the last disk save. @@ -2614,9 +2410,7 @@ public function bgsave() * @link https://redis.io/commands/lastsave * @example $redis->lastSave(); */ - public function lastSave() - { - } + public function lastSave() {} /** * Blocks the current client until all the previous write commands are successfully transferred and @@ -2633,9 +2427,7 @@ public function lastSave() * @link https://redis.io/commands/wait * @example $redis->wait(2, 1000); */ - public function wait($numSlaves, $timeout) - { - } + public function wait($numSlaves, $timeout) {} /** * Returns the type of data pointed by a given key. @@ -2658,9 +2450,7 @@ public function wait($numSlaves, $timeout) * @link https://redis.io/commands/type * @example $redis->type('key'); */ - public function type(string $key) - { - } + public function type(string $key) {} /** * Append specified string to the string stored in specified key. @@ -2680,9 +2470,7 @@ public function type(string $key) * $redis->get('key'); // 'value1value2' * */ - public function append($key, string $value) - { - } + public function append($key, string $value) {} /** * Return a substring of a larger string @@ -2703,9 +2491,7 @@ public function append($key, string $value) * $redis->getRange('key', -5, -1); // 'value' * */ - public function getRange($key, $start, $end) - { - } + public function getRange($key, $start, $end) {} /** * Return a substring of a larger string @@ -2717,9 +2503,7 @@ public function getRange($key, $start, $end) * @throws RedisException */ #[Deprecated] - public function substr($key, $start, $end) - { - } + public function substr($key, $start, $end) {} /** * Changes a substring of a larger string. @@ -2740,9 +2524,7 @@ public function substr($key, $start, $end) * $redis->get('key'); // "Hello redis" * */ - public function setRange($key, $offset, $value) - { - } + public function setRange($key, $offset, $value) {} /** * Get the length of a string value. @@ -2759,9 +2541,7 @@ public function setRange($key, $offset, $value) * $redis->strlen('key'); // 5 * */ - public function strlen($key) - { - } + public function strlen($key) {} /** * Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the @@ -2798,9 +2578,7 @@ public function strlen($key) * $redis->bitpos('key', 0, 1, 5); // int(-1) * */ - public function bitpos($key, $bit, $start = 0, $end = -1) - { - } + public function bitpos($key, $bit, $start = 0, $end = -1) {} /** * Return a single bit out of a larger string @@ -2820,9 +2598,7 @@ public function bitpos($key, $bit, $start = 0, $end = -1) * $redis->getBit('key', 1); // 1 * */ - public function getBit($key, $offset) - { - } + public function getBit($key, $offset) {} /** * Changes a single bit of a string. @@ -2844,9 +2620,7 @@ public function getBit($key, $offset) * $redis->get('key'); // chr(0x2f) = "/" = b("0010 1111") * */ - public function setBit($key, $offset, $value) - { - } + public function setBit($key, $offset, $value) {} /** * Count bits in a string @@ -2869,9 +2643,7 @@ public function setBit($key, $offset, $value) * var_dump( $redis->bitCount('bit', 0, 2) ); // int(11) * */ - public function bitCount($key, $start = 0, $end = -1) - { - } + public function bitCount($key, $start = 0, $end = -1) {} /** * Bitwise operation on multiple keys. @@ -2897,9 +2669,7 @@ public function bitCount($key, $start = 0, $end = -1) * $redis->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11 * */ - public function bitOp($operation, $retKey, $key1, ...$otherKeys) - { - } + public function bitOp($operation, $retKey, $key1, ...$otherKeys) {} /** * Removes all entries from the current database. @@ -2911,9 +2681,7 @@ public function bitOp($operation, $retKey, $key1, ...$otherKeys) * @link https://redis.io/commands/flushdb * @example $redis->flushDB(); */ - public function flushDB($async = null) - { - } + public function flushDB($async = null) {} /** * Removes all entries from all databases. @@ -2927,9 +2695,7 @@ public function flushDB($async = null) * @link https://redis.io/commands/flushall * @example $redis->flushAll(); */ - public function flushAll($async = null) - { - } + public function flushAll($async = null) {} /** * Sort @@ -2963,9 +2729,7 @@ public function flushAll($async = null) * var_dump($redis->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5 * */ - public function sort($key, $option = null) - { - } + public function sort($key, $option = null) {} /** * Returns an associative array of strings and integers @@ -3032,9 +2796,7 @@ public function sort($key, $option = null) * $redis->info("CPU"); // just CPU information from Redis INFO * */ - public function info($option = null) - { - } + public function info($option = null) {} /** * Returns an indexed array whose first element is the role @@ -3049,9 +2811,7 @@ public function info($option = null) * $redis->role(); * */ - public function role() - { - } + public function role() {} /** * Resets the statistics reported by Redis using the INFO command (`info()` function). @@ -3070,9 +2830,7 @@ public function role() * @link https://redis.io/commands/config-resetstat */ #[Deprecated(replacement: '%class%->rawCommand(\'CONFIG\', \'RESETSTAT\');')] - public function resetStat() - { - } + public function resetStat() {} /** * Returns the time to live left for a given key, in seconds. If the key doesn't exist, FALSE is returned. @@ -3090,9 +2848,7 @@ public function resetStat() * $redis->ttl('key'); // int(123) * */ - public function ttl($key) - { - } + public function ttl($key) {} /** * Returns a time to live left for a given key, in milliseconds. @@ -3112,9 +2868,7 @@ public function ttl($key) * $redis->pttl('key'); // int(122999) * */ - public function pttl($key) - { - } + public function pttl($key) {} /** * Remove the expiration timer from a key. @@ -3128,9 +2882,7 @@ public function pttl($key) * @link https://redis.io/commands/persist * @example $redis->persist('key'); */ - public function persist($key) - { - } + public function persist($key) {} /** * Sets multiple key-value pairs in one atomic command. @@ -3153,9 +2905,7 @@ public function persist($key) * // string(6) "value1" * */ - public function mSet($array) - { - } + public function mSet($array) {} /** * Get the values of all the specified keys. @@ -3177,9 +2927,7 @@ public function mSet($array) * */ #[Deprecated(replacement: '%class%->mGet(%parametersList%)')] - public function getMultiple(array $keys) - { - } + public function getMultiple(array $keys) {} /** * Returns the values of all specified keys. @@ -3209,9 +2957,7 @@ public function getMultiple(array $keys) * // } * */ - public function mGet(array $array) - { - } + public function mGet(array $array) {} /** * @see mset() @@ -3222,9 +2968,7 @@ public function mGet(array $array) * * @link https://redis.io/commands/msetnx */ - public function msetnx(array $array) - { - } + public function msetnx(array $array) {} /** * Pops a value from the tail of a list, and pushes it to the front of another list. @@ -3271,9 +3015,7 @@ public function msetnx(array $array) * //} * */ - public function rPopLPush($srcKey, $dstKey) - { - } + public function rPopLPush($srcKey, $dstKey) {} /** * A blocking version of rPopLPush, with an integral timeout in the third parameter. @@ -3288,9 +3030,7 @@ public function rPopLPush($srcKey, $dstKey) * * @link https://redis.io/commands/brpoplpush */ - public function bRPopLPush($srcKey, $dstKey, $timeout) - { - } + public function bRPopLPush($srcKey, $dstKey, $timeout) {} /** * Adds the specified member with a given score to the sorted set stored at key @@ -3336,9 +3076,7 @@ public function bRPopLPush($srcKey, $dstKey, $timeout) * // ["v6"]=> float(8) * */ - public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) - { - } + public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) {} /** * Returns a range of elements from the ordered set stored at the specified key, @@ -3368,9 +3106,7 @@ public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $v * $redis->zRange('key1', 0, -1, true); // array('val0' => 0, 'val2' => 2, 'val10' => 10) * */ - public function zRange($key, $start, $end, $withscores = null) - { - } + public function zRange($key, $start, $end, $withscores = null) {} /** * Deletes a specified member from the ordered set. @@ -3396,9 +3132,7 @@ public function zRange($key, $start, $end, $withscores = null) * // } * */ - public function zRem($key, $member1, ...$otherMembers) - { - } + public function zRem($key, $member1, ...$otherMembers) {} /** * @link https://redis.io/commands/zrem @@ -3412,9 +3146,7 @@ public function zRem($key, $member1, ...$otherMembers) * @throws RedisException */ #[Deprecated(replacement: '%class%->zRem(%parametersList%)')] - public function zDelete($key, $member1, ...$otherMembers) - { - } + public function zDelete($key, $member1, ...$otherMembers) {} /** * Returns the elements of the sorted set stored at the specified key in the range [start, end] @@ -3445,9 +3177,7 @@ public function zDelete($key, $member1, ...$otherMembers) * $redis->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0) * */ - public function zRevRange($key, $start, $end, $withscore = null) - { - } + public function zRevRange($key, $start, $end, $withscore = null) {} /** * Returns the elements of the sorted set stored at the specified key which have scores in the @@ -3479,9 +3209,7 @@ public function zRevRange($key, $start, $end, $withscore = null) * $redis->zRangeByScore('key', 0, 3, array('withscores' => TRUE, 'limit' => array(1, 1)); // array('val2' => 2) * */ - public function zRangeByScore($key, $start, $end, array $options = []) - { - } + public function zRangeByScore($key, $start, $end, array $options = []) {} /** * @param string $key @@ -3494,9 +3222,7 @@ public function zRangeByScore($key, $start, $end, array $options = []) * @throws RedisException * @see zRangeByScore() */ - public function zRevRangeByScore(string $key, string $start, string $end, array $options = []) - { - } + public function zRevRangeByScore(string $key, string $start, string $end, array $options = []) {} /** * Returns a lexigraphical range of members in a sorted set, assuming the members have the same score. The @@ -3526,25 +3252,15 @@ public function zRevRangeByScore(string $key, string $start, string $end, array * $redis->zRangeByLex('key', '-', '[c'); // array('b', 'c') * */ - public function zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) - { - } + public function zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) {} - public function zMscore(string $key, string $member, string ...$other_members): array|false - { - } + public function zMscore(string $key, string $member, string ...$other_members): array|false{} - public function zPopMax(string $key, int $value = null): array|false - { - } + public function zPopMax(string $key, int $value = null): array|false{} - public function zPopMin(string $key, int $value = null): array|false - { - } + public function zPopMin(string $key, int $value = null): array|false{} - public function zRandMember(string $key, array $options = null): string|array|false - { - } + public function zRandMember(string $key, array $options = null): string|array|false{} /** * @param string $key @@ -3560,9 +3276,7 @@ public function zRandMember(string $key, array $options = null): string|array|fa * @see zRangeByLex() * @link https://redis.io/commands/zrevrangebylex */ - public function zRevRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) - { - } + public function zRevRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) {} /** * Removes all elements in the sorted set stored at key between the lexicographical range specified by min and max. @@ -3575,9 +3289,7 @@ public function zRevRangeByLex(string $key, string $min, string $max, int $offse * @return int|false the number of elements removed. * @link https://redis.io/commands/zremrangebylex */ - public function zRemRangeByLex(string $key, string $min, string $max) - { - } + public function zRemRangeByLex(string $key, string $min, string $max) {} /** @@ -3602,9 +3314,7 @@ public function zRemRangeByLex(string $key, string $min, string $max) * $redis->zCount('key', 0, 3); // 2, corresponding to array('val0', 'val2') * */ - public function zCount($key, $start, $end) - { - } + public function zCount($key, $start, $end) {} /** * Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end]. @@ -3626,9 +3336,7 @@ public function zCount($key, $start, $end) * $redis->zRemRangeByScore('key', '0', '3'); // 2 * */ - public function zRemRangeByScore($key, $start, $end) - { - } + public function zRemRangeByScore($key, $start, $end) {} /** * @param string $key @@ -3638,9 +3346,7 @@ public function zRemRangeByScore($key, $start, $end) * @throws RedisException */ #[Deprecated(replacement: '%class%->zRemRangeByScore(%parametersList%)')] - public function zDeleteRangeByScore($key, $start, $end) - { - } + public function zDeleteRangeByScore($key, $start, $end) {} /** * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. @@ -3663,9 +3369,7 @@ public function zDeleteRangeByScore($key, $start, $end) * $redis->zRange('key', 0, -1, array('withscores' => TRUE)); // array('three' => 3) * */ - public function zRemRangeByRank($key, $start, $end) - { - } + public function zRemRangeByRank($key, $start, $end) {} /** * @link https://redis.io/commands/zremrangebyscore @@ -3677,9 +3381,7 @@ public function zRemRangeByRank($key, $start, $end) * @throws RedisException */ #[Deprecated(replacement: '%class%->zRemRangeByRank(%parametersList%)')] - public function zDeleteRangeByRank($key, $start, $end) - { - } + public function zDeleteRangeByRank($key, $start, $end) {} /** * Returns the cardinality of an ordered set. @@ -3699,13 +3401,9 @@ public function zDeleteRangeByRank($key, $start, $end) * $redis->zCard('key'); // 3 * */ - public function zCard($key) - { - } + public function zCard($key) {} - public function zdiff(array $keys, array $options = null): array|false - { - } + public function zdiff(array $keys, array $options = null): array|false{} /** * @param string $key @@ -3714,9 +3412,7 @@ public function zdiff(array $keys, array $options = null): array|false * @throws RedisException */ #[Deprecated(replacement: '%class%->zCard(%parametersList%)')] - public function zSize($key) - { - } + public function zSize($key) {} /** * Returns the score of a given member in the specified sorted set. @@ -3735,9 +3431,7 @@ public function zSize($key) * $redis->zScore('key', 'val2'); // 2.5 * */ - public function zScore($key, $member) - { - } + public function zScore($key, $member) {} /** * Returns the rank of a given member in the specified sorted set, starting at 0 for the item @@ -3762,9 +3456,7 @@ public function zScore($key, $member) * $redis->zRevRank('key', 'two'); // 0 * */ - public function zRank($key, $member) - { - } + public function zRank($key, $member) {} /** * @see zRank() @@ -3777,9 +3469,7 @@ public function zRank($key, $member) * * @link https://redis.io/commands/zrevrank */ - public function zRevRank($key, $member) - { - } + public function zRevRank($key, $member) {} /** * Increments the score of a member from a sorted set by a given amount. @@ -3801,9 +3491,7 @@ public function zRevRank($key, $member) * $redis->zIncrBy('key', 1, 'member1'); // 3.5 * */ - public function zIncrBy($key, $value, $member) - { - } + public function zIncrBy($key, $value, $member) {} /** * Creates an union of sorted sets given in second argument. @@ -3846,9 +3534,7 @@ public function zIncrBy($key, $value, $member) * $redis->zUnionStore('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1') * */ - public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggregateFunction = null) - { - } + public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggregateFunction = null) {} /** * @param string $Output @@ -3859,9 +3545,7 @@ public function zUnionStore($output, $zSetKeys, ?array $weights = null, $aggrega * @throws RedisException */ #[Deprecated(replacement: '%class%->zUnionStore(%parametersList%)')] - public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') - { - } + public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} /** * Creates an intersection of sorted sets given in second argument. @@ -3908,9 +3592,7 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * $redis->zInterStore('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1') * */ - public function zInterStore($output, $zSetKeys, array $weights = null, $aggregateFunction = null) - { - } + public function zInterStore($output, $zSetKeys, array $weights = null, $aggregateFunction = null) {} /** * @param $Output @@ -3920,9 +3602,7 @@ public function zInterStore($output, $zSetKeys, array $weights = null, $aggregat * @throws RedisException */ #[Deprecated(replacement: '%class%->zInterStore(%parametersList%)')] - public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') - { - } + public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} /** * Scan a sorted set for members, with optional pattern and count @@ -3947,9 +3627,7 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * } * */ - public function zScan($key, &$iterator, $pattern = null, $count = 0) - { - } + public function zScan($key, &$iterator, $pattern = null, $count = 0) {} /** * Block until Redis can pop the highest or lowest scoring members from one or more ZSETs. @@ -3977,9 +3655,7 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) * $redis->bzPopMax('zs1', 'zs2', 5); * */ - public function bzPopMax($key, $timeout_or_key, ...$extra_args) - { - } + public function bzPopMax($key, $timeout_or_key, ...$extra_args) {} /** * @param string|array $key @@ -3995,9 +3671,7 @@ public function bzPopMax($key, $timeout_or_key, ...$extra_args) * @since >= 5.0 * @link https://redis.io/commands/bzpopmin */ - public function bzPopMin($key, $timeout_or_key, ...$extra_args) - { - } + public function bzPopMin($key, $timeout_or_key, ...$extra_args) {} /** * Can pop the highest scoring members from one ZSET. @@ -4020,9 +3694,7 @@ public function bzPopMin($key, $timeout_or_key, ...$extra_args) * $redis->zPopMax('zs1', 3); * */ - public function zPopMax($key, $count = null) - { - } + public function zPopMax($key, $count = null) {} /** * Can pop the lowest scoring members from one ZSET. @@ -4045,9 +3717,7 @@ public function zPopMax($key, $count = null) * $redis->zPopMin('zs1', 3); * */ - public function zPopMin($key, $count = null) - { - } + public function zPopMin($key, $count = null) {} /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. @@ -4073,9 +3743,7 @@ public function zPopMin($key, $count = null) * $redis->hGet('h', 'key1'); // returns "plop" * */ - public function hSet($key, $hashKey, string $value) - { - } + public function hSet($key, $hashKey, string $value) {} /** * Adds a value to the hash stored at key only if this field isn't already in the hash. @@ -4097,9 +3765,7 @@ public function hSet($key, $hashKey, string $value) * wasn't replaced. * */ - public function hSetNx($key, $hashKey, $value) - { - } + public function hSetNx($key, $hashKey, $value) {} /** * Gets a value from the hash stored at key. @@ -4114,9 +3780,7 @@ public function hSetNx($key, $hashKey, $value) * * @link https://redis.io/commands/hget */ - public function hGet($key, $hashKey) - { - } + public function hGet($key, $hashKey) {} /** * Returns the length of a hash, in number of items @@ -4136,9 +3800,7 @@ public function hGet($key, $hashKey) * $redis->hLen('h'); // returns 2 * */ - public function hLen($key) - { - } + public function hLen($key) {} /** * Removes a values from the hash stored at key. @@ -4173,9 +3835,7 @@ public function hLen($key) * // } * */ - public function hDel($key, $hashKey1, ...$otherHashKeys) - { - } + public function hDel($key, $hashKey1, ...$otherHashKeys) {} /** * Returns the keys in a hash, as an array of strings. @@ -4210,9 +3870,7 @@ public function hDel($key, $hashKey1, ...$otherHashKeys) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hKeys($key) - { - } + public function hKeys($key) {} /** * Returns the values in a hash, as an array of strings. @@ -4247,9 +3905,7 @@ public function hKeys($key) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hVals($key) - { - } + public function hVals($key) {} /** * Returns the whole hash, as an array of strings indexed by strings. @@ -4284,9 +3940,7 @@ public function hVals($key) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hGetAll($key) - { - } + public function hGetAll($key) {} /** * Verify if the specified member exists in a key. @@ -4306,9 +3960,7 @@ public function hGetAll($key) * $redis->hExists('h', 'NonExistingKey'); // FALSE * */ - public function hExists($key, $hashKey) - { - } + public function hExists($key, $hashKey) {} /** * Increments the value of a member from a hash by a given amount. @@ -4329,9 +3981,7 @@ public function hExists($key, $hashKey) * $redis->hIncrBy('h', 'x', 1); // h[x] ← 2 + 1. Returns 3 * */ - public function hIncrBy($key, $hashKey, $value) - { - } + public function hIncrBy($key, $hashKey, $value) {} /** * Increment the float value of a hash field by the given amount @@ -4364,9 +4014,7 @@ public function hIncrBy($key, $hashKey, $value) * } * */ - public function hIncrByFloat($key, $field, $increment) - { - } + public function hIncrByFloat($key, $field, $increment) {} /** * Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast. @@ -4387,9 +4035,7 @@ public function hIncrByFloat($key, $field, $increment) * $redis->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now. * */ - public function hMSet($key, $hashKeys) - { - } + public function hMSet($key, $hashKeys) {} /** * Retrieve the values associated to the specified fields in the hash. @@ -4411,9 +4057,7 @@ public function hMSet($key, $hashKeys) * $redis->hMGet('h', array('field1', 'field2')); // returns array('field1' => 'value1', 'field2' => 'value2') * */ - public function hMGet($key, $hashKeys) - { - } + public function hMGet($key, $hashKeys) {} /** * Scan a HASH value for members, with an optional pattern and count. @@ -4438,9 +4082,7 @@ public function hMGet($key, $hashKeys) * // } * */ - public function hScan($key, &$iterator, $pattern = null, $count = 0) - { - } + public function hScan($key, &$iterator, $pattern = null, $count = 0) {} /** * Get the string length of the value associated with field in the hash stored at key @@ -4456,9 +4098,7 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) * @link https://redis.io/commands/hstrlen * @since >= 3.2 */ - public function hStrLen(string $key, string $field) - { - } + public function hStrLen(string $key, string $field) {} /** * Add one or more geospatial items to the specified key. @@ -4489,9 +4129,7 @@ public function hStrLen(string $key, string $field) * ); // 2 * */ - public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) - { - } + public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) {} /** * Retrieve Geohash strings for one or more elements of a geospatial index. @@ -4519,9 +4157,7 @@ public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) * // } * */ - public function geoHash($key, ...$member) - { - } + public function geoHash($key, ...$member) {} /** * Return longitude, latitude positions for each requested member. @@ -4554,17 +4190,11 @@ public function geoHash($key, ...$member) * } * */ - public function geoPos(string $key, string ...$member) - { - } + public function geoPos(string $key, string ...$member) {} - public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false - { - } + public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false{} - public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false - { - } + public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false{} /** * Return the distance between two members in a geospatial set. @@ -4617,9 +4247,7 @@ public function geosearchstore(string $dst, string $src, array|string $position, * bool(false) * */ - public function geoDist($key, $member1, $member2, $unit = null) - { - } + public function geoDist($key, $member1, $member2, $unit = null) {} /** * Return members of a set with geospatial information that are within the radius specified by the caller. @@ -4721,9 +4349,7 @@ public function geoDist($key, $member1, $member2, $unit = null) * } * */ - public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $options = []) - { - } + public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $options = []) {} /** * This method is identical to geoRadius except that instead of passing a longitude and latitude as the "source" @@ -4765,9 +4391,7 @@ public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $op * } * */ - public function geoRadiusByMember($key, $member, $radius, $units, array $options = []) - { - } + public function geoRadiusByMember($key, $member, $radius, $units, array $options = []) {} /** * Get or Set the redis config keys. @@ -4787,9 +4411,7 @@ public function geoRadiusByMember($key, $member, $radius, $units, array $options * $redis->config("SET", "dir", "/var/run/redis/dumps/"); * */ - public function config($operation, $key, $value = null) - { - } + public function config($operation, $key, $value = null) {} /** * Evaluate a LUA script serverside @@ -4818,9 +4440,7 @@ public function config($operation, $key, $value = null) * $redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}"); * */ - public function eval($script, $args = [], $numKeys = 0) - { - } + public function eval($script, $args = [], $numKeys = 0) {} /** * @param string $script @@ -4831,9 +4451,7 @@ public function eval($script, $args = [], $numKeys = 0) * @throws RedisException */ #[Deprecated(replacement: '%class%->eval(%parametersList%)')] - public function evaluate($script, $args = [], $numKeys = 0) - { - } + public function evaluate($script, $args = [], $numKeys = 0) {} /** * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. @@ -4857,9 +4475,7 @@ public function evaluate($script, $args = [], $numKeys = 0) * $redis->evalSha($sha); // Returns 1 * */ - public function evalSha($scriptSha, $args = [], $numKeys = 0) - { - } + public function evalSha($scriptSha, $args = [], $numKeys = 0) {} /** * @param string $scriptSha @@ -4869,9 +4485,7 @@ public function evalSha($scriptSha, $args = [], $numKeys = 0) * @throws RedisException */ #[Deprecated(replacement: '%class%->evalSha(%parametersList%)')] - public function evaluateSha($scriptSha, $args = [], $numKeys = 0) - { - } + public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {} /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. @@ -4899,9 +4513,7 @@ public function evaluateSha($scriptSha, $args = [], $numKeys = 0) * SCRIPT KILL will return true if a script was able to be killed and false if not * SCRIPT EXISTS will return an array with TRUE or FALSE for each passed script */ - public function script($command, ...$script) - { - } + public function script($command, ...$script) {} /** * The last error message (if any) @@ -4917,9 +4529,7 @@ public function script($command, ...$script) * // "ERR Error compiling script (new function): user_script:1: '=' expected near '-'" * */ - public function getLastError() - { - } + public function getLastError() {} /** * Clear the last error message @@ -4939,9 +4549,7 @@ public function getLastError() * // NULL * */ - public function clearLastError() - { - } + public function clearLastError() {} /** * Issue the CLIENT command with various arguments. @@ -4976,9 +4584,7 @@ public function clearLastError() * $redis->client('kill', ); // Kill the process at ip:port * */ - public function client($command, $value = null) - { - } + public function client($command, $value = null) {} /** * A utility method to prefix the value with the prefix setting for phpredis. @@ -4996,9 +4602,7 @@ public function client($command, $value = null) * $redis->_prefix('my-value'); // Will return 'my-prefix:my-value' * */ - public function _prefix($value) - { - } + public function _prefix($value) {} /** * A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the @@ -5015,9 +4619,7 @@ public function _prefix($value) * $redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3) * */ - public function _unserialize($value) - { - } + public function _unserialize($value) {} /** * A utility method to serialize values manually. This method allows you to serialize a value with whatever @@ -5039,9 +4641,7 @@ public function _unserialize($value) * $redis->_serialize("foo"); // Returns 's:3:"foo";' * */ - public function _serialize($value) - { - } + public function _serialize($value) {} /** * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. @@ -5059,9 +4659,7 @@ public function _serialize($value) * $val = $redis->dump('foo'); // $val will be the Redis encoded key value * */ - public function dump($key) - { - } + public function dump($key) {} /** * Restore a key from the result of a DUMP operation. @@ -5082,9 +4680,7 @@ public function dump($key) * $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo' * */ - public function restore($key, $ttl, $value) - { - } + public function restore($key, $ttl, $value) {} /** * Migrates a key to a different Redis instance. @@ -5107,9 +4703,7 @@ public function restore($key, $ttl, $value) * $redis->migrate('backup', 6379, 'foo', 0, 3600); * */ - public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) - { - } + public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) {} /** * Return the current Redis server time. @@ -5129,9 +4723,7 @@ public function migrate($host, $port, $key, $db, $timeout, $copy = false, $repla * // } * */ - public function time() - { - } + public function time() {} /** * Scan the keyspace for keys @@ -5155,9 +4747,7 @@ public function time() * } * */ - public function scan(&$iterator, $pattern = null, $count = 0) - { - } + public function scan(&$iterator, $pattern = null, $count = 0) {} /** * Adds all the element arguments to the HyperLogLog data structure stored at the key. @@ -5172,9 +4762,7 @@ public function scan(&$iterator, $pattern = null, $count = 0) * @link https://redis.io/commands/pfadd * @example $redis->pfAdd('key', array('elem1', 'elem2')) */ - public function pfAdd($key, array $elements) - { - } + public function pfAdd($key, array $elements) {} /** * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data @@ -5195,9 +4783,7 @@ public function pfAdd($key, array $elements) * $redis->pfCount(array('key1', 'key2')); // int(3) * */ - public function pfCount($key) - { - } + public function pfCount($key) {} /** * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality @@ -5219,9 +4805,7 @@ public function pfCount($key) * $redis->pfCount('key3'); // int(3) * */ - public function pfMerge($destKey, array $sourceKeys) - { - } + public function pfMerge($destKey, array $sourceKeys) {} /** * Send arbitrary things to the redis server. @@ -5239,9 +4823,7 @@ public function pfMerge($destKey, array $sourceKeys) * $redis->rawCommand('GET", 'key'); // string(5) "value" * */ - public function rawCommand($command, ...$arguments) - { - } + public function rawCommand($command, ...$arguments) {} /** * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. @@ -5252,9 +4834,7 @@ public function rawCommand($command, ...$arguments) * * @example $redis->getMode(); */ - public function getMode() - { - } + public function getMode() {} /** * Acknowledge one or more messages on behalf of a consumer group. @@ -5273,9 +4853,7 @@ public function getMode() * $redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']); * */ - public function xAck($stream, $group, $messages) - { - } + public function xAck($stream, $group, $messages) {} /** * Add a message to a stream @@ -5299,9 +4877,7 @@ public function xAck($stream, $group, $messages) * $redis->xAdd('mystream', "*", ['field' => 'value'], 10, true); * */ - public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) - { - } + public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) {} /** * Claim ownership of one or more pending messages @@ -5338,9 +4914,7 @@ public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, * ); * */ - public function xClaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options) - { - } + public function xClaim(string $key, string $group, string $consumer, int $min_iddle, array $ids, array $options) {} /** * Delete one or more messages from a stream @@ -5358,9 +4932,7 @@ public function xClaim(string $key, string $group, string $consumer, int $min_id * $redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']); * */ - public function xDel($key, $ids) - { - } + public function xDel($key, $ids) {} /** * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER' @@ -5381,9 +4953,7 @@ public function xDel($key, $ids) * $redis->xGroup('DESTROY', 'mystream', 'mygroup'); * */ - public function xGroup($operation, $key = null, $group = null, $msgId = null, $mkStream = false) - { - } + public function xGroup($operation, $key = null, $group = null, $msgId = null, $mkStream = false) {} /** * Get information about a stream or consumer groups @@ -5402,9 +4972,7 @@ public function xGroup($operation, $key = null, $group = null, $msgId = null, $m * $redis->xInfo('STREAM', 'mystream'); * */ - public function xInfo($operation, $stream = null, $group = null) - { - } + public function xInfo($operation, $stream = null, $group = null) {} /** * Get the length of a given stream. @@ -5421,9 +4989,7 @@ public function xInfo($operation, $stream = null, $group = null) * $redis->xLen('mystream'); * */ - public function xLen($stream) - { - } + public function xLen($stream) {} /** * Get information about pending messages in a given stream @@ -5447,9 +5013,7 @@ public function xLen($stream) * $redis->xPending('mystream', 'mygroup', '-', '+', 1, 'consumer-1'); * */ - public function xPending($stream, $group, $start = null, $end = null, $count = -1, $consumer = null) - { - } + public function xPending($stream, $group, $start = null, $end = null, $count = -1, $consumer = null) {} /** * Get a range of messages from a given stream @@ -5472,9 +5036,7 @@ public function xPending($stream, $group, $start = null, $end = null, $count = - * $redis->xRange('mystream', '-', '+', 2); * */ - public function xRange($stream, $start, $end, $count = -1) - { - } + public function xRange($stream, $start, $end, $count = -1) {} /** * Read data from one or more streams and only return IDs greater than sent in the command. @@ -5493,9 +5055,7 @@ public function xRange($stream, $start, $end, $count = -1) * $redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']); * */ - public function xRead($streams, $count = -1, $block = -1) - { - } + public function xRead($streams, $count = -1, $block = -1) {} /** * This method is similar to xRead except that it supports reading messages for a specific consumer group. @@ -5519,9 +5079,7 @@ public function xRead($streams, $count = -1, $block = -1) * $redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000); * */ - public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) - { - } + public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) {} /** * This is identical to xRange except the results come back in reverse order. @@ -5542,9 +5100,7 @@ public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) * $redis->xRevRange('mystream', '+', '-'); * */ - public function xRevRange($stream, $end, $start, $count = -1) - { - } + public function xRevRange($stream, $end, $start, $count = -1) {} /** * Trim the stream length to a given maximum. @@ -5568,9 +5124,7 @@ public function xRevRange($stream, $end, $start, $count = -1) * $redis->xTrim('mystream', 100, true); * */ - public function xTrim($stream, $maxLen, $isApproximate) - { - } + public function xTrim($stream, $maxLen, $isApproximate) {} /** * Adds a values to the set value stored at key. @@ -5592,9 +5146,7 @@ public function xTrim($stream, $maxLen, $isApproximate) * $redis->sAddArray('k', array('v1', 'v2', 'v3')); // boolean * */ - public function sAddArray($key, array $values) - { - } + public function sAddArray($key, array $values) {} } class RedisException extends Exception diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index 402eae4b4..3e919dcb2 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -105,16 +105,12 @@ class RedisCluster * $redisClusterDev = new RedisCluster('test'); * */ - public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null) - { - } + public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null) {} /** * Disconnects from the RedisCluster instance, except when pconnect is used. */ - public function close() - { - } + public function close() {} /** * Get the value related to the specified key @@ -130,9 +126,7 @@ public function close() * $redisCluster->get('key'); * */ - public function get($key) - { - } + public function get($key) {} /** * Set the string value in argument as value of the key. @@ -162,9 +156,7 @@ public function get($key) * $redisCluster->set('key', 'value', Array('xx', 'px'=>1000)); * */ - public function set($key, $value, $timeout = null) - { - } + public function set($key, $value, $timeout = null) {} /** * Returns the values of all specified keys. @@ -196,9 +188,7 @@ public function set($key, $value, $timeout = null) * // } * */ - public function mget(array $array) - { - } + public function mget(array $array) {} /** * Sets multiple key-value pairs in one atomic command. @@ -218,9 +208,7 @@ public function mget(array $array) * // string(6) "value1" * */ - public function mset(array $array) - { - } + public function mset(array $array) {} /** * @see mset() @@ -230,9 +218,7 @@ public function mset(array $array) * @return int 1 (if the keys were set) or 0 (no key was set) * @link https://redis.io/commands/msetnx */ - public function msetnx(array $array) - { - } + public function msetnx(array $array) {} /** * Remove specified keys. @@ -253,9 +239,7 @@ public function msetnx(array $array) * $redisCluster->del(array('key3', 'key4')); // return 2 * */ - public function del($key1, ...$otherKeys) - { - } + public function del($key1, ...$otherKeys) {} /** * Set the string value in argument as value of the key, with a time to live. @@ -271,9 +255,7 @@ public function del($key1, ...$otherKeys) * $redisCluster->setex('key', 3600, 'value'); // sets key → value, with 1h TTL. * */ - public function setex($key, $ttl, $value) - { - } + public function setex($key, $ttl, $value) {} /** * PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds @@ -290,9 +272,7 @@ public function setex($key, $ttl, $value) * $redisCluster->psetex('key', 1000, 'value'); // sets key → value, with 1s TTL. * */ - public function psetex($key, $ttl, $value) - { - } + public function psetex($key, $ttl, $value) {} /** * Set the string value in argument as value of the key if the key doesn't already exist in the database. @@ -308,9 +288,7 @@ public function psetex($key, $ttl, $value) * $redisCluster->setnx('key', 'value'); // return FALSE * */ - public function setnx($key, $value) - { - } + public function setnx($key, $value) {} /** * Sets a value and returns the previous entry at that key. @@ -327,9 +305,7 @@ public function setnx($key, $value) * $newValue = $redisCluster->get('x'); // return 'lol' * */ - public function getSet($key, $value) - { - } + public function getSet($key, $value) {} /** * Verify if the specified key exists. @@ -345,9 +321,7 @@ public function getSet($key, $value) * $redisCluster->exists('NonExistingKey'); // FALSE * */ - public function exists($key) - { - } + public function exists($key) {} /** * Returns the keys that match a certain pattern. @@ -362,9 +336,7 @@ public function exists($key) * $keyWithUserPrefix = $redisCluster->keys('user*'); * */ - public function keys($pattern) - { - } + public function keys($pattern) {} /** * Returns the type of data pointed by a given key. @@ -384,9 +356,7 @@ public function keys($pattern) * @link https://redis.io/commands/type * @example $redisCluster->type('key'); */ - public function type($key) - { - } + public function type($key) {} /** * Returns and removes the first element of the list. @@ -416,9 +386,7 @@ public function type($key) * // } * */ - public function lPop($key) - { - } + public function lPop($key) {} /** * Returns and removes the last element of the list. @@ -448,9 +416,7 @@ public function lPop($key) * // } * */ - public function rPop($key) - { - } + public function rPop($key) {} /** * Set the list at index with the new value. @@ -472,9 +438,7 @@ public function rPop($key) * $redisCluster->lGet('key1', 0); // 'X' * */ - public function lSet($key, $index, $value) - { - } + public function lSet($key, $index, $value) {} /** * Removes and returns a random element from the set value at Key. @@ -496,9 +460,7 @@ public function lSet($key, $index, $value) * var_dump($redisCluster->sMembers('key1'));// 'key1' => {'set2'} * */ - public function sPop($key) - { - } + public function sPop($key) {} /** * Adds the string values to the head (left) of the list. Creates the list if the key didn't exist. @@ -524,9 +486,7 @@ public function sPop($key) * // } * */ - public function lPush($key, $value1, $value2 = null, $valueN = null) - { - } + public function lPush($key, $value1, $value2 = null, $valueN = null) {} /** * Adds the string values to the tail (right) of the list. Creates the list if the key didn't exist. @@ -552,9 +512,7 @@ public function lPush($key, $value1, $value2 = null, $valueN = null) * // } * */ - public function rPush($key, $value1, $value2 = null, $valueN = null) - { - } + public function rPush($key, $value1, $value2 = null, $valueN = null) {} /** * BLPOP is a blocking list pop primitive. @@ -597,9 +555,7 @@ public function rPush($key, $value1, $value2 = null, $valueN = null) * // array('key1', 'A') is returned * */ - public function blPop(array $keys, $timeout) - { - } + public function blPop(array $keys, $timeout) {} /** * BRPOP is a blocking list pop primitive. @@ -645,9 +601,7 @@ public function blPop(array $keys, $timeout) * // array('key1', 'A') is returned * */ - public function brPop(array $keys, $timeout) - { - } + public function brPop(array $keys, $timeout) {} /** * Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure. @@ -667,9 +621,7 @@ public function brPop(array $keys, $timeout) * // key1 now points to the following list: [ 'A', 'B', 'C' ] * */ - public function rPushx($key, $value) - { - } + public function rPushx($key, $value) {} /** * Adds the string value to the head (left) of the list if the list exists. @@ -689,9 +641,7 @@ public function rPushx($key, $value) * // key1 now points to the following list: [ 'C', 'B', 'A' ] * */ - public function lPushx($key, $value) - { - } + public function lPushx($key, $value) {} /** * Insert value in the list before or after the pivot value. the parameter options @@ -723,9 +673,7 @@ public function lPushx($key, $value) * $redisCluster->lInsert('key1', RedisCluster::AFTER, 'W', 'value'); // -1 * */ - public function lInsert($key, $position, $pivot, $value) - { - } + public function lInsert($key, $position, $pivot, $value) {} /** * Return the specified element of the list stored at the specified key. @@ -748,9 +696,7 @@ public function lInsert($key, $position, $pivot, $value) * $redisCluster->lGet('key1', 10); // `FALSE` * */ - public function lIndex($key, $index) - { - } + public function lIndex($key, $index) {} /** * Removes the first count occurrences of the value element from the list. @@ -777,9 +723,7 @@ public function lIndex($key, $index) * $redisCluster->lRange('key1', 0, -1); // array('C', 'B', 'A') * */ - public function lRem($key, $value, $count) - { - } + public function lRem($key, $value, $count) {} /** * A blocking version of rpoplpush, with an integral timeout in the third parameter. @@ -791,9 +735,7 @@ public function lRem($key, $value, $count) * @return string|false The element that was moved in case of success, FALSE in case of timeout. * @link https://redis.io/commands/brpoplpush */ - public function brpoplpush($srcKey, $dstKey, $timeout) - { - } + public function brpoplpush($srcKey, $dstKey, $timeout) {} /** * Pops a value from the tail of a list, and pushes it to the front of another list. @@ -837,9 +779,7 @@ public function brpoplpush($srcKey, $dstKey, $timeout) * //} * */ - public function rpoplpush($srcKey, $dstKey) - { - } + public function rpoplpush($srcKey, $dstKey) {} /** * Returns the size of a list identified by Key. If the list didn't exist or is empty, @@ -860,9 +800,7 @@ public function rpoplpush($srcKey, $dstKey) * $redisCluster->lLen('key1'); // 2 * */ - public function lLen($key) - { - } + public function lLen($key) {} /** * Returns the set cardinality (number of elements) of the set stored at key. @@ -880,9 +818,7 @@ public function lLen($key) * $redisCluster->sCard('keyX'); // 0 * */ - public function sCard($key) - { - } + public function sCard($key) {} /** * Returns all the members of the set value stored at key. @@ -914,9 +850,7 @@ public function sCard($key) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function sMembers($key) - { - } + public function sMembers($key) {} /** * Returns if member is a member of the set stored at key. @@ -936,9 +870,7 @@ public function sMembers($key) * $redisCluster->sIsMember('key1', 'setX'); // FALSE * */ - public function sIsMember($key, $value) - { - } + public function sIsMember($key, $value) {} /** * Adds a values to the set value stored at key. @@ -957,9 +889,7 @@ public function sIsMember($key, $value) * $redisCluster->sAdd('k', 'v1', 'v2', 'v3'); // int(2) * */ - public function sAdd($key, $value1, $value2 = null, $valueN = null) - { - } + public function sAdd($key, $value1, $value2 = null, $valueN = null) {} /** * Adds a values to the set value stored at key. @@ -975,9 +905,7 @@ public function sAdd($key, $value1, $value2 = null, $valueN = null) * //This is a feature in php only. Same as $redisCluster->sAdd('k', 'v1', 'v2', 'v3'); * */ - public function sAddArray($key, array $valueArray) - { - } + public function sAddArray($key, array $valueArray) {} /** * Removes the specified members from the set value stored at key. @@ -1000,9 +928,7 @@ public function sAddArray($key, array $valueArray) * // } * */ - public function sRem($key, $member1, $member2 = null, $memberN = null) - { - } + public function sRem($key, $member1, $member2 = null, $memberN = null) {} /** * Performs the union between N sets and returns it. @@ -1040,9 +966,7 @@ public function sRem($key, $member1, $member2 = null, $memberN = null) * //} * */ - public function sUnion($key1, $key2, $keyN = null) - { - } + public function sUnion($key1, $key2, $keyN = null) {} /** * Performs the same action as sUnion, but stores the result in the first key @@ -1083,9 +1007,7 @@ public function sUnion($key1, $key2, $keyN = null) * //} * */ - public function sUnionStore($dstKey, $key1, $key2, $keyN = null) - { - } + public function sUnionStore($dstKey, $key1, $key2, $keyN = null) {} /** * Returns the members of a set resulting from the intersection of all the sets @@ -1124,9 +1046,7 @@ public function sUnionStore($dstKey, $key1, $key2, $keyN = null) * //} * */ - public function sInter($key1, $key2, $keyN = null) - { - } + public function sInter($key1, $key2, $keyN = null) {} /** * Performs a sInter command and stores the result in a new set. @@ -1165,9 +1085,7 @@ public function sInter($key1, $key2, $keyN = null) * //} * */ - public function sInterStore($dstKey, $key1, $key2, $keyN = null) - { - } + public function sInterStore($dstKey, $key1, $key2, $keyN = null) {} /** * Performs the difference between N sets and returns it. @@ -1202,9 +1120,7 @@ public function sInterStore($dstKey, $key1, $key2, $keyN = null) * //} * */ - public function sDiff($key1, $key2, $keyN = null) - { - } + public function sDiff($key1, $key2, $keyN = null) {} /** * Performs the same action as sDiff, but stores the result in the first key @@ -1242,9 +1158,7 @@ public function sDiff($key1, $key2, $keyN = null) * //} * */ - public function sDiffStore($dstKey, $key1, $key2, $keyN = null) - { - } + public function sDiffStore($dstKey, $key1, $key2, $keyN = null) {} /** * Returns a random element(s) from the set value at Key, without removing it. @@ -1273,9 +1187,7 @@ public function sDiffStore($dstKey, $key1, $key2, $keyN = null) * // } * */ - public function sRandMember($key, $count = null) - { - } + public function sRandMember($key, $count = null) {} /** * Get the length of a string value. @@ -1290,9 +1202,7 @@ public function sRandMember($key, $count = null) * $redisCluster->strlen('key'); // 5 * */ - public function strlen($key) - { - } + public function strlen($key) {} /** * Remove the expiration timer from a key. @@ -1303,9 +1213,7 @@ public function strlen($key) * @link https://redis.io/commands/persist * @example $redisCluster->persist('key'); */ - public function persist($key) - { - } + public function persist($key) {} /** * Returns the remaining time to live of a key that has a timeout. @@ -1320,9 +1228,7 @@ public function persist($key) * @link https://redis.io/commands/ttl * @example $redisCluster->ttl('key'); */ - public function ttl($key) - { - } + public function ttl($key) {} /** * Returns the remaining time to live of a key that has an expire set, @@ -1337,9 +1243,7 @@ public function ttl($key) * @link https://redis.io/commands/pttl * @example $redisCluster->pttl('key'); */ - public function pttl($key) - { - } + public function pttl($key) {} /** * Returns the cardinality of an ordered set. @@ -1356,9 +1260,7 @@ public function pttl($key) * $redisCluster->zCard('key'); // 3 * */ - public function zCard($key) - { - } + public function zCard($key) {} /** * Returns the number of elements of the sorted set stored at the specified key which have @@ -1379,9 +1281,7 @@ public function zCard($key) * $redisCluster->zCount('key', 0, 3); // 2, corresponding to array('val0', 'val2') * */ - public function zCount($key, $start, $end) - { - } + public function zCount($key, $start, $end) {} /** * Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end]. @@ -1400,9 +1300,7 @@ public function zCount($key, $start, $end) * $redisCluster->zRemRangeByScore('key', '0', '3'); // 2 * */ - public function zRemRangeByScore($key, $start, $end) - { - } + public function zRemRangeByScore($key, $start, $end) {} /** * Returns the score of a given member in the specified sorted set. @@ -1418,9 +1316,7 @@ public function zRemRangeByScore($key, $start, $end) * $redisCluster->zScore('key', 'val2'); // 2.5 * */ - public function zScore($key, $member) - { - } + public function zScore($key, $member) {} /** * Adds the specified member with a given score to the sorted set stored at key. @@ -1447,9 +1343,7 @@ public function zScore($key, $member) * // } * */ - public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) - { - } + public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) {} /** * Increments the score of a member from a sorted set by a given amount. @@ -1468,9 +1362,7 @@ public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $sc * $redisCluster->zIncrBy('key', 1, 'member1'); // 3.5 * */ - public function zIncrBy($key, $value, $member) - { - } + public function zIncrBy($key, $value, $member) {} /** * Returns the length of a hash, in number of items @@ -1487,9 +1379,7 @@ public function zIncrBy($key, $value, $member) * $redisCluster->hLen('h'); // returns 2 * */ - public function hLen($key) - { - } + public function hLen($key) {} /** * Returns the keys in a hash, as an array of strings. @@ -1522,9 +1412,7 @@ public function hLen($key) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hKeys($key) - { - } + public function hKeys($key) {} /** * Returns the values in a hash, as an array of strings. @@ -1557,9 +1445,7 @@ public function hKeys($key) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hVals($key) - { - } + public function hVals($key) {} /** * Gets a value from the hash stored at key. @@ -1577,9 +1463,7 @@ public function hVals($key) * $redisCluster->hGet('h', 'a'); // 'X' * */ - public function hGet($key, $hashKey) - { - } + public function hGet($key, $hashKey) {} /** * Returns the whole hash, as an array of strings indexed by strings. @@ -1612,9 +1496,7 @@ public function hGet($key, $hashKey) * // The order is random and corresponds to redis' own internal representation of the set structure. * */ - public function hGetAll($key) - { - } + public function hGetAll($key) {} /** * Verify if the specified member exists in a key. @@ -1631,9 +1513,7 @@ public function hGetAll($key) * $redisCluster->hExists('h', 'NonExistingKey'); // FALSE * */ - public function hExists($key, $hashKey) - { - } + public function hExists($key, $hashKey) {} /** * Increments the value of a member from a hash by a given amount. @@ -1651,9 +1531,7 @@ public function hExists($key, $hashKey) * $redisCluster->hIncrBy('h', 'x', 1); // h[x] ← 2 + 1. Returns 3 * */ - public function hIncrBy($key, $hashKey, $value) - { - } + public function hIncrBy($key, $hashKey, $value) {} /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. @@ -1676,9 +1554,7 @@ public function hIncrBy($key, $hashKey, $value) * $redisCluster->hGet('h', 'key1'); // returns "plop" * */ - public function hSet($key, $hashKey, $value) - { - } + public function hSet($key, $hashKey, $value) {} /** * Adds a value to the hash stored at key only if this field isn't already in the hash. @@ -1697,9 +1573,7 @@ public function hSet($key, $hashKey, $value) * field wasn't replaced. * */ - public function hSetNx($key, $hashKey, $value) - { - } + public function hSetNx($key, $hashKey, $value) {} /** * Retrieve the values associated to the specified fields in the hash. @@ -1719,9 +1593,7 @@ public function hSetNx($key, $hashKey, $value) * 'value2') * */ - public function hMGet($key, $hashKeys) - { - } + public function hMGet($key, $hashKeys) {} /** * Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast. @@ -1739,9 +1611,7 @@ public function hMGet($key, $hashKeys) * $redisCluster->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now. * */ - public function hMSet($key, $hashKeys) - { - } + public function hMSet($key, $hashKeys) {} /** * Removes a values from the hash stored at key. @@ -1776,9 +1646,7 @@ public function hMSet($key, $hashKeys) * // } * */ - public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) - { - } + public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) {} /** * Increment the float value of a hash field by the given amount @@ -1807,9 +1675,7 @@ public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) * // } * */ - public function hIncrByFloat($key, $field, $increment) - { - } + public function hIncrByFloat($key, $field, $increment) {} /** * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. @@ -1825,9 +1691,7 @@ public function hIncrByFloat($key, $field, $increment) * $val = $redisCluster->dump('foo'); // $val will be the Redis encoded key value * */ - public function dump($key) - { - } + public function dump($key) {} /** * Returns the rank of a given member in the specified sorted set, starting at 0 for the item @@ -1849,9 +1713,7 @@ public function dump($key) * $redisCluster->zRevRank('key', 'two'); // 0 * */ - public function zRank($key, $member) - { - } + public function zRank($key, $member) {} /** * @see zRank() @@ -1862,9 +1724,7 @@ public function zRank($key, $member) * @return int the item's score * @link https://redis.io/commands/zrevrank */ - public function zRevRank($key, $member) - { - } + public function zRevRank($key, $member) {} /** * Increment the number stored at key by one. @@ -1881,9 +1741,7 @@ public function zRevRank($key, $member) * $redisCluster->incr('key1'); // 4 * */ - public function incr($key) - { - } + public function incr($key) {} /** * Decrement the number stored at key by one. @@ -1899,9 +1757,7 @@ public function incr($key) * $redisCluster->decr('key1'); // -3 * */ - public function decr($key) - { - } + public function decr($key) {} /** * Increment the number stored at key by one. If the second argument is filled, it will be used as the integer @@ -1921,9 +1777,7 @@ public function decr($key) * $redisCluster->incrBy('key1', 10); // 14 * */ - public function incrBy($key, $value) - { - } + public function incrBy($key, $value) {} /** * Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer @@ -1942,9 +1796,7 @@ public function incrBy($key, $value) * $redisCluster->decrBy('key1', 10); // -13 * */ - public function decrBy($key, $value) - { - } + public function decrBy($key, $value) {} /** * Increment the float value of a key by the given amount @@ -1962,9 +1814,7 @@ public function decrBy($key, $value) * var_dump( $redisCluster->get('x') ); // string(3) "4.5" * */ - public function incrByFloat($key, $increment) - { - } + public function incrByFloat($key, $increment) {} /** * Sets an expiration date (a timeout) on an item. @@ -1982,9 +1832,7 @@ public function incrByFloat($key, $increment) * $redisCluster->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expire($key, $ttl) - { - } + public function expire($key, $ttl) {} /** * Sets an expiration date (a timeout in milliseconds) on an item. @@ -2002,9 +1850,7 @@ public function expire($key, $ttl) * $redisCluster->pttl('x'); // 11500 * */ - public function pExpire($key, $ttl) - { - } + public function pExpire($key, $ttl) {} /** * Sets an expiration date (a timestamp) on an item. @@ -2023,9 +1869,7 @@ public function pExpire($key, $ttl) * $redisCluster->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expireAt($key, $timestamp) - { - } + public function expireAt($key, $timestamp) {} /** * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds @@ -2043,9 +1887,7 @@ public function expireAt($key, $timestamp) * $redisCluster->pttl('x'); // 218270120575 * */ - public function pExpireAt($key, $timestamp) - { - } + public function pExpireAt($key, $timestamp) {} /** * Append specified string to the string stored in specified key. @@ -2062,9 +1904,7 @@ public function pExpireAt($key, $timestamp) * $redisCluster->get('key'); // 'value1value2' * */ - public function append($key, $value) - { - } + public function append($key, $value) {} /** * Return a single bit out of a larger string @@ -2081,9 +1921,7 @@ public function append($key, $value) * $redisCluster->getBit('key', 1); // 1 * */ - public function getBit($key, $offset) - { - } + public function getBit($key, $offset) {} /** * Changes a single bit of a string. @@ -2102,9 +1940,7 @@ public function getBit($key, $offset) * $redisCluster->get('key'); // chr(0x2f) = "/" = b("0010 1111") * */ - public function setBit($key, $offset, $value) - { - } + public function setBit($key, $offset, $value) {} /** * Bitwise operation on multiple keys. @@ -2128,9 +1964,7 @@ public function setBit($key, $offset, $value) * $redisCluster->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11 * */ - public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) - { - } + public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) {} /** * Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the @@ -2164,9 +1998,7 @@ public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) * $redisCluster->bitpos('key', 0, 1, 5); // int(-1) * */ - public function bitpos($key, $bit, $start = 0, $end = null) - { - } + public function bitpos($key, $bit, $start = 0, $end = null) {} /** * Count bits in a string. @@ -2184,9 +2016,7 @@ public function bitpos($key, $bit, $start = 0, $end = null) * var_dump( $redisCluster->bitCount('bit', 0, 2) ); // int(11) * */ - public function bitCount($key) - { - } + public function bitCount($key) {} /** * @see lIndex() @@ -2196,9 +2026,7 @@ public function bitCount($key) * * @link https://redis.io/commands/lindex */ - public function lGet($key, $index) - { - } + public function lGet($key, $index) {} /** * Return a substring of a larger string @@ -2216,9 +2044,7 @@ public function lGet($key, $index) * $redisCluster->getRange('key', -5, -1); // 'value' * */ - public function getRange($key, $start, $end) - { - } + public function getRange($key, $start, $end) {} /** * Trims an existing list so that it will contain only a specified range of elements. @@ -2239,9 +2065,7 @@ public function getRange($key, $start, $end) * $redisCluster->lRange('key1', 0, -1); // array('A', 'B') * */ - public function lTrim($key, $start, $stop) - { - } + public function lTrim($key, $start, $stop) {} /** * Returns the specified elements of the list stored at the specified key in @@ -2262,9 +2086,7 @@ public function lTrim($key, $start, $stop) * $redisCluster->lRange('key1', 0, -1); // array('A', 'B', 'C') * */ - public function lRange($key, $start, $end) - { - } + public function lRange($key, $start, $end) {} /** * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. @@ -2284,9 +2106,7 @@ public function lRange($key, $start, $end) * $redisCluster->zRange('key', 0, -1, true); // array('three' => 3) * */ - public function zRemRangeByRank($key, $start, $end) - { - } + public function zRemRangeByRank($key, $start, $end) {} /** * Publish messages to channels. Warning: this function will probably change in the future. @@ -2298,9 +2118,7 @@ public function zRemRangeByRank($key, $start, $end) * @return int Number of clients that received the message * @example $redisCluster->publish('chan-1', 'hello, world!'); // send message. */ - public function publish($channel, $message) - { - } + public function publish($channel, $message) {} /** * Renames a key. @@ -2318,9 +2136,7 @@ public function publish($channel, $message) * $redisCluster->get('x'); // → `FALSE` * */ - public function rename($srcKey, $dstKey) - { - } + public function rename($srcKey, $dstKey) {} /** * Renames a key. @@ -2341,9 +2157,7 @@ public function rename($srcKey, $dstKey) * $redisCluster->get('x'); // → `FALSE` * */ - public function renameNx($srcKey, $dstKey) - { - } + public function renameNx($srcKey, $dstKey) {} /** * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data @@ -2361,9 +2175,7 @@ public function renameNx($srcKey, $dstKey) * $redisCluster->pfCount(array('key1', 'key2')); // int(3) * */ - public function pfCount($key) - { - } + public function pfCount($key) {} /** * Adds all the element arguments to the HyperLogLog data structure stored at the key. @@ -2375,9 +2187,7 @@ public function pfCount($key) * @link https://redis.io/commands/pfadd * @example $redisCluster->pfAdd('key', array('elem1', 'elem2')) */ - public function pfAdd($key, array $elements) - { - } + public function pfAdd($key, array $elements) {} /** * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality @@ -2396,9 +2206,7 @@ public function pfAdd($key, array $elements) * $redisCluster->pfCount('key3'); // int(3) * */ - public function pfMerge($destKey, array $sourceKeys) - { - } + public function pfMerge($destKey, array $sourceKeys) {} /** * Changes a substring of a larger string. @@ -2416,9 +2224,7 @@ public function pfMerge($destKey, array $sourceKeys) * $redisCluster->get('key'); // "Hello redis" * */ - public function setRange($key, $offset, $value) - { - } + public function setRange($key, $offset, $value) {} /** * Restore a key from the result of a DUMP operation. @@ -2436,9 +2242,7 @@ public function setRange($key, $offset, $value) * $redisCluster->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo' * */ - public function restore($key, $ttl, $value) - { - } + public function restore($key, $ttl, $value) {} /** * Moves the specified member from the set at srcKey to the set at dstKey. @@ -2461,9 +2265,7 @@ public function restore($key, $ttl, $value) * // 'key2' => {'set21', 'set22', 'set13'} * */ - public function sMove($srcKey, $dstKey, $member) - { - } + public function sMove($srcKey, $dstKey, $member) {} /** * Returns a range of elements from the ordered set stored at the specified key, @@ -2490,9 +2292,7 @@ public function sMove($srcKey, $dstKey, $member) * $redisCluster->zRange('key1', 0, -1, true); // array('val0' => 0, 'val2' => 2, 'val10' => 10) * */ - public function zRange($key, $start, $end, $withscores = null) - { - } + public function zRange($key, $start, $end, $withscores = null) {} /** * Returns the elements of the sorted set stored at the specified key in the range [start, end] @@ -2520,9 +2320,7 @@ public function zRange($key, $start, $end, $withscores = null) * $redisCluster->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0) * */ - public function zRevRange($key, $start, $end, $withscore = null) - { - } + public function zRevRange($key, $start, $end, $withscore = null) {} /** * Returns the elements of the sorted set stored at the specified key which have scores in the @@ -2557,9 +2355,7 @@ public function zRevRange($key, $start, $end, $withscore = null) * // array('val2'=> 2) * */ - public function zRangeByScore($key, $start, $end, array $options = []) - { - } + public function zRangeByScore($key, $start, $end, array $options = []) {} /** * @see zRangeByScore() @@ -2571,9 +2367,7 @@ public function zRangeByScore($key, $start, $end, array $options = []) * * @return array */ - public function zRevRangeByScore($key, $start, $end, array $options = []) - { - } + public function zRevRangeByScore($key, $start, $end, array $options = []) {} /** * Returns a range of members in a sorted set, by lexicographical range @@ -2597,9 +2391,7 @@ public function zRevRangeByScore($key, $start, $end, array $options = []) * $redisCluster->zRevRangeByLex('key', '(c','-'); // array('b', 'a') * */ - public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) - { - } + public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) {} /** * @see zRangeByLex() @@ -2613,9 +2405,7 @@ public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) * @return array * @link https://redis.io/commands/zrevrangebylex */ - public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) - { - } + public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) {} /** * Count the number of members in a sorted set between a given lexicographical range. @@ -2634,9 +2424,7 @@ public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) * $redisCluster->zLexCount('key', '[b', '[f'); // 5 * */ - public function zLexCount($key, $min, $max) - { - } + public function zLexCount($key, $min, $max) {} /** * Remove all members in a sorted set between the given lexicographical range. @@ -2656,9 +2444,7 @@ public function zLexCount($key, $min, $max) * $redisCluster->zRange('key',0,-1);// array('a','b','e','f','g') * */ - public function zRemRangeByLex(string $key, string $min, string $max) - { - } + public function zRemRangeByLex(string $key, string $min, string $max) {} /** * Add multiple sorted sets and store the resulting sorted set in a new key @@ -2693,9 +2479,7 @@ public function zRemRangeByLex(string $key, string $min, string $max) * $redisCluster->zUnionStore('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3','val1') * */ - public function zUnionStore($Output, $ZSetKeys, ?array $Weights = null, $aggregateFunction = 'SUM') - { - } + public function zUnionStore($Output, $ZSetKeys, ?array $Weights = null, $aggregateFunction = 'SUM') {} /** * Intersect multiple sorted sets and store the resulting sorted set in a new key @@ -2734,9 +2518,7 @@ public function zUnionStore($Output, $ZSetKeys, ?array $Weights = null, $aggrega * $redisCluster->zInterStore('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1') * */ - public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') - { - } + public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} /** * Deletes a specified member from the ordered set. @@ -2761,9 +2543,7 @@ public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregat * // } * */ - public function zRem($key, $member1, $member2 = null, $memberN = null) - { - } + public function zRem($key, $member1, $member2 = null, $memberN = null) {} /** * Sort @@ -2794,9 +2574,7 @@ public function zRem($key, $member1, $member2 = null, $memberN = null) * var_dump($redisCluster->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5 * */ - public function sort($key, $option = null) - { - } + public function sort($key, $option = null) {} /** * Describes the object pointed to by a key. @@ -2818,9 +2596,7 @@ public function sort($key, $option = null) * $redisCluster->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds). * */ - public function object($string = '', $key = '') - { - } + public function object($string = '', $key = '') {} /** * Subscribe to channels. Warning: this function will probably change in the future. @@ -2853,9 +2629,7 @@ public function object($string = '', $key = '') * $redisCluster->subscribe(array('chan-1', 'chan-2', 'chan-3'), 'f'); // subscribe to 3 chans * */ - public function subscribe($channels, $callback) - { - } + public function subscribe($channels, $callback) {} /** * Subscribe to channels by pattern @@ -2876,9 +2650,7 @@ public function subscribe($channels, $callback) * } * */ - public function psubscribe($patterns, $callback) - { - } + public function psubscribe($patterns, $callback) {} /** * Unsubscribes the client from the given channels, or from all of them if none is given. @@ -2886,9 +2658,7 @@ public function psubscribe($patterns, $callback) * @param $channels * @param $callback */ - public function unSubscribe($channels, $callback) - { - } + public function unSubscribe($channels, $callback) {} /** * Unsubscribes the client from the given patterns, or from all of them if none is given. @@ -2896,9 +2666,7 @@ public function unSubscribe($channels, $callback) * @param $channels * @param $callback */ - public function punSubscribe($channels, $callback) - { - } + public function punSubscribe($channels, $callback) {} /** * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. @@ -2919,9 +2687,7 @@ public function punSubscribe($channels, $callback) * $redisCluster->evalSha($sha); // Returns 1 * */ - public function evalSha($scriptSha, $args = [], $numKeys = 0) - { - } + public function evalSha($scriptSha, $args = [], $numKeys = 0) {} /** * Scan the keyspace for keys. @@ -2943,9 +2709,7 @@ public function evalSha($scriptSha, $args = [], $numKeys = 0) * } * */ - public function scan(&$iterator, $node, $pattern = null, $count = 0) - { - } + public function scan(&$iterator, $node, $pattern = null, $count = 0) {} /** * Scan a set for members. @@ -2967,9 +2731,7 @@ public function scan(&$iterator, $node, $pattern = null, $count = 0) * } * */ - public function sScan($key, &$iterator, $pattern = null, $count = 0) - { - } + public function sScan($key, &$iterator, $pattern = null, $count = 0) {} /** * Scan a sorted set for members, with optional pattern and count. @@ -2991,9 +2753,7 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) * } * */ - public function zScan($key, &$iterator, $pattern = null, $count = 0) - { - } + public function zScan($key, &$iterator, $pattern = null, $count = 0) {} /** * Scan a HASH value for members, with an optional pattern and count. @@ -3015,9 +2775,7 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) * } * */ - public function hScan($key, &$iterator, $pattern = null, $count = 0) - { - } + public function hScan($key, &$iterator, $pattern = null, $count = 0) {} /** * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. @@ -3025,9 +2783,7 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) * @return int Either RedisCluster::ATOMIC, RedisCluster::MULTI or RedisCluster::PIPELINE * @example $redisCluster->getMode(); */ - public function getMode() - { - } + public function getMode() {} /** * The last error message (if any) @@ -3040,9 +2796,7 @@ public function getMode() * // "ERR Error compiling script (new function): user_script:1: '=' expected near '-'" * */ - public function getLastError() - { - } + public function getLastError() {} /** * Clear the last error message @@ -3059,9 +2813,7 @@ public function getLastError() * // NULL * */ - public function clearLastError() - { - } + public function clearLastError() {} /** * Get client option @@ -3073,9 +2825,7 @@ public function clearLastError() * // return RedisCluster::SERIALIZER_NONE, RedisCluster::SERIALIZER_PHP, or RedisCluster::SERIALIZER_IGBINARY. * $redisCluster->getOption(RedisCluster::OPT_SERIALIZER); */ - public function getOption($option) - { - } + public function getOption($option) {} /** * Set client option. @@ -3092,9 +2842,7 @@ public function getOption($option) * $redisCluster->setOption(RedisCluster::OPT_PREFIX, 'myAppName:'); // use custom prefix on all keys * */ - public function setOption($option, $value) - { - } + public function setOption($option, $value) {} /** * A utility method to prefix the value with the prefix setting for phpredis. @@ -3108,9 +2856,7 @@ public function setOption($option, $value) * $redisCluster->_prefix('my-value'); // Will return 'my-prefix:my-value' * */ - public function _prefix($value) - { - } + public function _prefix($value) {} /** * A utility method to serialize values manually. This method allows you to serialize a value with whatever @@ -3132,9 +2878,7 @@ public function _prefix($value) * $redisCluster->_serialize("foo"); // Returns 's:3:"foo";' * */ - public function _serialize($value) - { - } + public function _serialize($value) {} /** * A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the @@ -3151,9 +2895,7 @@ public function _serialize($value) * $redisCluster->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3) * */ - public function _unserialize($value) - { - } + public function _unserialize($value) {} /** * Return all redis master nodes @@ -3164,9 +2906,7 @@ public function _unserialize($value) * $redisCluster->_masters(); // Will return [[0=>'127.0.0.1','6379'],[0=>'127.0.0.1','6380']] * */ - public function _masters() - { - } + public function _masters() {} /** * Enter and exit transactional mode. @@ -3196,26 +2936,20 @@ public function _masters() * // 3 => 'val2'); * */ - public function multi($mode = RedisCluster::MULTI) - { - } + public function multi($mode = RedisCluster::MULTI) {} /** * @see multi() * @return void|array * @link https://redis.io/commands/exec */ - public function exec() - { - } + public function exec() {} /** * @see multi() * @link https://redis.io/commands/discard */ - public function discard() - { - } + public function discard() {} /** * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, @@ -3235,17 +2969,13 @@ public function discard() * // $ret = FALSE if x has been modified between the call to WATCH and the call to EXEC. * */ - public function watch($key) - { - } + public function watch($key) {} /** * @see watch() * @link https://redis.io/commands/unwatch */ - public function unwatch() - { - } + public function unwatch() {} /** * Performs a synchronous save at a specific node. @@ -3259,9 +2989,7 @@ public function unwatch() * $redisCluster->save('x'); //key * $redisCluster->save(['127.0.0.1',6379]); //[host,port] */ - public function save($nodeParams) - { - } + public function save($nodeParams) {} /** * Performs a background save at a specific node. @@ -3272,9 +3000,7 @@ public function save($nodeParams) * If a save is already running, this command will fail and return FALSE. * @link https://redis.io/commands/bgsave */ - public function bgsave($nodeParams) - { - } + public function bgsave($nodeParams) {} /** * Removes all entries from the current database at a specific node. @@ -3284,9 +3010,7 @@ public function bgsave($nodeParams) * @return bool Always TRUE. * @link https://redis.io/commands/flushdb */ - public function flushDB($nodeParams) - { - } + public function flushDB($nodeParams) {} /** * Removes all entries from all databases at a specific node. @@ -3296,9 +3020,7 @@ public function flushDB($nodeParams) * @return bool Always TRUE. * @link https://redis.io/commands/flushall */ - public function flushAll($nodeParams) - { - } + public function flushAll($nodeParams) {} /** * Returns the current database's size at a specific node. @@ -3313,9 +3035,7 @@ public function flushAll($nodeParams) * echo "Redis has $count keys\n"; * */ - public function dbSize($nodeParams) - { - } + public function dbSize($nodeParams) {} /** * Starts the background rewrite of AOF (Append-Only File) at a specific node. @@ -3326,9 +3046,7 @@ public function dbSize($nodeParams) * @link https://redis.io/commands/bgrewriteaof * @example $redisCluster->bgrewriteaof('x'); */ - public function bgrewriteaof($nodeParams) - { - } + public function bgrewriteaof($nodeParams) {} /** * Returns the timestamp of the last disk save at a specific node. @@ -3339,9 +3057,7 @@ public function bgrewriteaof($nodeParams) * @link https://redis.io/commands/lastsave * @example $redisCluster->lastSave('x'); */ - public function lastSave($nodeParams) - { - } + public function lastSave($nodeParams) {} /** * Returns an associative array of strings and integers @@ -3494,9 +3210,7 @@ public function lastSave($nodeParams) * $redisCluster->info("CPU"); // just CPU information from Redis INFO * */ - public function info($option = null) - { - } + public function info($option = null) {} /** * @since redis >= 2.8.12. @@ -3512,9 +3226,7 @@ public function info($option = null) * // [ 0=>'master',1 => 3129659, 2 => [ ['127.0.0.1','9001','3129242'], ['127.0.0.1','9002','3129543'] ] ] * */ - public function role($nodeParams) - { - } + public function role($nodeParams) {} /** * Returns a random key at the specified node @@ -3529,9 +3241,7 @@ public function role($nodeParams) * $surprise = $redisCluster->get($key); // who knows what's in there. * */ - public function randomKey($nodeParams) - { - } + public function randomKey($nodeParams) {} /** * Return the specified node server time. @@ -3552,9 +3262,7 @@ public function randomKey($nodeParams) * // } * */ - public function time($nodeParams) - { - } + public function time($nodeParams) {} /** * Check the specified node status @@ -3565,9 +3273,7 @@ public function time($nodeParams) * above. * @link https://redis.io/commands/ping */ - public function ping($nodeParams) - { - } + public function ping($nodeParams) {} /** * Returns message. @@ -3577,18 +3283,14 @@ public function ping($nodeParams) * * @return mixed */ - public function echo($nodeParams, $msg) - { - } + public function echo($nodeParams, $msg) {} /** * Returns Array reply of details about all Redis Cluster commands. * * @return mixed array | bool */ - public function command() - { - } + public function command() {} /** * Send arbitrary things to the redis server at the specified node @@ -3599,9 +3301,7 @@ public function command() * * @return mixed */ - public function rawCommand($nodeParams, $command, $arguments) - { - } + public function rawCommand($nodeParams, $command, $arguments) {} /** * @since redis >= 3.0 @@ -3618,9 +3318,7 @@ public function rawCommand($nodeParams, $command, $arguments) * $redisCluster->cluster(['127.0.0.1',6379],'INFO'); * */ - public function cluster($nodeParams, $command, $arguments) - { - } + public function cluster($nodeParams, $command, $arguments) {} /** * Allows you to get information of the cluster client @@ -3629,9 +3327,7 @@ public function cluster($nodeParams, $command, $arguments) * @param string $subCmd can be: 'LIST', 'KILL', 'GETNAME', or 'SETNAME' * @param string $args optional arguments */ - public function client($nodeParams, $subCmd, $args) - { - } + public function client($nodeParams, $subCmd, $args) {} /** * Get or Set the redis config keys. @@ -3650,9 +3346,7 @@ public function client($nodeParams, $subCmd, $args) * $redisCluster->config(['127.0.0.1',6379], "SET", "dir", "/var/run/redis/dumps/"); * */ - public function config($nodeParams, $operation, $key, $value) - { - } + public function config($nodeParams, $operation, $key, $value) {} /** * A command allowing you to get information on the Redis pub/sub system. @@ -3679,9 +3373,7 @@ public function config($nodeParams, $operation, $key, $value) * $redisCluster->pubsub(['127.0.0.1',6379], 'numpat'); // Get the number of pattern subscribers * */ - public function pubsub($nodeParams, $keyword, $argument) - { - } + public function pubsub($nodeParams, $keyword, $argument) {} /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. @@ -3708,9 +3400,7 @@ public function pubsub($nodeParams, $keyword, $argument) * SCRIPT KILL will return true if a script was able to be killed and false if not * SCRIPT EXISTS will return an array with TRUE or FALSE for each passed script */ - public function script($nodeParams, $command, $script) - { - } + public function script($nodeParams, $command, $script) {} /** * This function is used in order to read and reset the Redis slow queries log. @@ -3725,9 +3415,7 @@ public function script($nodeParams, $command, $script) * $redisCluster->slowLog(['127.0.0.1',6379],'get','2'); * */ - public function slowLog($nodeParams, $command, $argument) - { - } + public function slowLog($nodeParams, $command, $argument) {} /** * Add one or more geospatial items in the geospatial index represented using a sorted set @@ -3744,9 +3432,7 @@ public function slowLog($nodeParams, $command, $argument) * $redisCluster->geoAdd('Sicily', 15.087269, 37.502669, "Catania"); // int(1) * */ - public function geoAdd($key, $longitude, $latitude, $member) - { - } + public function geoAdd($key, $longitude, $latitude, $member) {} /** * Returns members of a geospatial index as standard geohash strings @@ -3763,9 +3449,7 @@ public function geoAdd($key, $longitude, $latitude, $member) * $redisCluster->geohash('Sicily','Palermo','Catania');//['sqc8b49rny0','sqdtr74hyu0'] * */ - public function geohash($key, $member1, $member2 = null, $memberN = null) - { - } + public function geohash($key, $member1, $member2 = null, $memberN = null) {} /** * Returns longitude and latitude of members of a geospatial index @@ -3780,9 +3464,7 @@ public function geohash($key, $member1, $member2 = null, $memberN = null) * $redisCluster->geopos('Sicily','Palermo');//[['13.36138933897018433','38.11555639549629859']] * */ - public function geopos($key, $member1, $member2 = null, $memberN = null) - { - } + public function geopos($key, $member1, $member2 = null, $memberN = null) {} /** * Returns the distance between two members of a geospatial index @@ -3805,9 +3487,7 @@ public function geopos($key, $member1, $member2 = null, $memberN = null) * $redisCluster->geoDist('Sicily', 'Palermo','Catania', 'km'); // float(166.2742) * */ - public function geoDist($key, $member1, $member2, $unit = 'm') - { - } + public function geoDist($key, $member1, $member2, $unit = 'm') {} /** * Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point @@ -3873,9 +3553,7 @@ public function geoDist($key, $member1, $member2, $unit = 'm') * *
      */
-    public function geoRadius($key, $longitude, $latitude, $radius, $radiusUnit, array $options)
-    {
-    }
+    public function geoRadius($key, $longitude, $latitude, $radius, $radiusUnit, array $options) {}
 
     /**
      * Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member
@@ -3888,9 +3566,7 @@ public function geoRadius($key, $longitude, $latitude, $radius, $radiusUnit, arr
      * @param string $radiusUnit
      * @param array  $options
      */
-    public function geoRadiusByMember($key, $member, $radius, $radiusUnit, array $options)
-    {
-    }
+    public function geoRadiusByMember($key, $member, $radius, $radiusUnit, array $options) {}
 }
 
 class RedisClusterException extends Exception

From fdb2c532b5deae288363c4a91d55ae9a28158f5f Mon Sep 17 00:00:00 2001
From: DmitryTronin 
Date: Wed, 12 Oct 2022 17:42:00 +0200
Subject: [PATCH 199/419] more php cs fixer fixes fixed regexp for
 checkHtmlTags test to include union types

---
 redis/Redis.php           | 37 +++++++++++++++----------------------
 redis/RedisCluster.php    |  4 +---
 tests/StubsPhpDocTest.php |  2 +-
 3 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/redis/Redis.php b/redis/Redis.php
index e15e7077c..caabec813 100644
--- a/redis/Redis.php
+++ b/redis/Redis.php
@@ -167,8 +167,7 @@ public function connect(
         $retry_interval = 0,
         $read_timeout = 0,
         $context = null
-    ) {
-    }
+    ) {}
 
     /**
      * Connects to a Redis instance.
@@ -194,8 +193,7 @@ public function open(
         $retry_interval = 0,
         $read_timeout = 0,
         $context = null
-    ) {
-    }
+    ) {}
 
     /**
      * A method to determine if a phpredis object thinks it's connected to a server
@@ -326,8 +324,7 @@ public function pconnect(
         $retry_interval = 0,
         $read_timeout = 0,
         $context = null
-    ) {
-    }
+    ) {}
 
     /**
      * @param string $host
@@ -351,8 +348,7 @@ public function popen(
         $retry_interval = 0,
         $read_timeout = 0,
         $context = null
-    ) {
-    }
+    ) {}
 
     /**
      * Disconnects from the Redis instance.
@@ -586,7 +582,7 @@ public function psetex($key, $expire, string $value) {}
      * $redis->setnx('key', 'value');   // return FALSE
      * 
*/ - public function setnx(string $key, string $value) {} + public function setnx(string $key, string $value) {} /** * Remove specified keys. @@ -1956,7 +1952,7 @@ public function sDiffStore($dstKey, $key1, ...$otherKeys) {} */ public function sMembers($key) {} - public function sMisMember(string $key, string $member, string ...$other_members): array|false{} + public function sMisMember(string $key, string $member, string ...$other_members): array|false {} /** * @link https://redis.io/commands/smembers @@ -2653,7 +2649,7 @@ public function bitCount($key, $start = 0, $end = -1) {} * @param string $key1 first key * @param string ...$otherKeys variadic list of keys * - * @return False|int|Redis The size of the string stored in the destination key or Redis if in multimode + * @return false|int|Redis The size of the string stored in the destination key or Redis if in multimode * * @throws RedisException * @@ -3254,13 +3250,13 @@ public function zRevRangeByScore(string $key, string $start, string $end, array */ public function zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) {} - public function zMscore(string $key, string $member, string ...$other_members): array|false{} + public function zMscore(string $key, string $member, string ...$other_members): array|false {} - public function zPopMax(string $key, int $value = null): array|false{} + public function zPopMax(string $key, int $value = null): array|false {} - public function zPopMin(string $key, int $value = null): array|false{} + public function zPopMin(string $key, int $value = null): array|false {} - public function zRandMember(string $key, array $options = null): string|array|false{} + public function zRandMember(string $key, array $options = null): string|array|false {} /** * @param string $key @@ -3291,7 +3287,6 @@ public function zRevRangeByLex(string $key, string $min, string $max, int $offse */ public function zRemRangeByLex(string $key, string $min, string $max) {} - /** * Returns the number of elements of the sorted set stored at the specified key which have * scores in the range [start,end]. Adding a parenthesis before start or end excludes it @@ -3403,7 +3398,7 @@ public function zDeleteRangeByRank($key, $start, $end) {} */ public function zCard($key) {} - public function zdiff(array $keys, array $options = null): array|false{} + public function zdiff(array $keys, array $options = null): array|false {} /** * @param string $key @@ -4192,9 +4187,9 @@ public function geoHash($key, ...$member) {} */ public function geoPos(string $key, string ...$member) {} - public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false{} + public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false {} - public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false{} + public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false {} /** * Return the distance between two members in a geospatial set. @@ -5149,6 +5144,4 @@ public function xTrim($stream, $maxLen, $isApproximate) {} public function sAddArray($key, array $values) {} } -class RedisException extends Exception -{ -} +class RedisException extends Exception {} diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index 3e919dcb2..6ba8a6a7f 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -3569,6 +3569,4 @@ public function geoRadius($key, $longitude, $latitude, $radius, $radiusUnit, arr public function geoRadiusByMember($key, $member, $radius, $radiusUnit, array $options) {} } -class RedisClusterException extends Exception -{ -} +class RedisClusterException extends Exception {} diff --git a/tests/StubsPhpDocTest.php b/tests/StubsPhpDocTest.php index 3df55b8bf..ddbda74db 100644 --- a/tests/StubsPhpDocTest.php +++ b/tests/StubsPhpDocTest.php @@ -133,7 +133,7 @@ private static function checkHtmlTags(BasePHPElement $element, string $elementNa '#
.*
#sU', '#.*#sU', '#@author.*<.*>#U', - '#(\s[\w]+[-][\w]+<[a-zA-Z,\s]+>[\s|]+)|([\w]+<[a-zA-Z,\s]+>[\s|\W]+)#' + '#(\s[\w]+[-][\w]+<[a-zA-Z,\s]+>[\s|]+)|([\w]+<[a-zA-Z,|\s]+>[\s|\W]+)#' ], '', $phpdoc From e73dd985c27061300255675766c15216485607fc Mon Sep 17 00:00:00 2001 From: DmitryTronin Date: Wed, 12 Oct 2022 18:36:37 +0200 Subject: [PATCH 200/419] adding 'implements' to the checkContainsOnlyValidTags --- tests/StubsPhpDocTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/StubsPhpDocTest.php b/tests/StubsPhpDocTest.php index ddbda74db..996bad4da 100644 --- a/tests/StubsPhpDocTest.php +++ b/tests/StubsPhpDocTest.php @@ -190,6 +190,7 @@ private static function checkContainsOnlyValidTags(BasePHPElement $element, stri 'inheritdoc', 'inheritDoc', 'internal', + 'implements', 'link', 'meta', 'method', From 59d0a0c894392349ea5fa18e503282d9640496e7 Mon Sep 17 00:00:00 2001 From: Anatoly Pashin Date: Wed, 10 Aug 2022 19:37:22 +1000 Subject: [PATCH 201/419] Make DatePeriod generic Iterated type is DateTime or DateTimeImmutable depending on $start constructor argument type. --- date/date_c.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/date/date_c.php b/date/date_c.php index 627d5e490..d9dff0f43 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -946,6 +946,9 @@ public function __unserialize(array $data): void {} /** * Representation of date period. * @link https://php.net/manual/en/class.dateperiod.php + * @template TDate of DateTimeInterface + * @template TEnd of ?DateTimeInterface + * @implements \IteratorAggregate */ class DatePeriod implements IteratorAggregate { @@ -1010,16 +1013,16 @@ class DatePeriod implements IteratorAggregate public bool $include_end_date; /** - * @param DateTimeInterface $start + * @param TDate $start * @param DateInterval $interval - * @param DateTimeInterface $end + * @param TEnd $end * @param int $options Can be set to DatePeriod::EXCLUDE_START_DATE. * @link https://php.net/manual/en/dateperiod.construct.php */ public function __construct(DateTimeInterface $start, DateInterval $interval, DateTimeInterface $end, $options = 0) {} /** - * @param DateTimeInterface $start + * @param TDate $start * @param DateInterval $interval * @param int $recurrences Number of recurrences * @param int $options Can be set to DatePeriod::EXCLUDE_START_DATE. @@ -1048,6 +1051,7 @@ public function getDateInterval(): DateInterval {} * @return DateTimeInterface|null * @link https://php.net/manual/en/dateperiod.getenddate.php * @since 5.6.5 + * @return TEnd */ #[TentativeType] public function getEndDate(): ?DateTimeInterface {} @@ -1057,6 +1061,7 @@ public function getEndDate(): ?DateTimeInterface {} * @return DateTimeInterface * @link https://php.net/manual/en/dateperiod.getstartdate.php * @since 5.6.5 + * @return TDate */ #[TentativeType] public function getStartDate(): DateTimeInterface {} @@ -1077,7 +1082,7 @@ public function __wakeup(): void {} public function getRecurrences(): ?int {} /** - * @return Iterator + * @return \Iterator * @since 8.0 */ public function getIterator(): Iterator {} From 878dd7f909c2b3c1d8db908d6925c9b4e0aaa003 Mon Sep 17 00:00:00 2001 From: Maksym Storchak Date: Thu, 13 Oct 2022 23:24:38 +0300 Subject: [PATCH 202/419] fixed return type RdKafka\ConsumerTopic::consume() rd-kafka library implements RdKafka\ConsumerTopic::consume() method as do consume till Kafka service return value is not empty. Need to update return type. --- rdkafka/RdKafka/ConsumerTopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdkafka/RdKafka/ConsumerTopic.php b/rdkafka/RdKafka/ConsumerTopic.php index fd9f71c10..97de72c77 100755 --- a/rdkafka/RdKafka/ConsumerTopic.php +++ b/rdkafka/RdKafka/ConsumerTopic.php @@ -10,7 +10,7 @@ private function __construct() {} * @param int $partition * @param int $timeout_ms * - * @return Message + * @return Message|null */ public function consume($partition, $timeout_ms) {} From 03b75cef27bf48a3b1414cc81ef82ea8b6fa2f87 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 6 Oct 2022 18:46:19 +0200 Subject: [PATCH 203/419] Add ArrayShape attributes for functions --- PDO/PDO.php | 1 + Zend OPcache/OPcache.php | 16 ++++++++ bz2/bz2.php | 2 + calendar/calendar.php | 13 +++++++ curl/curl.php | 1 + date/date.php | 81 ++++++++++++++++++++++++++++++++++++++++ date/date_c.php | 6 +++ gd/gd.php | 18 +++++++++ gmp/gmp.php | 2 + iconv/iconv.php | 2 + imap/imap.php | 2 + ldap/ldap.php | 2 + mbstring/mbstring.php | 16 ++++++++ mysqli/mysqli.php | 7 ++++ oci8/oci8.php | 2 + odbc/odbc.php | 2 + openssl/openssl.php | 30 +++++++++++++++ pgsql/pgsql.php | 3 ++ posix/posix.php | 34 +++++++++++++++++ readline/readline.php | 17 +++++++++ sockets/sockets.php | 9 +++++ standard/standard_0.php | 12 ++++++ standard/standard_1.php | 1 + standard/standard_4.php | 2 + standard/standard_6.php | 1 + standard/standard_8.php | 12 ++++++ sysvmsg/sysvmsg.php | 13 +++++++ 27 files changed, 307 insertions(+) diff --git a/PDO/PDO.php b/PDO/PDO.php index 3a1f5d8c5..42bbf1753 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1851,6 +1851,7 @@ public function columnCount(): int {} * or if no result set exists. */ #[TentativeType] + #[ArrayShape(["name" => "string", "len" => "int", "precision" => "int", "native_type" => "string", "flags" => "array", "pdo_type" => "int"])] public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): array|false {} /** diff --git a/Zend OPcache/OPcache.php b/Zend OPcache/OPcache.php index 2fb7efff3..c2f9a97d1 100644 --- a/Zend OPcache/OPcache.php +++ b/Zend OPcache/OPcache.php @@ -1,5 +1,7 @@ * Compiles and caches a PHP script without executing it @@ -44,6 +46,19 @@ function opcache_reset(): bool {} * @return array|false

Returns an array of information, optionally containing script specific state information

* @since 5.5 */ +#[ArrayShape([ + 'opcache_enabled' => 'bool', + 'file_cache' => 'string', + 'file_cache_only' => 'bool', + 'cache_full' => 'bool', + 'restart_pending' => 'bool', + 'restart_in_progress' => 'bool', + 'memory_usage' => 'array', + 'interned_strings_usage' => 'array', + 'opcache_statistics' => 'array', + 'preload_statistics' => 'array', + 'scripts' => 'array', +])] function opcache_get_status(bool $include_scripts = true): array|false {} /** @@ -53,6 +68,7 @@ function opcache_get_status(bool $include_scripts = true): array|false {} * @return array|false

Returns an array of information, including ini, blacklist and version

* @since 5.5 */ +#[ArrayShape(["directives" => "array", "version" => "string[]", "blacklist" => "array"])] function opcache_get_configuration(): array|false {} /** diff --git a/bz2/bz2.php b/bz2/bz2.php index f469d9a26..a19ffc429 100644 --- a/bz2/bz2.php +++ b/bz2/bz2.php @@ -1,5 +1,6 @@ 'array', '8.0' => 'array|false'], default: 'array')] +#[ArrayShape(["errno" => "int", "errstr" => "string"])] function bzerror($bz) {} /** diff --git a/calendar/calendar.php b/calendar/calendar.php index e22256b62..3aef6c220 100644 --- a/calendar/calendar.php +++ b/calendar/calendar.php @@ -1,6 +1,7 @@ "string", + "month" => "int", + "day" => "int", + "year" => "int", + "dow" => "int", + "abbrevdayname" => "string", + "dayname" => "string", + "abbrevmonth" => "string", + "monthname" => "string" +])] function cal_from_jd(int $julian_day, int $calendar): array {} /** @@ -274,6 +286,7 @@ function cal_days_in_month(int $calendar, int $month, int $year): int {} *

* @return array */ +#[ArrayShape(["months" => "array", "abbrevmonths" => "array", "maxdaysinmonth" => "int", "calname" => "string", "calsymbol" => "string"])] function cal_info(int $calendar = -1): array {} define('CAL_GREGORIAN', 0); diff --git a/curl/curl.php b/curl/curl.php index a07f73b73..92ce0b7e8 100644 --- a/curl/curl.php +++ b/curl/curl.php @@ -2757,6 +2757,7 @@ function curl_multi_getcontent(#[LanguageLevelTypeAware(['8.0' => 'CurlHandle'], * @return array|false On success, returns an associative array for the message, false on failure. */ #[Pure] +#[ArrayShape(["msg" => "string", "result" => "string", "handle" => "resource"])] function curl_multi_info_read(#[LanguageLevelTypeAware(['8.0' => 'CurlMultiHandle'], default: 'resource')] $multi_handle, &$queued_messages): array|false {} /** diff --git a/date/date.php b/date/date.php index b610d7665..a31adf912 100644 --- a/date/date.php +++ b/date/date.php @@ -830,6 +830,17 @@ function time(): int {} * @return array */ #[Pure(true)] +#[ArrayShape([ + 'tm_sec' => 'int', + 'tm_min' => 'int', + 'tm_hour' => 'int', + 'tm_mday' => 'int', + 'tm_mon' => 'int', + 'tm_year' => 'int', + 'tm_wday' => 'int', + 'tm_yday' => 'int', + 'tm_isdst' => 'int', +])] function localtime(?int $timestamp, bool $associative = false): array {} /** @@ -912,6 +923,19 @@ function localtime(?int $timestamp, bool $associative = false): array {} * */ #[Pure(true)] +#[ArrayShape([ + 'seconds' => 'int', + 'minutes' => 'int', + 'hours' => 'int', + 'mday' => 'int', + 'wday' => 'int', + 'mon' => 'int', + 'year' => 'int', + 'yday' => 'int', + 'weekday' => 'int', + 'month' => 'string', + 0 => 'int', +])] function getdate(?int $timestamp): array {} /** @@ -984,6 +1008,26 @@ function date_create_from_format(string $format, string $datetime, ?DateTimeZone */ #[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] +#[ArrayShape([ + "year" => "int", + "month" => "int", + "day" => "int", + "hour" => "int", + "minute" => "int", + "second" => "int", + "fraction" => "double", + "is_localtime" => "bool", + "zone_type" => "int", + "zone" => "int", + "is_dst" => "bool", + "tz_abbr" => "string", + "tz_id" => "string", + "relative" => "array", + "warning_count" => "int", + "warnings" => "array", + "error_count" => "int", + "errors" => "array" +])] function date_parse(string $datetime): false|array {} /** @@ -998,6 +1042,26 @@ function date_parse(string $datetime): false|array {} * @return array associative array with detailed info about given date. */ #[Pure(true)] +#[ArrayShape([ + 'year' => 'int', + 'month' => 'int', + 'day' => 'int', + 'hour' => 'int', + 'minute' => 'int', + 'second' => 'int', + 'fraction' => 'double', + 'is_localtime' => 'bool', + 'zone_type' => 'int', + 'zone' => 'int', + 'is_dst' => 'bool', + 'tz_abbr' => 'string', + 'tz_id' => 'string', + 'relative' => 'array', + 'warning_count' => 'int', + 'warnings' => 'array', + 'error_count' => 'int', + 'errors' => 'array' +])] function date_parse_from_format(string $format, string $datetime): array {} /** @@ -1290,6 +1354,12 @@ function timezone_transitions_get(DateTimeZone $object, int $timestampBegin, int * @return array|false

Array containing location information about timezone.

*/ #[Pure(true)] +#[ArrayShape([ + 'country_code' => 'string', + 'latitude' => 'double', + 'longitude' => 'double', + 'comments' => 'string', +])] function timezone_location_get(DateTimeZone $object): array|false {} /** @@ -1518,6 +1588,17 @@ function date_sunset(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, ?f */ #[Pure(true)] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] +#[ArrayShape([ + "sunrise" => "int", + "sunset" => "int", + "transit" => "int", + "civil_twilight_begin" => "int", + "civil_twilight_end" => "int", + "nautical_twilight_begin" => "int", + "nautical_twilight_end" => "int", + "astronomical_twilight_begin" => "int", + "astronomical_twilight_end" => "int" +])] function date_sun_info(int $timestamp, float $latitude, float $longitude): array|false {} // End of date v.5.3.2-0.dotdeb.1 diff --git a/date/date_c.php b/date/date_c.php index d9dff0f43..5631170bb 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -779,6 +779,12 @@ public function getName(): string {} * @link https://php.net/manual/en/datetimezone.getlocation.php */ #[TentativeType] + #[ArrayShape([ + 'country_code' => 'string', + 'latitude' => 'double', + 'longitude' => 'double', + 'comments' => 'string', + ])] public function getLocation(): array|false {} /** diff --git a/gd/gd.php b/gd/gd.php index 23af9b2ae..27b74d859 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1,5 +1,6 @@ */ #[Pure] +#[ArrayShape([ + "GD Version" => "string", + "FreeType Support" => "bool", + "GIF Read Support" => "bool", + "GIF Create Support" => "bool", + "JPEG Support" => "bool", + "PNG Support" => "bool", + "WBMP Support" => "bool", + "XPM Support" => "bool", + "XBM Support" => "bool", + "WebP Support" => "bool", + "BMP Support" => "bool", + "TGA Read Support" => "bool", + "AVIF Support" => "bool", + "JIS-mapped Japanese Font Support" => "bool" +])] function gd_info(): array {} /** @@ -372,6 +389,7 @@ function imagecolorstotal(GdImage $image): int {} */ #[Pure] #[LanguageLevelTypeAware(['8.0' => 'array'], default: 'array|false')] +#[ArrayShape(["red" => "int", "green" => "int", "blue" => "int", "alpha" => "int"])] function imagecolorsforindex(GdImage $image, int $color) {} /** diff --git a/gmp/gmp.php b/gmp/gmp.php index 90f1057e7..712828be1 100644 --- a/gmp/gmp.php +++ b/gmp/gmp.php @@ -1,6 +1,7 @@ "int", "s" => "int", "t" => "int"])] function gmp_gcdext(GMP|string|int $num1, GMP|string|int $num2): array {} /** diff --git a/iconv/iconv.php b/iconv/iconv.php index 78c928ce9..3bdb03451 100644 --- a/iconv/iconv.php +++ b/iconv/iconv.php @@ -1,6 +1,7 @@ */ #[Pure] +#[ArrayShape(["input_encoding" => "string", "output_encoding" => "string", "internal_encoding" => "string"])] function iconv_get_encoding(string $type = "all"): array|string|false {} /** diff --git a/imap/imap.php b/imap/imap.php index 99e4e0a78..86e74f986 100644 --- a/imap/imap.php +++ b/imap/imap.php @@ -1,6 +1,7 @@ "int", "limit" => "int"])] function imap_get_quota(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $quota_root): array|false {} /** diff --git a/ldap/ldap.php b/ldap/ldap.php index fed47b9df..2fbe26406 100644 --- a/ldap/ldap.php +++ b/ldap/ldap.php @@ -1,6 +1,7 @@ "int"])] function ldap_explode_dn(string $dn, int $with_attrib): array|false {} /** diff --git a/mbstring/mbstring.php b/mbstring/mbstring.php index 349021f15..b7a755bed 100644 --- a/mbstring/mbstring.php +++ b/mbstring/mbstring.php @@ -2,6 +2,7 @@ // Start of mbstring v. +use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; @@ -907,6 +908,21 @@ function mb_send_mail(string $to, string $subject, string $message, array|string * is not specified, otherwise a specific type. */ #[Pure] +#[ArrayShape([ + 'internal_encoding' => 'string', + 'http_input' => 'string', + 'http_output' => 'string', + 'http_output_conv_mimetypes' => 'string', + 'mail_charset' => 'string', + 'mail_header_encoding' => 'string', + 'mail_body_encoding' => 'string', + 'illegal_chars' => 'string', + 'encoding_translation' => 'string', + 'language' => 'string', + 'detect_order' => 'string', + 'substitute_character' => 'string', + 'strict_detection' => 'string', +])] function mb_get_info(string $type = 'all'): array|string|int|false {} /** diff --git a/mysqli/mysqli.php b/mysqli/mysqli.php index 8bb972691..b9dec2fa1 100644 --- a/mysqli/mysqli.php +++ b/mysqli/mysqli.php @@ -4,6 +4,7 @@ * @link https://php.net/manual/en/book.mysqli.php */ +use JetBrains\PhpStorm\ArrayShape; use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; @@ -1827,6 +1828,11 @@ function mysqli_errno(mysqli $mysql): int {} * @return array A list of errors, each as an associative array containing the errno, error, and sqlstate. * @since 5.4 */ +#[ArrayShape([ + "errno" => "int", + "sqlstate" => "string", + "error" => "string", +])] function mysqli_error_list(mysqli $mysql): array {} /** @@ -2121,6 +2127,7 @@ function mysqli_get_host_info(mysqli $mysql): string {} * * @since 5.6 */ +#[ArrayShape(["total" => "int", "active_plinks" => "int", "cached_plinks" => "int"])] function mysqli_get_links_stats(): array {} /** diff --git a/oci8/oci8.php b/oci8/oci8.php index 7bddeda00..fd8c1b88f 100644 --- a/oci8/oci8.php +++ b/oci8/oci8.php @@ -1,6 +1,7 @@ * */ +#[ArrayShape(["code" => "int", "message" => "string", "offset" => "int", "sqltext" => "string"])] function oci_error($resource = null) {} /** diff --git a/odbc/odbc.php b/odbc/odbc.php index cd76ebfad..85af5b678 100644 --- a/odbc/odbc.php +++ b/odbc/odbc.php @@ -1,6 +1,7 @@ * @return array|false FALSE on error, and an array upon success. */ +#[ArrayShape(["server" => "string", "description" => "string"])] function odbc_data_source($connection_id, $fetch_type) {} /** diff --git a/openssl/openssl.php b/openssl/openssl.php index 7669ec148..a4e310e50 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -1,6 +1,7 @@ 'OpenSSLAsym * Depending on the key type used, additional details may be returned. Note that * some elements may not always be available. */ +#[ArrayShape(["bits" => "int", "key" => "string", "rsa" => "array", "dsa" => "array", "dh" => "array", "type" => "int"])] function openssl_pkey_get_details(#[LanguageLevelTypeAware(["8.0" => "OpenSSLAsymmetricKey"], default: "resource")] $key): array|false {} /** @@ -278,6 +280,24 @@ function openssl_x509_free(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificat * @return array|false The structure of the returned data is (deliberately) not * yet documented, as it is still subject to change. */ +#[ArrayShape([ + 'name' => 'string', + 'subject' => 'string', + 'hash' => 'string', + 'version' => 'int', + 'serialNumber' => 'string', + 'serialNumberHex' => 'string', + 'validFrom' => 'string', + 'validTo' => 'string', + 'validFrom_time_t' => 'int', + 'validTo_time_t' => 'int', + 'alias' => 'string', + 'signatureTypeSN' => 'string', + 'signatureTypeLN' => 'string', + 'signatureTypeNID' => 'int', + 'purposes' => 'array', + 'extensions' => 'array' +])] function openssl_x509_parse( #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|string"], default: "resource|string")] $certificate, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.0')] bool $shortname, @@ -1170,6 +1190,16 @@ function openssl_error_string(): string|false {} * @return array an array with the available certificate locations * @since 5.6 */ +#[ArrayShape([ + 'default_cert_file' => 'string', + 'default_cert_file_env' => 'string', + 'default_cert_dir' => 'string', + 'default_cert_dir_env' => 'string', + 'default_private_dir' => 'string', + 'default_default_cert_area' => 'string', + 'ini_cafile' => 'string', + 'ini_capath' => 'string' +])] function openssl_get_cert_locations(): array {} function openssl_get_curve_names(): array|false {} diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 343b3086c..90d8ad290 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -1,6 +1,7 @@ 'PgSql\Connection|null'], * and server keys and values (if available). Returns * FALSE on error or invalid connection. */ +#[ArrayShape(["client" => "string", "protocol" => "int", "server" => "string"])] function pg_version(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], default: 'resource')] $connection = null): array {} /** @@ -1025,6 +1027,7 @@ function pg_field_table(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], defa * @return array|false An array containing the NOTIFY message name and backend PID. * Otherwise if no NOTIFY is waiting, then FALSE is returned. */ +#[ArrayShape(["message" => "string", "pid" => "int", "payload" => "string"])] function pg_get_notify( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, diff --git a/posix/posix.php b/posix/posix.php index 937332479..cde825d4f 100644 --- a/posix/posix.php +++ b/posix/posix.php @@ -1,6 +1,7 @@ 'string', + 'nodename' => 'string', + 'release' => 'string', + 'version' => 'string', + 'machine' => 'string', + 'domainname' => 'string', +])] function posix_uname(): array|false {} /** @@ -222,6 +231,13 @@ function posix_uname(): array|false {} * cstime - system time used by current process and children. */ #[Pure] +#[ArrayShape([ + 'ticks' => 'int', + 'utime' => 'int', + 'stime' => 'int', + 'cutime' => 'int', + 'cstime' => 'int' +])] function posix_times(): array|false {} /** @@ -505,6 +521,15 @@ function posix_getgrgid(int $group_id): array|false {} * */ #[Pure] +#[ArrayShape([ + "name" => "string", + "passwd" => "string", + "uid" => "int", + "gid" => "int", + "gecos" => "string", + "dir" => "string", + "shell" => "string", +])] function posix_getpwnam(string $username): array|false {} /** @@ -581,6 +606,15 @@ function posix_getpwnam(string $username): array|false {} * */ #[Pure] +#[ArrayShape([ + 'name' => 'string', + 'passwd' => 'string', + 'uid' => 'int', + 'gid' => 'int', + 'gecos' => 'string', + 'dir' => 'string', + 'shell' => 'string', +])] function posix_getpwuid(int $user_id): array|false {} /** diff --git a/readline/readline.php b/readline/readline.php index e0fd64297..60ff827e7 100644 --- a/readline/readline.php +++ b/readline/readline.php @@ -1,6 +1,7 @@ * If called with one or two parameters, the old value is returned. */ +#[ArrayShape([ + 'line_buffer' => 'string', + 'point' => 'int', + 'end' => 'int', + 'mark' => 'int', + 'done' => 'int', + 'pending_input' => 'int', + 'prompt' => 'string', + 'terminal_name' => 'string', + 'completion_append_character' => 'string', + 'completion_suppress_append' => 'bool', + 'erase_empty_line' => 'int', + 'library_version' => 'string', + 'readline_name' => 'string', + 'attempted_completion_over' => 'int', +])] function readline_info(?string $var_name, $value): mixed {} /** diff --git a/sockets/sockets.php b/sockets/sockets.php index e81e61019..dcae3bb59 100644 --- a/sockets/sockets.php +++ b/sockets/sockets.php @@ -1,6 +1,7 @@ 'int', + 'ai_family' => 'int', + 'ai_socktype' => 'int', + 'ai_protocol' => 'int', + 'ai_canonname' => 'string', + "ai_addr" => "array" +])] function socket_addrinfo_explain(AddressInfo $address): array {} /** diff --git a/standard/standard_0.php b/standard/standard_0.php index 997e26e26..d2a003ff7 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -216,6 +216,7 @@ function usleep(int $microseconds): void {} * remaining in the delay *

*/ +#[ArrayShape(["seconds" => "int", "nanoseconds" => "int"])] function time_nanosleep(int $seconds, int $nanoseconds): array|bool {} /** @@ -293,6 +294,17 @@ function time_sleep_until(float $timestamp): bool {} */ #[Pure(true)] #[Deprecated(since: '8.1')] +#[ArrayShape([ + 'tm_sec' => 'int', + 'tm_min' => 'int', + 'tm_hour' => 'int', + 'tm_mday' => 'int', + 'tm_mon' => 'int', + 'tm_year' => 'int', + 'tm_wday' => 'int', + 'tm_yday' => 'int', + 'unparsed' => 'string' +])] function strptime(string $timestamp, string $format): array|false {} /** diff --git a/standard/standard_1.php b/standard/standard_1.php index 1b67bc7e9..1fd53aeef 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -260,6 +260,7 @@ function dirname(string $path, #[PhpStormStubsElementAvailable(from: '7.0')] int * string if not all elements are requested. */ #[Pure(true)] +#[ArrayShape(['dirname' => 'string', 'basename' => 'string', 'extension' => 'string', 'filename' => 'string'])] function pathinfo(string $path, #[ExpectedValues(flags: [ PATHINFO_DIRNAME, PATHINFO_BASENAME, diff --git a/standard/standard_4.php b/standard/standard_4.php index cecb532f0..6a2b04041 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -453,6 +453,7 @@ function ini_get(string $option): string|false {} *

*/ #[Pure(true)] +#[ArrayShape(["global_value" => "string", "local_value" => "string", "access" => "int"])] function ini_get_all(?string $extension, #[PhpStormStubsElementAvailable(from: '7.0')] bool $details = true): array|false {} /** @@ -879,6 +880,7 @@ function move_uploaded_file(string $from, string $to): bool {} * @since 7.3 */ #[Pure] +#[ArrayShape(["description" => "string", "mac" => "string", "mtu" => "int", "unicast" => "array", "up" => "bool"])] function net_get_interfaces(): array|false {} /** diff --git a/standard/standard_6.php b/standard/standard_6.php index 4da7b8cae..92835dd96 100644 --- a/standard/standard_6.php +++ b/standard/standard_6.php @@ -133,6 +133,7 @@ function stream_context_set_params($context, array $params): bool {} *

* @return array an associate array containing all context options and parameters. */ +#[ArrayShape(["notification" => "string", "options" => "array"])] function stream_context_get_params($context): array {} /** diff --git a/standard/standard_8.php b/standard/standard_8.php index 3f9f1a6e1..ee926981c 100644 --- a/standard/standard_8.php +++ b/standard/standard_8.php @@ -1,5 +1,6 @@ 'int', 1 => 'int', 2 => 'int', 3 => 'string', 'bits' => 'int', 'channels' => 'int', 'mime' => 'string'])] function getimagesizefromstring(string $string, &$image_info): array|false {} /** @@ -339,6 +341,16 @@ function ob_get_level(): int {} * blocksize... * */ +#[ArrayShape([ + "level" => "int", + "type" => "int", + "status" => "int", + "name" => "string", + "del" => "int", + "chunk_size" => "int", + "buffer_size" => "int", + "buffer_used" => "int", +])] function ob_get_status(bool $full_status = false): array {} /** diff --git a/sysvmsg/sysvmsg.php b/sysvmsg/sysvmsg.php index cc6131cf1..fa7b24676 100644 --- a/sysvmsg/sysvmsg.php +++ b/sysvmsg/sysvmsg.php @@ -1,6 +1,7 @@ "SysvMessageQueue"] * * */ +#[ArrayShape([ + "msg_perm.uid" => "int", + "msg_perm.gid" => "int", + "msg_perm.mode" => "int", + "msg_stime" => "int", + "msg_rtime" => "int", + "msg_ctime" => "int", + "msg_qnum" => "int", + "msg_qbytes" => "int", + "msg_lspid" => "int", + "msg_lrpid" => "int", +])] function msg_stat_queue(#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue): array|false {} /** From 07aac05fbfa01fa78244cf73d0b1f1d160a55abb Mon Sep 17 00:00:00 2001 From: Ivan Fedorov <37301285+isfedorov@users.noreply.github.com> Date: Fri, 14 Oct 2022 23:17:39 +0200 Subject: [PATCH 204/419] Apply suggestions from code review Co-authored-by: DmitryTronin --- curl/curl.php | 2 +- openssl/openssl.php | 1 + sockets/sockets.php | 7 ++++++- standard/standard_8.php | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/curl/curl.php b/curl/curl.php index 92ce0b7e8..c3b7db346 100644 --- a/curl/curl.php +++ b/curl/curl.php @@ -2757,7 +2757,7 @@ function curl_multi_getcontent(#[LanguageLevelTypeAware(['8.0' => 'CurlHandle'], * @return array|false On success, returns an associative array for the message, false on failure. */ #[Pure] -#[ArrayShape(["msg" => "string", "result" => "string", "handle" => "resource"])] +#[ArrayShape(["msg" => "int", "result" => "int", "handle" => "resource"])] function curl_multi_info_read(#[LanguageLevelTypeAware(['8.0' => 'CurlMultiHandle'], default: 'resource')] $multi_handle, &$queued_messages): array|false {} /** diff --git a/openssl/openssl.php b/openssl/openssl.php index a4e310e50..c3f0ed4fb 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -284,6 +284,7 @@ function openssl_x509_free(#[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificat 'name' => 'string', 'subject' => 'string', 'hash' => 'string', + 'issuer' => 'string', 'version' => 'int', 'serialNumber' => 'string', 'serialNumberHex' => 'string', diff --git a/sockets/sockets.php b/sockets/sockets.php index dcae3bb59..c0344c00b 100644 --- a/sockets/sockets.php +++ b/sockets/sockets.php @@ -63,7 +63,12 @@ function socket_addrinfo_bind(AddressInfo $address): Socket|false {} 'ai_socktype' => 'int', 'ai_protocol' => 'int', 'ai_canonname' => 'string', - "ai_addr" => "array" + 'ai_addr' => [ + 'sin_port' => 'int', + 'sin_addr' => 'string', + 'sin6_port' => 'int', + 'sin6_addr' => 'string', + ] ])] function socket_addrinfo_explain(AddressInfo $address): array {} diff --git a/standard/standard_8.php b/standard/standard_8.php index ee926981c..9b316e7ba 100644 --- a/standard/standard_8.php +++ b/standard/standard_8.php @@ -344,7 +344,7 @@ function ob_get_level(): int {} #[ArrayShape([ "level" => "int", "type" => "int", - "status" => "int", + "flags" => "int", "name" => "string", "del" => "int", "chunk_size" => "int", From cd1f13afe28568e0d7ee8a1cced87c018b746d26 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 14 Oct 2022 23:41:16 +0200 Subject: [PATCH 205/419] gmp_gcdext change type to mixed in ArrayShape --- gmp/gmp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmp/gmp.php b/gmp/gmp.php index 712828be1..aa30438f2 100644 --- a/gmp/gmp.php +++ b/gmp/gmp.php @@ -426,7 +426,7 @@ function gmp_gcd(GMP|string|int $num1, GMP|string|int $num2): GMP {} * @return array An array of GMP numbers. */ #[Pure] -#[ArrayShape(["g" => "int", "s" => "int", "t" => "int"])] +#[ArrayShape(["g" => "mixed", "s" => "mixed", "t" => "mixed"])] function gmp_gcdext(GMP|string|int $num1, GMP|string|int $num2): array {} /** From 6b568c153cea002dc6fad96285c3063d07cab18d Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 15 Oct 2022 15:50:34 +0200 Subject: [PATCH 206/419] add missed ArrayShape items for \PDOStatement::getColumnMeta --- PDO/PDO.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PDO/PDO.php b/PDO/PDO.php index 42bbf1753..e1fc82d80 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1851,7 +1851,16 @@ public function columnCount(): int {} * or if no result set exists. */ #[TentativeType] - #[ArrayShape(["name" => "string", "len" => "int", "precision" => "int", "native_type" => "string", "flags" => "array", "pdo_type" => "int"])] + #[ArrayShape([ + "name" => "string", + "len" => "int", + "precision" => "int", + "oci:decl_type" => "int|string", + "native_type" => "string", + "scale" => "int", + "flags" => "array", + "pdo_type" => "int" + ])] public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): array|false {} /** From 3f7da5dd5a5b3d333493b65016305e800e9e95fb Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 16 Oct 2022 16:39:41 +0200 Subject: [PATCH 207/419] [phpstorm-stubs] update php for test to 8.2 rc4 --- sockets/sockets.php | 4 ++-- tests/DockerImages/8.2/Dockerfile | 2 +- xml/xml.php | 30 ++++++++++++++++++++---------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/sockets/sockets.php b/sockets/sockets.php index c0344c00b..7fa20c9f4 100644 --- a/sockets/sockets.php +++ b/sockets/sockets.php @@ -1679,7 +1679,7 @@ function socket_wsaprotocol_info_release($info_id) {} * File table overflow. * @link https://php.net/manual/en/sockets.constants.php */ -define('SOCKET_ENFILE', 24); +define('SOCKET_ENFILE', 23); /** * Too many open files. @@ -2059,7 +2059,7 @@ function socket_wsaprotocol_info_release($info_id) {} * Connection reset by peer. * @link https://php.net/manual/en/sockets.constants.php */ -define('SOCKET_ECONNRESET', 103); +define('SOCKET_ECONNRESET', 104); /** * No buffer space available. diff --git a/tests/DockerImages/8.2/Dockerfile b/tests/DockerImages/8.2/Dockerfile index 03792e9a3..d1d644878 100644 --- a/tests/DockerImages/8.2/Dockerfile +++ b/tests/DockerImages/8.2/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.0RC1-alpine +FROM php:8.2.0RC4-alpine RUN set -eux; \ apk add --no-cache --virtual .build-deps \ diff --git a/xml/xml.php b/xml/xml.php index fad725b4f..5d22a2a91 100644 --- a/xml/xml.php +++ b/xml/xml.php @@ -62,7 +62,8 @@ function xml_parser_create_ns(?string $encoding, string $separator = ':') {} *

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_object(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, object $object): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_object(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, object $object) {} /** * Set up start and end element handlers @@ -91,7 +92,8 @@ function xml_set_object(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_element_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $start_handler, $end_handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_element_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $start_handler, $end_handler) {} /** * Set up character data handler @@ -115,7 +117,8 @@ function xml_set_element_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"] * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_character_data_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_character_data_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Set up processing instruction (PI) handler @@ -140,7 +143,8 @@ function xml_set_character_data_handler(#[LanguageLevelTypeAware(["8.0" => "XMLP * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_processing_instruction_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_processing_instruction_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Set up default handler @@ -164,7 +168,8 @@ function xml_set_processing_instruction_handler(#[LanguageLevelTypeAware(["8.0" * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_default_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_default_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Set up unparsed entity declaration handler @@ -193,7 +198,8 @@ function xml_set_default_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"] * handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_unparsed_entity_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_unparsed_entity_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Set up notation declaration handler @@ -220,7 +226,8 @@ function xml_set_unparsed_entity_decl_handler(#[LanguageLevelTypeAware(["8.0" => * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_notation_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_notation_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Set up external entity reference handler @@ -251,7 +258,8 @@ function xml_set_notation_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLPa * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_external_entity_ref_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_external_entity_ref_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Set up start namespace declaration handler @@ -280,7 +288,8 @@ function xml_set_external_entity_ref_handler(#[LanguageLevelTypeAware(["8.0" => * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_start_namespace_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_start_namespace_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Set up end namespace declaration handler @@ -308,7 +317,8 @@ function xml_set_start_namespace_decl_handler(#[LanguageLevelTypeAware(["8.0" => * reference to the XML parser calling the handler.

* @return bool TRUE on success or FALSE on failure. */ -function xml_set_end_namespace_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler): bool {} +#[LanguageLevelTypeAware(["8.2" => "true"], default: "bool")] +function xml_set_end_namespace_decl_handler(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, $handler) {} /** * Start parsing an XML document From ded8d118bab0870bf61027bf4fbdfbe6dcc0afd4 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Thu, 20 Oct 2022 16:23:52 +0200 Subject: [PATCH 208/419] WI-69048 Remove expected arguments for open file open mode Since they'll be suggested by native support in PhpStorm with special descriptions --- meta/.phpstorm.meta.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 013be309c..055fa67d8 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -187,10 +187,6 @@ function argumentsSet($setName) { expectedArguments(\ftp_put(), 3, FTP_ASCII,FTP_BINARY); expectedArguments(\ftp_fput(), 3, FTP_ASCII,FTP_BINARY); - expectedArguments(\fopen(), 1, 'r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+', 'e'); - expectedArguments(\popen(), 1, 'r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+', 'e'); - expectedArguments(\SplFileInfo::openFile(), 0, 'r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+', 'e'); - expectedArguments(\htmlentities(), 1, ENT_COMPAT | ENT_QUOTES | ENT_NOQUOTES | ENT_IGNORE | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML401 | ENT_XML1 | ENT_XHTML | ENT_HTML5); expectedArguments(\htmlspecialchars(), 1, ENT_COMPAT | ENT_QUOTES | ENT_NOQUOTES | ENT_IGNORE | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML401 | ENT_XML1 | ENT_XHTML | ENT_HTML5); expectedArguments(\html_entity_decode(), 1, ENT_COMPAT | ENT_QUOTES | ENT_NOQUOTES | ENT_HTML401 | ENT_XML1 | ENT_XHTML | ENT_HTML5); From 3d9c372a5d16e60cb2e1045ce2996e75b807f637 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Wed, 26 Oct 2022 13:43:10 +0200 Subject: [PATCH 209/419] WI-69391 Add tests for expected values of constants --- tests/StubsMetaExpectedArgumentsTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/StubsMetaExpectedArgumentsTest.php b/tests/StubsMetaExpectedArgumentsTest.php index cbe9dd6fa..33c0795b6 100644 --- a/tests/StubsMetaExpectedArgumentsTest.php +++ b/tests/StubsMetaExpectedArgumentsTest.php @@ -116,7 +116,13 @@ public function testFunctionReferencesExists() self::assertArrayHasKey($fqn, self::$methodsFqns, "Can't resolve method " . $fqn); } } - } elseif ($expr !== null) { + } elseif ($expr instanceof ConstFetch) { + $fqn = self::toPresentableFqn($expr->name->toCodeString()); + if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX)) { + self::assertArrayHasKey($fqn, self::$constantsFqns, "Can't resolve constant " . $fqn); + } + } + elseif ($expr !== null) { self::fail('First argument should be function reference or method reference, got: ' . $expr::class); } } From ccd56bcdf1a469a74833372b8bd04bc61a94ba55 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Wed, 26 Oct 2022 13:43:35 +0200 Subject: [PATCH 210/419] WI-69391 Expected values for PHP_OS_FAMILY, PHP_OS, PHP_SAPY --- meta/.phpstorm.meta.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 055fa67d8..9e0705927 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -667,6 +667,10 @@ function expectedReturnValues($functionReference, $values) { expectedArguments(\array_unique(), 1, SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_LOCALE_STRING); + expectedReturnValues(\PHP_OS_FAMILY, 'Windows', 'Linux', 'Darwin', 'BSD', 'Solaris', 'Unknown'); + expectedReturnValues(\PHP_OS, 'Darwin', 'Linux', 'Windows', 'WIN32', 'WINNT', 'FreeBSD', 'CYGWIN_NT-5.1', 'HP-UX', 'IRIX64', 'NetBSD', 'OpenBSD', 'OpenBSD'); + expectedReturnValues(\PHP_SAPI, 'cli', 'phpdbg', 'embed', 'apache', 'apache2handler', 'cgi-fcgi', 'cli-server', 'fpm-fcgi', 'litespeed'); + /** * Use this constant to mark the function with an argument on the specified position as an exit point * From 2eaa96d1ae77d9785a0cc4092d7b7bb1f9f72304 Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Wed, 26 Oct 2022 13:52:32 +0200 Subject: [PATCH 211/419] Expected values for php_sapi_name --- standard/standard_0.php | 1 + 1 file changed, 1 insertion(+) diff --git a/standard/standard_0.php b/standard/standard_0.php index d2a003ff7..361cb4c61 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -1243,6 +1243,7 @@ function zend_logo_guid(): string {} *

*/ #[Pure] +#[ExpectedValues(['cli', 'phpdbg', 'embed', 'apache', 'apache2handler', 'cgi-fcgi', 'cli-server', 'fpm-fcgi', 'litespeed'])] function php_sapi_name(): string|false {} /** From 62a9fc720bc0e439cb8b874e87c6026d6bffb5a8 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 31 Oct 2022 12:37:34 +0100 Subject: [PATCH 212/419] [phpstorm-stubs] update php for test to 8.2 rc5 --- tests/DockerImages/8.2/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DockerImages/8.2/Dockerfile b/tests/DockerImages/8.2/Dockerfile index d1d644878..93e504b5c 100644 --- a/tests/DockerImages/8.2/Dockerfile +++ b/tests/DockerImages/8.2/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.0RC4-alpine +FROM php:8.2.0RC5-alpine RUN set -eux; \ apk add --no-cache --virtual .build-deps \ From 71aa90829981f363ffe1f1df9232525a205d12c5 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 3 Nov 2022 21:45:55 +0100 Subject: [PATCH 213/419] [phpstorm-stubs] move SQLITE3_DETERMINISTIC to correct stub --- SQLite/SQLite.php | 8 -------- sqlite3/sqlite3.php | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/SQLite/SQLite.php b/SQLite/SQLite.php index f6bbabf9a..21613d692 100644 --- a/SQLite/SQLite.php +++ b/SQLite/SQLite.php @@ -1399,11 +1399,3 @@ function sqlite_fetch_column_types($dbhandle, $table_name, $result_type = null) * @link https://php.net/manual/en/sqlite.constants.php */ define('SQLITE_DONE', 101); - -/** - * Specifies that a function created with {@see SQLite3::createFunction()} is deterministic, - * i.e. it always returns the same result given the same inputs within a single SQL statement. - * @since 7.1.4 - * @link https://php.net/manual/en/sqlite.constants.php - */ -define('SQLITE3_DETERMINISTIC', 2048); diff --git a/sqlite3/sqlite3.php b/sqlite3/sqlite3.php index c69b1da9f..b26210e46 100644 --- a/sqlite3/sqlite3.php +++ b/sqlite3/sqlite3.php @@ -682,4 +682,12 @@ private function __construct() {} */ define('SQLITE3_OPEN_CREATE', 4); +/** + * Specifies that a function created with {@see SQLite3::createFunction()} is deterministic, + * i.e. it always returns the same result given the same inputs within a single SQL statement. + * @since 7.1.4 + * @link https://php.net/manual/en/sqlite.constants.php + */ +define('SQLITE3_DETERMINISTIC', 2048); + // End of sqlite3 v.0.7-dev From cea31eee19f54a435d708745ecd6236db9f5b329 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 3 Nov 2022 21:49:07 +0100 Subject: [PATCH 214/419] [phpstorm-stubs] update stubs map --- PhpStormStubsMap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 9934c868e..bfdb30d0c 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -11874,7 +11874,7 @@ final class PhpStormStubsMap 'SQLITE3_ASSOC' => 'sqlite3/sqlite3.php', 'SQLITE3_BLOB' => 'sqlite3/sqlite3.php', 'SQLITE3_BOTH' => 'sqlite3/sqlite3.php', - 'SQLITE3_DETERMINISTIC' => 'SQLite/SQLite.php', + 'SQLITE3_DETERMINISTIC' => 'sqlite3/sqlite3.php', 'SQLITE3_FLOAT' => 'sqlite3/sqlite3.php', 'SQLITE3_INTEGER' => 'sqlite3/sqlite3.php', 'SQLITE3_NULL' => 'sqlite3/sqlite3.php', From 88a3622b7f4e8f1ee878bd35e88b797521611d3d Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 5 Nov 2022 13:03:05 +0100 Subject: [PATCH 215/419] [phpstorm-stubs] WI-68667 return type of static XMLReader::open() should be bool|XMLReader --- xmlreader/xmlreader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmlreader/xmlreader.php b/xmlreader/xmlreader.php index 651559147..d895cab07 100644 --- a/xmlreader/xmlreader.php +++ b/xmlreader/xmlreader.php @@ -309,7 +309,7 @@ public function moveToNextAttribute(): bool {} * A bitmask of the LIBXML_* * constants. *

- * @return bool TRUE on success or FALSE on failure. If called statically, returns an + * @return XMLReader|bool TRUE on success or FALSE on failure. If called statically, returns an * XMLReader or FALSE on failure. * @since 5.1.2 */ From 8489a590de3dd3a33f3728764b7d15f29e7a17e9 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 6 Nov 2022 09:34:04 +0100 Subject: [PATCH 216/419] [phpstorm-stubs] WI-68647 add overloaded imagefilledpolygon function --- gd/gd.php | 24 ++++++++++++++++++++++-- tests/TestData/mutedProblems.json | 11 +++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/gd/gd.php b/gd/gd.php index 27b74d859..655a2d19a 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1179,8 +1179,28 @@ function imagefilledpolygon( GdImage $image, array $points, #[Deprecated(since: "8.1")] int $num_points_or_color, - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] ?int $color, - #[PhpStormStubsElementAvailable(from: '8.0')] ?int $color = null + ?int $color +): bool {} + +/** + * Draw a filled polygon + * @link https://php.net/manual/en/function.imagefilledpolygon.php + * @param GdImage $image + * @param int[] $points

+ * An array containing the x and y + * coordinates of the polygons vertices consecutively. + *

+ * @param int|null $color

+ * A color identifier created with + * imagecolorallocate. + *

+ * @return bool true on success or false on failure. + */ +#[PhpStormStubsElementAvailable(from: '8.0')] +function imagefilledpolygon( + GdImage $image, + array $points, + ?int $color ): bool {} /** diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index e04804c68..b8033b9cc 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -574,6 +574,17 @@ } ], "functions": [ + { + "name": "imagefilledpolygon", + "problems": [ + { + "description": "has duplicate in stubs", + "versions": [ + "ALL" + ] + } + ] + }, { "name": "session_set_save_handler", "problems": [ From d0768e300b75b2123d639db9987da50001af9910 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 6 Nov 2022 10:35:12 +0100 Subject: [PATCH 217/419] [phpstorm-stubs] WI-68439 setlocale can accept array as second parameter --- standard/standard_1.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/standard_1.php b/standard/standard_1.php index 1fd53aeef..efa46d410 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -1070,7 +1070,7 @@ function join(array|string $separator = "", ?array $array): string {} * * * - * @param string|array|int $locales

+ * @param string|string[]|int $locales

* If locale is null or the empty string * "", the locale names will be set from the * values of environment variables with the same names as the above @@ -1087,7 +1087,7 @@ function join(array|string $separator = "", ?array $array): string {} * different names on different systems or for providing a fallback * for a possibly not available locale. *

- * @param string ...$rest + * @param string|string[] ...$rest * @return string|false

the new current locale, or false if the locale functionality is * not implemented on your platform, the specified locale does not exist or * the category name is invalid. From 279e56519e5396305d06843adbf0f04ad8fc74be Mon Sep 17 00:00:00 2001 From: Thomas Lamy Date: Sun, 6 Nov 2022 11:43:13 +0100 Subject: [PATCH 218/419] fix: `$position` paramter to `lInsert()` is string --- redis/RedisCluster.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index 6ba8a6a7f..3fb316e14 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -649,7 +649,7 @@ public function lPushx($key, $value) {} * or the pivot didn't exists, the value is not inserted. * * @param string $key - * @param int $position RedisCluster::BEFORE | RedisCluster::AFTER + * @param string $position RedisCluster::BEFORE | RedisCluster::AFTER * @param string $pivot * @param string $value * From 8b9f954e3cd6ebda634574d96be287cbb24caed8 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 6 Nov 2022 16:18:36 +0100 Subject: [PATCH 219/419] [phpstorm-stubs] WI-69449 add expected values for PHP_VERSION & PHP_VERSION_ID --- meta/.phpstorm.meta.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 9e0705927..ede319ab1 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -670,6 +670,8 @@ function expectedReturnValues($functionReference, $values) { expectedReturnValues(\PHP_OS_FAMILY, 'Windows', 'Linux', 'Darwin', 'BSD', 'Solaris', 'Unknown'); expectedReturnValues(\PHP_OS, 'Darwin', 'Linux', 'Windows', 'WIN32', 'WINNT', 'FreeBSD', 'CYGWIN_NT-5.1', 'HP-UX', 'IRIX64', 'NetBSD', 'OpenBSD', 'OpenBSD'); expectedReturnValues(\PHP_SAPI, 'cli', 'phpdbg', 'embed', 'apache', 'apache2handler', 'cgi-fcgi', 'cli-server', 'fpm-fcgi', 'litespeed'); + expectedReturnValues(\PHP_VERSION, '5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'); + expectedReturnValues(\PHP_VERSION_ID, 50300, 50400, 50500, 50600, 70000, 70100, 70200, 70300, 70400, 80000, 80100, 80200); /** * Use this constant to mark the function with an argument on the specified position as an exit point From 0f16040aeb830bca1f533ce558cc073869988811 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 6 Nov 2022 22:03:40 +0100 Subject: [PATCH 220/419] [phpstorm-stubs] WI-69083 parameter in IntlBreakIterator::getPartsIterator should have type int --- intl/intl.php | 6 ++++- tests/StubsTypeHintsTest.php | 2 +- .../ReflectionParametersProvider.php | 20 ++++++++++++++++ tests/TestData/mutedProblems.json | 23 +++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/intl/intl.php b/intl/intl.php index 718e6f8a2..c392de92c 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -7208,7 +7208,11 @@ public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type): st */ #[Pure] #[TentativeType] - public function getPartsIterator(#[TypeAware(['8.0' => 'string'], default: '')] $type = IntlPartsIterator::KEY_SEQUENTIAL): IntlPartsIterator {} + public function getPartsIterator( + #[TypeAware(['8.0' => 'int'], default: '')] + #[EV([IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, IntlPartsIterator::KEY_RIGHT])] + $type = IntlPartsIterator::KEY_SEQUENTIAL + ): IntlPartsIterator {} /** * (PHP 5 >=5.5.0)
diff --git a/tests/StubsTypeHintsTest.php b/tests/StubsTypeHintsTest.php index ee1d07d63..3343c3fa6 100644 --- a/tests/StubsTypeHintsTest.php +++ b/tests/StubsTypeHintsTest.php @@ -121,7 +121,7 @@ public function testMethodsReturnTypeHints(PHPClass|PHPInterface $class, PHPMeth } /** - * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::methodParametersProvider + * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::methodParametersWithTypeHintProvider * @throws RuntimeException */ public function testMethodsParametersTypeHints(PHPClass|PHPInterface $reflectionClass, PHPMethod $reflectionMethod, PHPParameter $reflectionParameter) diff --git a/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php b/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php index c873bff04..751563825 100644 --- a/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php +++ b/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php @@ -79,6 +79,26 @@ public static function methodParametersProvider(): ?Generator } } + public static function methodParametersWithTypeHintProvider(): ?Generator + { + $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces(); + foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { + //exclude classes from PHPReflectionParser + if (strncmp($class->name, 'PHP', 3) !== 0) { + foreach (EntitiesFilter::getFilteredFunctions($class) as $method) { + foreach (EntitiesFilter::getFilteredParameters( + $method, + null, + StubProblemType::PARAMETER_TYPE_MISMATCH + ) as $parameter) { + yield "$class->name::$method->name($parameter->name)" => [$class, $method, $parameter]; + } + } + } + } + } + public static function methodOptionalParametersProvider(): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index b8033b9cc..0db910d70 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -3027,6 +3027,29 @@ } ] }, + { + "name": "IntlBreakIterator", + "methods": [ + { + "name": "getPartsIterator", + "parameters": [ + { + "name": "type", + "problems": [ + { + "description": "parameter type mismatch", + "versions": [ + 8.0, + 8.1, + 8.2 + ] + } + ] + } + ] + } + ] + }, { "name": "ParseError", "problems": [ From 2e4ef19de100741c618bd488856f25887c190802 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 11 Nov 2022 20:06:00 +0100 Subject: [PATCH 221/419] [phpstorm-stubs] fix test to check return type from PhpDoc and signature --- tests/StubsTypeHintsTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/StubsTypeHintsTest.php b/tests/StubsTypeHintsTest.php index 3343c3fa6..27ce38d3f 100644 --- a/tests/StubsTypeHintsTest.php +++ b/tests/StubsTypeHintsTest.php @@ -211,7 +211,10 @@ public static function testSignatureTypeHintsConformPhpDocInMethods(PHPFunction| // replace array notations like int[] or array to match the array type return preg_replace(['/\w+\[]/', '/array<[a-z,\s]+>/'], 'array', $typeName); }, $method->returnTypesFromPhpDoc); - $unifiedSignatureTypes = $method->returnTypesFromSignature; + $unifiedSignatureTypes = array_map(function (string $type) { + $typeParts = explode('\\', $type); + return end($typeParts); + }, $method->returnTypesFromSignature); if (count($unifiedSignatureTypes) === 1) { $type = array_pop($unifiedSignatureTypes); if (str_contains($type, '?')) { From a221d6e3064973fbad90af817f4d380d84baa74c Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 14 Nov 2022 12:59:59 +0100 Subject: [PATCH 222/419] [phpstorm-stubs] update php 8.2 to rc6 --- tests/DockerImages/8.2/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DockerImages/8.2/Dockerfile b/tests/DockerImages/8.2/Dockerfile index 93e504b5c..f582ec6b8 100644 --- a/tests/DockerImages/8.2/Dockerfile +++ b/tests/DockerImages/8.2/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.0RC5-alpine +FROM php:8.2.0RC6-alpine RUN set -eux; \ apk add --no-cache --virtual .build-deps \ From d89c9f7e8e10fdddbd22756c034af0fa84745123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Ol=C5=A1avsk=C3=BD?= Date: Tue, 15 Nov 2022 09:38:34 +0100 Subject: [PATCH 223/419] DateTimeZone::__construct throws Exception https://www.php.net/manual/en/datetimezone.construct.php --- date/date_c.php | 1 + 1 file changed, 1 insertion(+) diff --git a/date/date_c.php b/date/date_c.php index 5631170bb..21860fd9e 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -762,6 +762,7 @@ class DateTimeZone /** * @param string $timezone * @link https://php.net/manual/en/datetimezone.construct.php + * @throws Exception Emits Exception in case of an error. */ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $timezone) {} From 8dc3596d522c7a6830f36bd932aa6caa32d0f22b Mon Sep 17 00:00:00 2001 From: Joshua Behrens Date: Sat, 19 Nov 2022 16:55:55 +0100 Subject: [PATCH 224/419] Update 404 link for stream constants --- standard/standard_defines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_defines.php b/standard/standard_defines.php index ed759df0e..d08e6d4ad 100644 --- a/standard/standard_defines.php +++ b/standard/standard_defines.php @@ -878,7 +878,7 @@ * not be bound to the actual resource you requested. * If the requested resource is network based, this flag will cause the * opener to block until the whole contents have been downloaded. - * @link https://php.net/manual/en/internals2.ze1.streams.constants.php + * @link https://www.php.net/manual/en/stream.constants.php */ define('STREAM_MUST_SEEK', 16); define('STREAM_URL_STAT_LINK', 1); From 3f79c26a35a977cb7481c8ce8916698309f3b3e2 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Nov 2022 12:12:51 +0100 Subject: [PATCH 225/419] [phpstorm-stubs] WI-69932 fix PDO methods' parameters typehints --- PDO/PDO.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/PDO/PDO.php b/PDO/PDO.php index e1fc82d80..d16f5ca7b 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -963,7 +963,10 @@ public function __construct( * so PDO::prepare does not check the statement. */ #[TentativeType] - public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, array $options = []): PDOStatement|false {} + public function prepare( + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, + #[LanguageLevelTypeAware(['8.0' => 'array'], default: '')] $options = [] + ): PDOStatement|false {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1091,7 +1094,7 @@ public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] * @see PDOStatement::setFetchMode For a full description of the second and following parameters. */ #[PhpStormStubsElementAvailable(to: '7.4')] - public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {} + public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, $ctorargs = []) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
@@ -1713,7 +1716,10 @@ public function fetchAll( * correspond to the column names or FALSE on failure. */ #[TentativeType] - public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", array $constructorArgs = []): object|false {} + public function fetchObject( + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", + #[LanguageLevelTypeAware(['8.0' => 'array'], default: '')] $constructorArgs = [] + ): object|false {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
@@ -1877,7 +1883,7 @@ public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default * @return bool TRUE on success or FALSE on failure. */ #[PhpStormStubsElementAvailable(to: '7.4')] - public function setFetchMode($mode, $className = null, array $params = []) {} + public function setFetchMode($mode, $className = null, $params = []) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
From 35e3915c9d47464a0d1238c994c88b96d50e0261 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Nov 2022 16:57:24 +0100 Subject: [PATCH 226/419] [phpstorm-stubs] fix stub for PDO::query --- PDO/PDO.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PDO/PDO.php b/PDO/PDO.php index d16f5ca7b..4124b000e 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1097,7 +1097,7 @@ public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, $ctorargs = []) {} /** - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
+ * (PHP 5 >= 5.1.0, PHP 7, PHP 8, PECL pdo >= 0.2.0)
* Executes an SQL statement, returning a result set as a PDOStatement object * @link https://php.net/manual/en/pdo.query.php * @param string $statement

@@ -1106,7 +1106,7 @@ public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = *

* Data inside the query should be properly escaped. *

- * @param int $mode

+ * @param int|null $mode

* The fetch mode must be one of the PDO::FETCH_* constants. *

* @param mixed $fetch_mode_args

@@ -1118,7 +1118,12 @@ public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = * @see PDOStatement::setFetchMode For a full description of the second and following parameters. */ #[PhpStormStubsElementAvailable('8.0')] - public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetch_mode_args) {} + #[LanguageLevelTypeAware(['8.1' => 'PDOStatement|false'], default: '')] + public function query( + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $mode = null, + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$fetch_mode_args + ) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
From d07464d9afbfd62c9dd7ae830c91ec0711e13a46 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Nov 2022 22:23:56 +0100 Subject: [PATCH 227/419] [phpstorm-stubs] update PDO::query return type according to reflection --- PDO/PDO.php | 1 - 1 file changed, 1 deletion(-) diff --git a/PDO/PDO.php b/PDO/PDO.php index 4124b000e..6a05f0df1 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1118,7 +1118,6 @@ public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = * @see PDOStatement::setFetchMode For a full description of the second and following parameters. */ #[PhpStormStubsElementAvailable('8.0')] - #[LanguageLevelTypeAware(['8.1' => 'PDOStatement|false'], default: '')] public function query( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement, #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $mode = null, From 09091dac03bfad146cf91a7ecec311cea0239a1f Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Tue, 29 Nov 2022 17:06:23 +0100 Subject: [PATCH 228/419] Fix bcdiv/bcmod() $scale default value --- bcmath/bcmath.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bcmath/bcmath.php b/bcmath/bcmath.php index bf099e48a..c7042adbf 100644 --- a/bcmath/bcmath.php +++ b/bcmath/bcmath.php @@ -106,7 +106,7 @@ function bcdiv(string $num1, string $num2, ?int $scale = 0): ?string {} */ #[Pure] #[PhpStormStubsElementAvailable('8.0')] -function bcdiv(string $num1, string $num2, ?int $scale = 0): string {} +function bcdiv(string $num1, string $num2, ?int $scale = null): string {} /** * Get modulus of an arbitrary precision number @@ -150,7 +150,7 @@ function bcmod(string $num1, string $num2, ?int $scale = 0): ?string {} */ #[Pure] #[PhpStormStubsElementAvailable('8.0')] -function bcmod(string $num1, string $num2, ?int $scale = 0): string {} +function bcmod(string $num1, string $num2, ?int $scale = null): string {} /** * Raise an arbitrary precision number to another From 1549d53934cbec36c4d22ed641ca14e8b9fe9cb0 Mon Sep 17 00:00:00 2001 From: Andrew Dawes Date: Wed, 30 Nov 2022 14:01:45 +0100 Subject: [PATCH 229/419] Fixed wording for nl2br --- standard/standard_1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_1.php b/standard/standard_1.php index efa46d410..fb5a0db1b 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -185,7 +185,7 @@ function hebrevc(string $hebrew_text, $max_chars_per_line): string {} * The input string. *

* @param bool $use_xhtml [optional]

- * Whenever to use XHTML compatible line breaks or not. + * Whether to use XHTML compatible line breaks or not. *

* @return string the altered string. */ From d92bce0c567a97d33cf0e717a9a93799c8f0d07b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 1 Dec 2022 17:16:11 +0100 Subject: [PATCH 230/419] [phpstorm-stubs] fix docker image for php 8.1 --- tests/DockerImages/8.1/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/DockerImages/8.1/Dockerfile b/tests/DockerImages/8.1/Dockerfile index 649b01f27..78ec4a546 100644 --- a/tests/DockerImages/8.1/Dockerfile +++ b/tests/DockerImages/8.1/Dockerfile @@ -3,8 +3,8 @@ FROM php:8.1-alpine RUN set -eux; \ apk add --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ - libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ - php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ + libmcrypt-dev imap-dev php81-imap enchant2 php81-enchant bzip2-dev gettext-dev libxml2-dev php81-dev php81-gd icu-dev \ + php81-zip php81-tidy php81-intl libffi-dev openssl-dev php81-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev From 8b1d5851b394d7d7590dd96cb019a70bf099762e Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Thu, 1 Dec 2022 10:18:21 +0100 Subject: [PATCH 231/419] ZipArchive::open(): bool|int The documentation is not correct here: (I will try to update it, also) "Returns true on success, or one of the following error codes" | https://www.php.net/manual/en/ziparchive.open.php - https://github.com/vimeo/psalm/issues/6052 --- zip/zip.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zip/zip.php b/zip/zip.php index 48ceae7a7..758ecedfd 100644 --- a/zip/zip.php +++ b/zip/zip.php @@ -630,9 +630,9 @@ class ZipArchive implements Countable * ZipArchive::OVERWRITE *

* - * @return int|true Error codes + * @return int|bool Error codes *

- * Returns TRUE on success or the error code. + * Returns TRUE on success, FALSE or the error code on error. *

*

* ZipArchive::ER_EXISTS From b2e9fffa1f16cd399c1741d638ac9028a4a864b3 Mon Sep 17 00:00:00 2001 From: Andrew Dawes Date: Thu, 1 Dec 2022 07:42:15 +0100 Subject: [PATCH 232/419] Updated wording to match php docs --- standard/standard_0.php | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/standard/standard_0.php b/standard/standard_0.php index 361cb4c61..981013727 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -166,7 +166,7 @@ function constant(string $name): mixed {} * Convert binary data into hexadecimal representation * @link https://php.net/manual/en/function.bin2hex.php * @param string $string

- * A character. + * A string. *

* @return string the hexadecimal representation of the given string. */ @@ -176,7 +176,7 @@ function bin2hex(string $string): string {} /** * Delay execution * @link https://php.net/manual/en/function.sleep.php - * @param int $seconds

+ * @param int<0,max> $seconds

* Halt time in seconds. *

* @return int|false zero on success, or false on errors. If the call was interrupted @@ -308,7 +308,7 @@ function time_sleep_until(float $timestamp): bool {} function strptime(string $timestamp, string $format): array|false {} /** - * Flush the output buffer + * Flush system output buffer * @link https://php.net/manual/en/function.flush.php * @return void */ @@ -321,7 +321,7 @@ function flush(): void {} * The input string. *

* @param int $width [optional]

- * The column width. + * The number of characters at which the string will be wrapped. *

* @param string $break [optional]

* The line is broken using the optional @@ -333,7 +333,7 @@ function flush(): void {} * a word that is larger than the given width, it is broken apart. * (See second example). *

- * @return string the given string wrapped at the specified column. + * @return string the given string wrapped at the specified length. */ #[Pure] function wordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false): string {} @@ -765,7 +765,7 @@ function get_html_translation_table( * The input string. *

* @param bool $binary [optional]

- * If the optional raw_output is set to true, + * If the optional binary is set to true, * then the sha1 digest is instead returned in raw binary format with a * length of 20, otherwise the returned value is a 40-character * hexadecimal number. @@ -856,11 +856,12 @@ function iptcparse(string $iptc_block): array|false {} * Path to the JPEG image. *

* @param int $spool

- * Spool flag. If the spool flag is over 2 then the JPEG will be - * returned as a string. + * Spool flag. If the spool flag is less than 2 then the JPEG will + * be returned as a string. Otherwise the JPEG will be printed to + * STDOUT. *

- * @return string|bool If success and spool flag is lower than 2 then the JPEG will not be - * returned as a string, false on errors. + * @return string|bool If spool is less than 2, the JPEG will be returned, or false on + * failure. Otherwise returns true on success or false on failure. */ function iptcembed(string $iptc_data, string $filename, int $spool = 0): string|bool {} @@ -1026,7 +1027,7 @@ function image_type_to_mime_type(int $image_type): string {} * Removed since 8.0. * Whether to prepend a dot to the extension or not. Default to true. *

- * @return string|false A string with the extension corresponding to the given image type. + * @return string|false A string with the extension corresponding to the given image type, or false on failure. */ #[Pure] function image_type_to_extension(int $image_type, bool $include_dot = true): string|false {} @@ -1137,7 +1138,7 @@ function phpversion(?string $extension): string|false {} * @link https://php.net/manual/en/function.phpcredits.php * @param int $flags [optional]

* To generate a custom credits page, you may want to use the - * flag parameter. + * flags parameter. *

*

* @@ -1228,7 +1229,7 @@ function zend_logo_guid(): string {} /** * Returns the type of interface between web server and PHP * @link https://php.net/manual/en/function.php-sapi-name.php - * @return string|false the interface type, as a lowercase string. + * @return string|false the interface type, as a lowercase string, or false on failure. *

* Although not exhaustive, the possible return values include * aolserver, apache, @@ -1326,12 +1327,14 @@ function strnatcasecmp(string $string1, string $string2): int {} * The substring to search for *

* @param int $offset

- * The offset where to start counting + * The offset where to start counting. If the offset is negative, + * counting starts from the end of the string. *

* @param int|null $length [optional]

* The maximum length after the specified offset to search for the * substring. It outputs a warning if the offset plus the length is - * greater than the haystack length. + * greater than the haystack length. A negative length counts from + * the end of haystack. *

* @return int<0,max> This functions returns an integer. */ From d36c765ee9e0dbe457f180e3f91d581ba0a963b5 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 5 Dec 2022 14:09:32 +0100 Subject: [PATCH 233/419] [phpstorm-stubs] WI-70016 PDO: Fix PHPDoc for variadic parameters --- PDO/PDO.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PDO/PDO.php b/PDO/PDO.php index 6a05f0df1..dce5e5b5a 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1109,7 +1109,7 @@ public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = * @param int|null $mode

* The fetch mode must be one of the PDO::FETCH_* constants. *

- * @param mixed $fetch_mode_args

+ * @param mixed ...$fetch_mode_args

* Arguments of custom class constructor when the mode * parameter is set to PDO::FETCH_CLASS. *

@@ -1679,7 +1679,7 @@ public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: * column, bitwise-OR PDO::FETCH_COLUMN with * PDO::FETCH_GROUP. *

- * @param mixed ...$args [optional]

+ * @param mixed ...$args

* Arguments of custom class constructor when the fetch_style * parameter is PDO::FETCH_CLASS. *

From c6ad81b02eb4db40d552629156566040d1e7f604 Mon Sep 17 00:00:00 2001 From: Gijs de Jong Date: Tue, 6 Dec 2022 09:59:59 +0100 Subject: [PATCH 234/419] Documented Memcached checkKey method --- memcached/memcached.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/memcached/memcached.php b/memcached/memcached.php index 1edb4408a..385fe6e50 100644 --- a/memcached/memcached.php +++ b/memcached/memcached.php @@ -1493,6 +1493,14 @@ public function isPersistent() {} */ public function isPristine() {} + /** + * (PECL memcached >= 3.2.0)
+ * Check if the given key is valid. + * @param string $key + * @return bool + */ + public function checkKey($key) {} + /** * Flush and send buffered commands * @link https://github.com/php-memcached-dev/php-memcached/blob/v3.1.5/php_memcached.c From 49665ea4c04f1c3a459edcc001ac4761f025ba6d Mon Sep 17 00:00:00 2001 From: Gary Lockett Date: Mon, 5 Dec 2022 13:11:31 +0000 Subject: [PATCH 235/419] update amqp stubs according to latest from extension repository Signed-off-by: Gary Lockett --- PhpStormStubsMap.php | 1 - amqp/amqp.php | 56 +++++++------------------------------------- 2 files changed, 8 insertions(+), 49 deletions(-) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index bfdb30d0c..9a861a5e2 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -25,7 +25,6 @@ final class PhpStormStubsMap 'AMQPQueue' => 'amqp/amqp.php', 'AMQPQueueException' => 'amqp/amqp.php', 'AMQPTimestamp' => 'amqp/amqp.php', - 'AMQPValueException' => 'amqp/amqp.php', 'APCIterator' => 'apcu/apcu.php', 'APCUIterator' => 'apcu/apcu.php', 'AddressInfo' => 'sockets/sockets.php', diff --git a/amqp/amqp.php b/amqp/amqp.php index 8aaea79bc..077495d4c 100644 --- a/amqp/amqp.php +++ b/amqp/amqp.php @@ -5,13 +5,12 @@ * https://github.com/pdezwart/php-amqp */ +use JetBrains\PhpStorm\Deprecated; + /** * Passing in this constant as a flag will forcefully disable all other flags. * Use this if you want to temporarily disable the amqp.auto_ack ini setting. */ - -use JetBrains\PhpStorm\Deprecated; - define('AMQP_NOPARAM', 0); /** @@ -124,7 +123,7 @@ /** * The error number of OS socket timeout. */ -define('AMQP_OS_SOCKET_TIMEOUT_ERRNO', 536870923); +define('AMQP_OS_SOCKET_TIMEOUT_ERRNO', 536870947); /** * The maximum number of channels that can be open on a connection. @@ -953,19 +952,6 @@ public function setSaslMethod($method) {} * @return int AMQP_SASL_METHOD_PLAIN | AMQP_SASL_METHOD_EXTERNAL */ public function getSaslMethod() {} - - /** - * Return the connection name - * @return string|null - */ - public function getConnectionName() {} - - /** - * Set the connection name - * @param string $connection_name - * @return void - */ - public function setConnectionName($connection_name) {} } /** @@ -1029,7 +1015,7 @@ public function getConsumerTag() {} /** * Get the delivery tag of the message. * - * @return string The delivery tag of the message. + * @return int The delivery tag of the message. */ public function getDeliveryTag() {} @@ -1268,7 +1254,7 @@ public function setArguments(array $arguments) {} /** * Set the flags on an exchange. * - * @param int $flags A bitmask of flags. This call currently only + * @param int|null $flags A bitmask of flags. This call currently only * considers the following flags: * AMQP_DURABLE, AMQP_PASSIVE * (and AMQP_DURABLE, if librabbitmq version >= 0.5.3) @@ -1311,17 +1297,6 @@ public function getChannel() {} * @return AMQPConnection */ public function getConnection() {} - - /** - * Declare a new exchange on the broker. - * @return int - * @throws AMQPExchangeException - * @throws AMQPChannelException - * @throws AMQPConnectionException - * @see AMQPExchange::declareExchange() - */ - #[Deprecated] - public function declare() {} } /** @@ -1341,7 +1316,7 @@ class AMQPQueue * without the AMQP_AUTOACK flag through AMQPQueue::get() or * AMQPQueue::consume() * - * @param string $delivery_tag The message delivery tag of which to + * @param int $delivery_tag The message delivery tag of which to * acknowledge receipt. * @param int $flags The only valid flag that can be passed is * AMQP_MULTIPLE. @@ -1541,7 +1516,7 @@ public function getName() {} * behavior of calling this method while connected to any other broker is * undefined. * - * @param string $delivery_tag Delivery tag of last message to reject. + * @param int $delivery_tag Delivery tag of last message to reject. * @param int $flags AMQP_REQUEUE to requeue the message(s), * AMQP_MULTIPLE to nack all previous * unacked messages as well. @@ -1562,7 +1537,7 @@ public function nack($delivery_tag, $flags = AMQP_NOPARAM) {} * AMQPQueue::consume() and AMQPQueue::get() and using the AMQP_AUTOACK * flag are not eligible. * - * @param string $delivery_tag Delivery tag of the message to reject. + * @param int $delivery_tag Delivery tag of the message to reject. * @param int $flags AMQP_REQUEUE to requeue the message(s). * * @throws AMQPChannelException If the channel is not open. @@ -1668,16 +1643,6 @@ public function getConnection() {} * @return string|null */ public function getConsumerTag() {} - - /** - * Declare a new queue - * @return int - * @throws AMQPChannelException - * @throws AMQPConnectionException - * @see AMQPQueue::declareQueue() - */ - #[Deprecated] - public function declare() {} } /** @@ -1711,8 +1676,3 @@ public function __toString() {} * stub class representing AMQPExchangeValue from pecl-amqp */ class AMQPExchangeValue extends AMQPException {} - -/** - * stub class representing AMQPExchangeValue from pecl-amqp - */ -class AMQPValueException extends AMQPException {} From e2da5a96182370065cfcb0ea5f03a6e2519a7641 Mon Sep 17 00:00:00 2001 From: Martin Herndl Date: Fri, 9 Dec 2022 11:13:43 +0100 Subject: [PATCH 236/419] [phpstorm-stubs] fix openssl_random_pseudo_bytes return type --- openssl/openssl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openssl/openssl.php b/openssl/openssl.php index c3f0ed4fb..42be04c03 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -1174,7 +1174,7 @@ function openssl_pkey_derive( *

* @return string|false the generated string of bytes on success, or false on failure. */ -#[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] +#[LanguageLevelTypeAware(["7.4" => "string"], default: "string|false")] function openssl_random_pseudo_bytes(int $length, &$strong_result) {} /** From d2a0e9f7f2ea57788270c5e997ea32486299e475 Mon Sep 17 00:00:00 2001 From: Daan Schoone Date: Thu, 15 Dec 2022 15:32:17 +0100 Subject: [PATCH 237/419] [phpstorm-stubs] mark $case_insensitive optional for define Mark parameter `$case_insensitive` for function `define` as optional with default value `false`. Also mark it as available for older versions of PHP. --- Core/Core.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Core/Core.php b/Core/Core.php index e5b1857e0..a495fbda0 100755 --- a/Core/Core.php +++ b/Core/Core.php @@ -326,7 +326,7 @@ function error_reporting(?int $error_level): int {} * It is possible to define resource constants, * however it is not recommended and may cause unpredictable behavior. *

- * @param bool $case_insensitive

+ * @param bool $case_insensitive [optional]

* If set to true, the constant will be defined case-insensitive. * The default behavior is case-sensitive; i.e. * CONSTANT and Constant represent @@ -341,8 +341,7 @@ function error_reporting(?int $error_level): int {} function define( string $constant_name, #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: 'null|array|bool|int|float|string')] $value, - #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] bool $case_insensitive, - #[PhpStormStubsElementAvailable(from: '7.0')] #[Deprecated(since: 7.3)] bool $case_insensitive = false + #[Deprecated(since: 7.3)] bool $case_insensitive = false ): bool {} /** From 7b649979b190fece7b1ab8a652978dd7423bd5e2 Mon Sep 17 00:00:00 2001 From: Joshua Behrens Date: Sat, 17 Dec 2022 21:46:11 +0100 Subject: [PATCH 238/419] Update return type for rewinddir to void --- standard/standard_7.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/standard/standard_7.php b/standard/standard_7.php index b8b6dc83a..680ba315e 100644 --- a/standard/standard_7.php +++ b/standard/standard_7.php @@ -368,10 +368,9 @@ function getcwd(): string|false {} * not specified, the last link opened by opendir * is assumed. *

- * @return null|false * @see https://bugs.php.net/bug.php?id=75485 */ -function rewinddir($dir_handle): null|false {} +function rewinddir($dir_handle): void {} /** * Read entry from directory handle From 9d035c83c67d0001c0d6e0d44765e1bd9e2e524c Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Tue, 20 Dec 2022 12:42:37 +0100 Subject: [PATCH 239/419] [phpstorm-stubs] Deprecated 'since' version should be string --- Core/Core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Core.php b/Core/Core.php index a495fbda0..7e4d5b5ac 100755 --- a/Core/Core.php +++ b/Core/Core.php @@ -341,7 +341,7 @@ function error_reporting(?int $error_level): int {} function define( string $constant_name, #[LanguageLevelTypeAware(['8.1' => 'mixed'], default: 'null|array|bool|int|float|string')] $value, - #[Deprecated(since: 7.3)] bool $case_insensitive = false + #[Deprecated(since: "7.3")] bool $case_insensitive = false ): bool {} /** From 605ed904480a632e731c3571c33480717ae02101 Mon Sep 17 00:00:00 2001 From: Tim Bond Date: Mon, 26 Dec 2022 23:19:11 -0800 Subject: [PATCH 240/419] Add manual link to DateTimeImmutable::add --- date/date_c.php | 1 + 1 file changed, 1 insertion(+) diff --git a/date/date_c.php b/date/date_c.php index 21860fd9e..258066280 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -196,6 +196,7 @@ public function __construct( * Adds an amount of days, months, years, hours, minutes and seconds * @param DateInterval $interval * @return static + * @link https://secure.php.net/manual/en/datetimeimmutable.add.php */ #[TentativeType] public function add(DateInterval $interval): DateTimeImmutable {} From bb1a2d92910fa06a43d87caeffafdf82f0bbd2a8 Mon Sep 17 00:00:00 2001 From: omasn Date: Thu, 1 Dec 2022 19:47:32 +0300 Subject: [PATCH 241/419] Generator template covariant yield\return --- standard/_types.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/standard/_types.php b/standard/_types.php index 13cb3741c..17a399f2c 100644 --- a/standard/_types.php +++ b/standard/_types.php @@ -149,15 +149,15 @@ function PS_UNRESERVE_PREFIX_unset($var, ...$_) {} function PS_UNRESERVE_PREFIX_eval($code) {} /** - * @template TKey of array-key - * @template TSend - * @template TReturn - * @template TYield - * * Generator objects are returned from generators, cannot be instantiated via new. * @link https://secure.php.net/manual/en/class.generator.php * @link https://wiki.php.net/rfc/generators * + * @template-covariant TKey + * @template-covariant TYield + * @template TSend + * @template-covariant TReturn + * * @template-implements Iterator */ final class Generator implements Iterator From 874bc80c4f32cd13f79ab58ff209f2f7d5f36e59 Mon Sep 17 00:00:00 2001 From: Ben Mewburn Date: Mon, 2 Jan 2023 14:43:44 +1100 Subject: [PATCH 242/419] Fix param and return type for ImagickKernel::fromBuiltIn --- imagick/imagick.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagick/imagick.php b/imagick/imagick.php index b010fa4e0..4c0d5a699 100644 --- a/imagick/imagick.php +++ b/imagick/imagick.php @@ -7278,9 +7278,9 @@ public function addUnityKernel() {} * Create a kernel from a builtin in kernel. See https://www.imagemagick.org/Usage/morphology/#kernel for examples.
* Currently the 'rotation' symbols are not supported. Example: $diamondKernel = ImagickKernel::fromBuiltIn(\Imagick::KERNEL_DIAMOND, "2"); * @link https://php.net/manual/en/imagickkernel.frombuiltin.php - * @param string $kernelType The type of kernel to build e.g. \Imagick::KERNEL_DIAMOND + * @param int $kernelType The type of kernel to build e.g. \Imagick::KERNEL_DIAMOND * @param string $kernelString A string that describes the parameters e.g. "4,2.5" - * @return void + * @return ImagickKernel * @since 3.3.0 */ public static function fromBuiltin($kernelType, $kernelString) {} From fcbf2d05c68b3453730c3452c72eba49ab9296b2 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 2 Jan 2023 21:52:54 +0100 Subject: [PATCH 243/419] [phpstorm-stubs] change alpine repo for latest php versions --- tests/DockerImages/8.1/Dockerfile | 6 +++--- tests/DockerImages/8.2/Dockerfile | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/DockerImages/8.1/Dockerfile b/tests/DockerImages/8.1/Dockerfile index 78ec4a546..d6b728277 100644 --- a/tests/DockerImages/8.1/Dockerfile +++ b/tests/DockerImages/8.1/Dockerfile @@ -1,10 +1,10 @@ FROM php:8.1-alpine RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ + apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ - libmcrypt-dev imap-dev php81-imap enchant2 php81-enchant bzip2-dev gettext-dev libxml2-dev php81-dev php81-gd icu-dev \ - php81-zip php81-tidy php81-intl libffi-dev openssl-dev php81-pear rabbitmq-c rabbitmq-c-dev librrd \ + libmcrypt-dev imap-dev php-imap enchant2 php-enchant bzip2-dev gettext-dev libxml2-dev php81-dev php-gd icu-dev \ + php-zip php-tidy php-intl libffi-dev openssl-dev php81-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev diff --git a/tests/DockerImages/8.2/Dockerfile b/tests/DockerImages/8.2/Dockerfile index f582ec6b8..9d60d7554 100644 --- a/tests/DockerImages/8.2/Dockerfile +++ b/tests/DockerImages/8.2/Dockerfile @@ -1,10 +1,10 @@ -FROM php:8.2.0RC6-alpine +FROM php:8.2-alpine RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ + apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community --no-cache --virtual .build-deps \ bash gcc g++ make autoconf pkgconfig git \ - libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ - php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ + libmcrypt-dev imap-dev php-imap enchant2 php-enchant bzip2-dev gettext-dev libxml2-dev php82-dev php-gd icu-dev \ + php-zip php-tidy php-intl libffi-dev openssl-dev php82-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ libpng-dev gpgme gpgme-dev libpq-dev aspell-dev From 2e494d0bb414b081b9e1abc97ca2c062509fe0c4 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 2 Jan 2023 22:08:11 +0100 Subject: [PATCH 244/419] [phpstorm-stubs] update constant values --- curl/curl_d.php | 2 +- intl/intl.php | 4 ++-- pgsql/pgsql.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/curl/curl_d.php b/curl/curl_d.php index 81afa35a9..7fac0c356 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -2973,7 +2973,7 @@ /** * @link https://php.net/manual/en/curl.constants.php */ -define("CURLINFO_LASTONE", 60); +define("CURLINFO_LASTONE", 62); /** * An easy handle already added to a multi handle was attempted to get added a second time. * @link https://www.php.net/manual/en/function.curl-multi-exec.php diff --git a/intl/intl.php b/intl/intl.php index c392de92c..40cdf5731 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -6754,8 +6754,8 @@ function intltz_get_id_for_windows_id(string $timezoneId, ?string $region = null * @link https://php.net/manual/en/intl.constants.php */ define('INTL_MAX_LOCALE_LEN', 156); -define('INTL_ICU_VERSION', "71.1"); -define('INTL_ICU_DATA_VERSION', "71.1"); +define('INTL_ICU_VERSION', "72.1"); +define('INTL_ICU_DATA_VERSION', "72.1"); define('ULOC_ACTUAL_LOCALE', 0); define('ULOC_VALID_LOCALE', 1); define('GRAPHEME_EXTR_COUNT', 0); diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 90d8ad290..5e0885f43 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -2065,8 +2065,8 @@ function pg_consume_input(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'] */ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection): int|bool {} -define('PGSQL_LIBPQ_VERSION', "14.5"); -define('PGSQL_LIBPQ_VERSION_STR', "14.5"); +define('PGSQL_LIBPQ_VERSION', "15.1"); +define('PGSQL_LIBPQ_VERSION_STR', "15.1"); /** * Passed to pg_connect to force the creation of a new connection, From 0dcae3360530cdfd5aaa3c7a54571539b5e03674 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 2 Jan 2023 22:30:21 +0100 Subject: [PATCH 245/419] [phpstorm-stubs] WI-70592 update parameter name --- gd/gd.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gd/gd.php b/gd/gd.php index 655a2d19a..08537aeb2 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1051,7 +1051,7 @@ function imagegif(GdImage $image, $file = null): bool {} * Output image to browser or file * @link https://php.net/manual/en/function.imagejpeg.php * @param resource|GdImage $image - * @param string $filename [optional]

+ * @param string $file [optional]

* The path to save the file to. If not set or null, the raw image stream * will be outputted directly. *

@@ -1066,7 +1066,7 @@ function imagegif(GdImage $image, $file = null): bool {} *

* @return bool true on success or false on failure. */ -function imagejpeg($image, $filename = null, $quality = null): bool {} +function imagejpeg($image, $file = null, $quality = null): bool {} /** * Output image to browser or file From 91c14303c23db2e3b0cac0bbb6d5db19c60ee38c Mon Sep 17 00:00:00 2001 From: Kirill Smelov Date: Thu, 5 Jan 2023 11:15:35 +0100 Subject: [PATCH 246/419] Add nested keys for return value of timezone abbreviations --- date/date.php | 2 +- date/date_c.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/date/date.php b/date/date.php index a31adf912..36e1766ec 100644 --- a/date/date.php +++ b/date/date.php @@ -1381,7 +1381,7 @@ function timezone_identifiers_list(int $timezoneGroup = DateTimeZone::ALL, ?stri * Alias: * {@see DateTimeZone::listAbbreviations} * @link https://php.net/manual/en/function.timezone-abbreviations-list.php - * @return array|false Array on success or FALSE on failure. + * @return array>|false Array on success or FALSE on failure. */ #[Pure] #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] diff --git a/date/date_c.php b/date/date_c.php index 258066280..d6db7e837 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -815,7 +815,7 @@ public function getTransitions( /** * Returns associative array containing dst, offset and the timezone name - * @return array + * @return array> * @link https://php.net/manual/en/datetimezone.listabbreviations.php */ #[TentativeType] From 6b426ebc3d616d7b356c52bf122595160cef083a Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 8 Jan 2023 21:42:57 +0100 Subject: [PATCH 247/419] [phpstorm-stubs] add imap_is_open function --- imap/imap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imap/imap.php b/imap/imap.php index 86e74f986..7f92a91a3 100644 --- a/imap/imap.php +++ b/imap/imap.php @@ -1566,6 +1566,11 @@ function imap_mutf7_to_utf8(string $string): string|false {} */ function imap_utf8_to_mutf7(string $string): string|false {} +/** + * @since 8.2 + */ +function imap_is_open(IMAP\Connection $imap): bool {} + /** * @deprecated 8.1 */ From d7f05730f25d489c3b06398e95752944b87bc900 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 8 Jan 2023 21:44:51 +0100 Subject: [PATCH 248/419] [phpstorm-stubs] update CURLVERSION_NOW value --- curl/curl_d.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curl/curl_d.php b/curl/curl_d.php index 7fac0c356..41873d6a5 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -1144,7 +1144,7 @@ * Will be the most recent age value for the libcurl. * @link https://php.net/manual/en/curl.constants.php */ -define('CURLVERSION_NOW', 9); +define('CURLVERSION_NOW', 10); /** * All fine. Proceed as usual. * @link https://php.net/manual/en/curl.constants.php From 8e4f7af2ec69935c01a5724bb5eefe7320041b2c Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 8 Jan 2023 21:47:02 +0100 Subject: [PATCH 249/419] [phpstorm-stubs] update stubs map --- PhpStormStubsMap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 9a861a5e2..1cac10e75 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -3116,6 +3116,7 @@ final class PhpStormStubsMap 'imap_header' => 'imap/imap.php', 'imap_headerinfo' => 'imap/imap.php', 'imap_headers' => 'imap/imap.php', + 'imap_is_open' => 'imap/imap.php', 'imap_last_error' => 'imap/imap.php', 'imap_list' => 'imap/imap.php', 'imap_listmailbox' => 'imap/imap.php', From b543df50f5d71e4350b9e09f6758ff08f476d50b Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Sat, 7 Jan 2023 17:21:27 +0100 Subject: [PATCH 250/419] Allow DNF types in ReflectionUnionType::getTypes() --- Reflection/ReflectionUnionType.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Reflection/ReflectionUnionType.php b/Reflection/ReflectionUnionType.php index 1b76a1381..e429f4814 100644 --- a/Reflection/ReflectionUnionType.php +++ b/Reflection/ReflectionUnionType.php @@ -1,5 +1,6 @@ 'ReflectionNamedType[]|ReflectionIntersectionType[]' + ], + default: 'ReflectionNamedType[]' + )] public function getTypes(): array {} } From c114cf651e49aebc88504df4f880e83fba5a5116 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 9 Jan 2023 23:41:04 +0100 Subject: [PATCH 251/419] [phpstorm-stubs] add hrtime::get_as_number to known problem --- tests/TestData/mutedProblems.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index 0db910d70..afb9962a4 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -1035,6 +1035,23 @@ ] } ] + }, + { + "name": "hrtime", + "parameters": [ + { + "name": "get_as_number", + "problems": [ + { + "description": "wrong optionallity", + "versions": [ + 7.3, + 7.4 + ] + } + ] + } + ] } ], "classes": [ From 6476a39ec57eb61dfc45f2bb16819732a72c016c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Mon, 9 Jan 2023 18:23:26 +0100 Subject: [PATCH 252/419] hrtime(): $as_number is optional --- standard/standard_4.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_4.php b/standard/standard_4.php index 6a2b04041..2e07c2cf9 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -384,7 +384,7 @@ function highlight_string(string $string, bool $return = false): string|bool {} */ #[Pure(true)] function hrtime( - #[PhpStormStubsElementAvailable(from: '7.3', to: '7.4')] bool $as_number, + #[PhpStormStubsElementAvailable(from: '7.3', to: '7.4')] bool $as_number = false, #[PhpStormStubsElementAvailable(from: '8.0')] bool $as_number = false ): array|int|float|false {} From 0cd07f184f21e24149a30f0bb7a0d2a605ecd9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Mon, 9 Jan 2023 23:56:54 +0100 Subject: [PATCH 253/419] simplify --- standard/standard_4.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/standard/standard_4.php b/standard/standard_4.php index 2e07c2cf9..0c5e43fe2 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -383,10 +383,7 @@ function highlight_string(string $string, bool $return = false): string|bool {} * Otherwise the nanoseconds are returned as integer (64bit platforms) or float (32bit platforms). */ #[Pure(true)] -function hrtime( - #[PhpStormStubsElementAvailable(from: '7.3', to: '7.4')] bool $as_number = false, - #[PhpStormStubsElementAvailable(from: '8.0')] bool $as_number = false -): array|int|float|false {} +function hrtime(bool $as_number = false): array|int|float|false {} /** * Return source with stripped comments and whitespace From a9da276816d8af802b92f9dd8b5f81f8bfc9a38b Mon Sep 17 00:00:00 2001 From: Martins Lazdans Date: Fri, 13 Jan 2023 04:53:51 +0200 Subject: [PATCH 254/419] Remove removed flag --- interbase/interbase.php | 110 ---------------------------------------- 1 file changed, 110 deletions(-) diff --git a/interbase/interbase.php b/interbase/interbase.php index b4a609588..626c176d2 100644 --- a/interbase/interbase.php +++ b/interbase/interbase.php @@ -41,7 +41,6 @@ * @param int $sync [optional]

*

* @return resource|false an InterBase link identifier on success, or false on error. - * @removed 7.4 */ function ibase_connect($database = null, $username = null, $password = null, $charset = null, $buffers = null, $dialect = null, $role = null, $sync = null) {} @@ -84,7 +83,6 @@ function ibase_connect($database = null, $username = null, $password = null, $ch * @param int $sync [optional]

*

* @return resource|false an InterBase link identifier on success, or false on error. - * @removed 7.4 */ function ibase_pconnect($database = null, $username = null, $password = null, $charset = null, $buffers = null, $dialect = null, $role = null, $sync = null) {} @@ -97,7 +95,6 @@ function ibase_pconnect($database = null, $username = null, $password = null, $c * is assumed. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_close($connection_id = null) {} @@ -109,7 +106,6 @@ function ibase_close($connection_id = null) {} * assumed. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_drop_db($connection = null) {} @@ -135,7 +131,6 @@ function ibase_drop_db($connection = null) {} * affected by the query for INSERT, UPDATE and DELETE statements. In order * to retain backward compatibility, it will return true for these * statements if the query succeeded without affecting any rows. - * @removed 7.4 */ function ibase_query($link_identifier = null, $query, $bind_args = null) {} @@ -156,7 +151,6 @@ function ibase_query($link_identifier = null, $query, $bind_args = null) {} * @return array|false an array that corresponds to the fetched row, or false if there * are no more rows. Each result column is stored in an array offset, * starting at offset 0. - * @removed 7.4 */ function ibase_fetch_row($result_identifier, $fetch_flag = null) {} @@ -177,7 +171,6 @@ function ibase_fetch_row($result_identifier, $fetch_flag = null) {} * @return array|false an associative array that corresponds to the fetched row. * Subsequent calls will return the next row in the result set, or false if * there are no more rows. - * @removed 7.4 */ function ibase_fetch_assoc($result, $fetch_flag = null) {} @@ -198,7 +191,6 @@ function ibase_fetch_assoc($result, $fetch_flag = null) {} *

* @return object|false an object with the next row information, or false if there are * no more rows. - * @removed 7.4 */ function ibase_fetch_object($result_id, $fetch_flag = null) {} @@ -210,7 +202,6 @@ function ibase_fetch_object($result_id, $fetch_flag = null) {} * ibase_execute. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_free_result($result_identifier) {} @@ -224,7 +215,6 @@ function ibase_free_result($result_identifier) {} * The name to be assigned. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_name_result($result, $name) {} @@ -235,7 +225,6 @@ function ibase_name_result($result, $name) {} * An InterBase query. *

* @return resource|false a prepared query handle, or false on error. - * @removed 7.4 */ function ibase_prepare($query) {} @@ -257,7 +246,6 @@ function ibase_prepare($query) {} * the query (if > 0 and applicable to the statement type). A query that * succeeded, but did not affect any rows (e.g. an UPDATE of a non-existent * record) will return true. - * @removed 7.4 */ function ibase_execute($query, ...$bind_arg) {} @@ -268,7 +256,6 @@ function ibase_execute($query, ...$bind_arg) {} * A query prepared with ibase_prepare. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_free_query($query) {} @@ -279,7 +266,6 @@ function ibase_free_query($query) {} * @param int $increment [optional] * @param resource $link_identifier [optional] * @return mixed new generator value as integer, or as string if the value is too big. - * @removed 7.4 */ function ibase_gen_id($generator, $increment = null, $link_identifier = null) {} @@ -290,7 +276,6 @@ function ibase_gen_id($generator, $increment = null, $link_identifier = null) {} * An InterBase result identifier. *

* @return int the number of fields as an integer. - * @removed 7.4 */ function ibase_num_fields($result_id) {} @@ -301,7 +286,6 @@ function ibase_num_fields($result_id) {} * The prepared query handle. *

* @return int the number of parameters as an integer. - * @removed 7.4 */ function ibase_num_params($query) {} @@ -313,7 +297,6 @@ function ibase_num_params($query) {} * connection resource, its default transaction is used. *

* @return int the number of rows as an integer. - * @removed 7.4 */ function ibase_affected_rows($link_identifier = null) {} @@ -329,7 +312,6 @@ function ibase_affected_rows($link_identifier = null) {} * @return array an array with the following keys: name, * alias, relation, * length and type. - * @removed 7.4 */ function ibase_field_info($result, $field_number) {} @@ -345,7 +327,6 @@ function ibase_field_info($result, $field_number) {} * @return array an array with the following keys: name, * alias, relation, * length and type. - * @removed 7.4 */ function ibase_param_info($query, $param_number) {} @@ -369,7 +350,6 @@ function ibase_param_info($query, $param_number) {} * assumed. *

* @return resource|false a transaction handle, or false on error. - * @removed 7.4 */ function ibase_trans($trans_args = null, $link_identifier = null) {} @@ -384,7 +364,6 @@ function ibase_trans($trans_args = null, $link_identifier = null) {} * corresponding transaction will be committed. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_commit($link_or_trans_identifier = null) {} @@ -399,7 +378,6 @@ function ibase_commit($link_or_trans_identifier = null) {} * corresponding transaction will be rolled back. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_rollback($link_or_trans_identifier = null) {} @@ -416,7 +394,6 @@ function ibase_rollback($link_or_trans_identifier = null) {} * will not be invalidated. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_commit_ret($link_or_trans_identifier = null) {} @@ -433,7 +410,6 @@ function ibase_commit_ret($link_or_trans_identifier = null) {} * will not be invalidated. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_rollback_ret($link_or_trans_identifier = null) {} @@ -450,7 +426,6 @@ function ibase_rollback_ret($link_or_trans_identifier = null) {} * @return array an array containing information about a BLOB. The information returned * consists of the length of the BLOB, the number of segments it contains, the size * of the largest segment, and whether it is a stream BLOB or a segmented BLOB. - * @removed 7.4 */ function ibase_blob_info($link_identifier, $blob_id) {} @@ -463,7 +438,6 @@ function ibase_blob_info($link_identifier, $blob_id) {} *

* @return resource|false a BLOB handle for later use with * ibase_blob_add or false on failure. - * @removed 7.4 */ function ibase_blob_create($link_identifier = null) {} @@ -477,7 +451,6 @@ function ibase_blob_create($link_identifier = null) {} * The data to be added. *

* @return void - * @removed 7.4 */ function ibase_blob_add($blob_handle, $data) {} @@ -488,7 +461,6 @@ function ibase_blob_add($blob_handle, $data) {} * A BLOB handle opened with ibase_blob_create. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_blob_cancel($blob_handle) {} @@ -503,7 +475,6 @@ function ibase_blob_cancel($blob_handle) {} * the BLOB was being written to, this function returns a string containing * the BLOB id that has been assigned to it by the database. On failure, this * function returns false. - * @removed 7.4 */ function ibase_blob_close($blob_handle) {} @@ -519,7 +490,6 @@ function ibase_blob_close($blob_handle) {} *

* @return resource|false a BLOB handle for later use with * ibase_blob_get or false on failure. - * @removed 7.4 */ function ibase_blob_open($link_identifier, $blob_id) {} @@ -534,7 +504,6 @@ function ibase_blob_open($link_identifier, $blob_id) {} *

* @return string|false at most len bytes from the BLOB, or false * on failure. - * @removed 7.4 */ function ibase_blob_get($blob_handle, $len) {} @@ -544,7 +513,6 @@ function ibase_blob_get($blob_handle, $len) {} * @param string $blob_id

*

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_blob_echo($blob_id) {} @@ -559,7 +527,6 @@ function ibase_blob_echo($blob_id) {} * The file handle is a handle returned by fopen. *

* @return string|false the BLOB id on success, or false on error. - * @removed 7.4 */ function ibase_blob_import($link_identifier, $file_handle) {} @@ -567,7 +534,6 @@ function ibase_blob_import($link_identifier, $file_handle) {} * Return error messages * @link https://php.net/manual/en/function.ibase-errmsg.php * @return string|false the error message as a string, or false if no error occurred. - * @removed 7.4 */ function ibase_errmsg() {} @@ -575,7 +541,6 @@ function ibase_errmsg() {} * Return an error code * @link https://php.net/manual/en/function.ibase-errcode.php * @return int|false the error code as an integer, or false if no error occurred. - * @removed 7.4 */ function ibase_errcode() {} @@ -589,7 +554,6 @@ function ibase_errcode() {} * @param string $middle_name [optional] * @param string $last_name [optional] * @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_add_user($service_handle, $user_name, $password, $first_name = null, $middle_name = null, $last_name = null) {} @@ -603,7 +567,6 @@ function ibase_add_user($service_handle, $user_name, $password, $first_name = nu * @param string $middle_name [optional] * @param string $last_name [optional] * @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_modify_user($service_handle, $user_name, $password, $first_name = null, $middle_name = null, $last_name = null) {} @@ -613,7 +576,6 @@ function ibase_modify_user($service_handle, $user_name, $password, $first_name = * @param resource $service_handle * @param string $user_name * @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_delete_user($service_handle, $user_name) {} @@ -624,7 +586,6 @@ function ibase_delete_user($service_handle, $user_name) {} * @param string $dba_username * @param string $dba_password * @return resource|false - * @removed 7.4 */ function ibase_service_attach($host, $dba_username, $dba_password) {} @@ -633,7 +594,6 @@ function ibase_service_attach($host, $dba_username, $dba_password) {} * @link https://php.net/manual/en/function.ibase-service-detach.php * @param resource $service_handle * @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_service_detach($service_handle) {} @@ -646,7 +606,6 @@ function ibase_service_detach($service_handle) {} * @param int $options [optional] * @param bool $verbose [optional] * @return mixed - * @removed 7.4 */ function ibase_backup($service_handle, $source_db, $dest_file, $options = null, $verbose = null) {} @@ -659,7 +618,6 @@ function ibase_backup($service_handle, $source_db, $dest_file, $options = null, * @param int $options [optional] * @param bool $verbose [optional] * @return mixed - * @removed 7.4 */ function ibase_restore($service_handle, $source_file, $dest_db, $options = null, $verbose = null) {} @@ -671,7 +629,6 @@ function ibase_restore($service_handle, $source_file, $dest_db, $options = null, * @param int $action * @param int $argument [optional] * @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_maintain_db($service_handle, $db, $action, $argument = null) {} @@ -683,7 +640,6 @@ function ibase_maintain_db($service_handle, $db, $action, $argument = null) {} * @param int $action * @param int $argument [optional] * @return string - * @removed 7.4 */ function ibase_db_info($service_handle, $db, $action, $argument = null) {} @@ -693,7 +649,6 @@ function ibase_db_info($service_handle, $db, $action, $argument = null) {} * @param resource $service_handle * @param int $action * @return string - * @removed 7.4 */ function ibase_server_info($service_handle, $action) {} @@ -707,7 +662,6 @@ function ibase_server_info($service_handle, $action) {} *

* @param string ...$_ [optional] * @return string the name of the event that was posted. - * @removed 7.4 */ function ibase_wait_event($event_name1, $event_name2 = null, ...$_) {} @@ -733,7 +687,6 @@ function ibase_wait_event($event_name1, $event_name2 = null, ...$_) {} * @param string ...$_ [optional] * @return resource The return value is an event resource. This resource can be used to free * the event handler using ibase_free_event_handler. - * @removed 7.4 */ function ibase_set_event_handler($event_handler, $event_name1, $event_name2 = null, ...$_) {} @@ -745,7 +698,6 @@ function ibase_set_event_handler($event_handler, $event_name1, $event_name2 = nu * ibase_set_event_handler. *

* @return bool true on success or false on failure. - * @removed 7.4 */ function ibase_free_event_handler($event) {} @@ -1499,7 +1451,6 @@ function fbird_free_event_handler($event) {} * The default transaction settings are to be used. * This default is determined by the client library, which defines it as IBASE_WRITE|IBASE_CONCURRENCY|IBASE_WAIT in most cases. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_DEFAULT', 0); /** @@ -1515,33 +1466,28 @@ function fbird_free_event_handler($event) {} * Also available as IBASE_TEXT for backward compatibility. * Causes BLOB contents to be fetched inline, instead of being fetched as BLOB identifiers. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_FETCH_BLOBS', 1); /** * Causes arrays to be fetched inline. Otherwise, array identifiers are returned. * Array identifiers can only be used as arguments to INSERT operations, as no functions to handle array identifiers are currently available. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_FETCH_ARRAYS', 2); /** * Causes date and time fields not to be returned as strings, but as UNIX timestamps (the number of seconds since the epoch, which is 1-Jan-1970 0:00 UTC). * Might be problematic if used with dates before 1970 on some systems. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_UNIXTIME', 4); /** * Starts a read-write transaction. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_WRITE', 1); /** * Starts a read-only transaction. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_READ', 2); /** @@ -1551,14 +1497,12 @@ function fbird_free_event_handler($event) {} * If IBASE_REC_NO_VERSION was specified, only the latest version of a row can be read. * If IBASE_REC_VERSION was specified, a row can even be read when a modification to it is pending in a concurrent transaction. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_COMMITTED', 8); /** * Starts a transaction with the isolation level set to 'consistency', * which means the transaction cannot read from tables that are being modified by other concurrent transactions. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_CONSISTENCY', 16); /** @@ -1566,7 +1510,6 @@ function fbird_free_event_handler($event) {} * which means the transaction has access to all tables, * but cannot see changes that were committed by other transactions after the transaction was started. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_CONCURRENCY', 4); /** @@ -1582,232 +1525,179 @@ function fbird_free_event_handler($event) {} /** * Indicated that a transaction should fail immediately when a conflict occurs. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_NOWAIT', 256); /** * Indicated that a transaction should wait and retry when a conflict occurs. * @link https://www.php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_WAIT', 128); /** - * @removed 7.4 */ define('IBASE_BKP_IGNORE_CHECKSUMS', 1); /** - * @removed 7.4 */ define('IBASE_BKP_IGNORE_LIMBO', 2); /** - * @removed 7.4 */ define('IBASE_BKP_METADATA_ONLY', 4); /** - * @removed 7.4 */ define('IBASE_BKP_NO_GARBAGE_COLLECT', 8); /** - * @removed 7.4 */ define('IBASE_BKP_OLD_DESCRIPTIONS', 16); /** - * @removed 7.4 */ define('IBASE_BKP_NON_TRANSPORTABLE', 32); /** * Options to ibase_backup * @link https://php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_BKP_CONVERT', 64); /** - * @removed 7.4 */ define('IBASE_RES_DEACTIVATE_IDX', 256); /** - * @removed 7.4 */ define('IBASE_RES_NO_SHADOW', 512); /** - * @removed 7.4 */ define('IBASE_RES_NO_VALIDITY', 1024); /** - * @removed 7.4 */ define('IBASE_RES_ONE_AT_A_TIME', 2048); /** - * @removed 7.4 */ define('IBASE_RES_REPLACE', 4096); /** - * @removed 7.4 */ define('IBASE_RES_CREATE', 8192); /** * Options to ibase_restore * @link https://php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_RES_USE_ALL_SPACE', 16384); /** - * @removed 7.4 */ define('IBASE_PRP_PAGE_BUFFERS', 5); /** - * @removed 7.4 */ define('IBASE_PRP_SWEEP_INTERVAL', 6); /** - * @removed 7.4 */ define('IBASE_PRP_SHUTDOWN_DB', 7); /** - * @removed 7.4 */ define('IBASE_PRP_DENY_NEW_TRANSACTIONS', 10); /** - * @removed 7.4 */ define('IBASE_PRP_DENY_NEW_ATTACHMENTS', 9); /** - * @removed 7.4 */ define('IBASE_PRP_RESERVE_SPACE', 11); /** - * @removed 7.4 */ define('IBASE_PRP_RES_USE_FULL', 35); /** - * @removed 7.4 */ define('IBASE_PRP_RES', 36); /** - * @removed 7.4 */ define('IBASE_PRP_WRITE_MODE', 12); /** - * @removed 7.4 */ define('IBASE_PRP_WM_ASYNC', 37); /** - * @removed 7.4 */ define('IBASE_PRP_WM_SYNC', 38); /** - * @removed 7.4 */ define('IBASE_PRP_ACCESS_MODE', 13); /** - * @removed 7.4 */ define('IBASE_PRP_AM_READONLY', 39); /** - * @removed 7.4 */ define('IBASE_PRP_AM_READWRITE', 40); /** - * @removed 7.4 */ define('IBASE_PRP_SET_SQL_DIALECT', 14); /** - * @removed 7.4 */ define('IBASE_PRP_ACTIVATE', 256); /** - * @removed 7.4 */ define('IBASE_PRP_DB_ONLINE', 512); /** - * @removed 7.4 */ define('IBASE_RPR_CHECK_DB', 16); /** - * @removed 7.4 */ define('IBASE_RPR_IGNORE_CHECKSUM', 32); /** - * @removed 7.4 */ define('IBASE_RPR_KILL_SHADOWS', 64); /** - * @removed 7.4 */ define('IBASE_RPR_MEND_DB', 4); /** - * @removed 7.4 */ define('IBASE_RPR_VALIDATE_DB', 1); /** - * @removed 7.4 */ define('IBASE_RPR_FULL', 128); /** * Options to ibase_maintain_db * @link https://php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_RPR_SWEEP_DB', 2); /** - * @removed 7.4 */ define('IBASE_STS_DATA_PAGES', 1); /** - * @removed 7.4 */ define('IBASE_STS_DB_LOG', 2); /** - * @removed 7.4 */ define('IBASE_STS_HDR_PAGES', 4); /** - * @removed 7.4 */ define('IBASE_STS_IDX_PAGES', 8); /** * Options to ibase_db_info * @link https://php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_STS_SYS_RELATIONS', 16); /** - * @removed 7.4 */ define('IBASE_SVC_SERVER_VERSION', 55); /** - * @removed 7.4 */ define('IBASE_SVC_IMPLEMENTATION', 56); /** - * @removed 7.4 */ define('IBASE_SVC_GET_ENV', 59); /** - * @removed 7.4 */ define('IBASE_SVC_GET_ENV_LOCK', 60); /** - * @removed 7.4 */ define('IBASE_SVC_GET_ENV_MSG', 61); /** - * @removed 7.4 */ define('IBASE_SVC_USER_DBPATH', 58); /** - * @removed 7.4 */ define('IBASE_SVC_SVR_DB_INFO', 50); /** * Options to ibase_server_info * @link https://php.net/manual/en/ibase.constants.php - * @removed 7.4 */ define('IBASE_SVC_GET_USERS', 68); From 5ad51750dcb905094a169c100e81bfad68b723f0 Mon Sep 17 00:00:00 2001 From: Martins Lazdans Date: Sat, 14 Jan 2023 21:58:45 +0200 Subject: [PATCH 255/419] Move interbase from EXTERNAL to PECL section --- tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php index bbddad73a..fce27e505 100644 --- a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php +++ b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php @@ -61,7 +61,6 @@ class PhpCoreStubsProvider 'gettext', 'gmp', 'imap', - 'interbase', 'ldap', 'libxml', 'mcrypt', @@ -110,6 +109,7 @@ class PhpCoreStubsProvider 'ibm_db2', 'imagick', 'inotify', + 'interbase', 'leveldb', 'libevent', 'LuaSandbox', From 987ea97fe09a95c7b6c4a69cb53ea4befd879d89 Mon Sep 17 00:00:00 2001 From: Martins Lazdans Date: Sun, 15 Jan 2023 08:55:46 +0200 Subject: [PATCH 256/419] Remove empty comments --- interbase/interbase.php | 92 ----------------------------------------- 1 file changed, 92 deletions(-) diff --git a/interbase/interbase.php b/interbase/interbase.php index 626c176d2..3dedfd831 100644 --- a/interbase/interbase.php +++ b/interbase/interbase.php @@ -1532,23 +1532,11 @@ function fbird_free_event_handler($event) {} * @link https://www.php.net/manual/en/ibase.constants.php */ define('IBASE_WAIT', 128); -/** - */ define('IBASE_BKP_IGNORE_CHECKSUMS', 1); -/** - */ define('IBASE_BKP_IGNORE_LIMBO', 2); -/** - */ define('IBASE_BKP_METADATA_ONLY', 4); -/** - */ define('IBASE_BKP_NO_GARBAGE_COLLECT', 8); -/** - */ define('IBASE_BKP_OLD_DESCRIPTIONS', 16); -/** - */ define('IBASE_BKP_NON_TRANSPORTABLE', 32); /** @@ -1556,23 +1544,11 @@ function fbird_free_event_handler($event) {} * @link https://php.net/manual/en/ibase.constants.php */ define('IBASE_BKP_CONVERT', 64); -/** - */ define('IBASE_RES_DEACTIVATE_IDX', 256); -/** - */ define('IBASE_RES_NO_SHADOW', 512); -/** - */ define('IBASE_RES_NO_VALIDITY', 1024); -/** - */ define('IBASE_RES_ONE_AT_A_TIME', 2048); -/** - */ define('IBASE_RES_REPLACE', 4096); -/** - */ define('IBASE_RES_CREATE', 8192); /** @@ -1580,74 +1556,28 @@ function fbird_free_event_handler($event) {} * @link https://php.net/manual/en/ibase.constants.php */ define('IBASE_RES_USE_ALL_SPACE', 16384); -/** - */ define('IBASE_PRP_PAGE_BUFFERS', 5); -/** - */ define('IBASE_PRP_SWEEP_INTERVAL', 6); -/** - */ define('IBASE_PRP_SHUTDOWN_DB', 7); -/** - */ define('IBASE_PRP_DENY_NEW_TRANSACTIONS', 10); -/** - */ define('IBASE_PRP_DENY_NEW_ATTACHMENTS', 9); -/** - */ define('IBASE_PRP_RESERVE_SPACE', 11); -/** - */ define('IBASE_PRP_RES_USE_FULL', 35); -/** - */ define('IBASE_PRP_RES', 36); -/** - */ define('IBASE_PRP_WRITE_MODE', 12); -/** - */ define('IBASE_PRP_WM_ASYNC', 37); -/** - */ define('IBASE_PRP_WM_SYNC', 38); -/** - */ define('IBASE_PRP_ACCESS_MODE', 13); -/** - */ define('IBASE_PRP_AM_READONLY', 39); -/** - */ define('IBASE_PRP_AM_READWRITE', 40); -/** - */ define('IBASE_PRP_SET_SQL_DIALECT', 14); -/** - */ define('IBASE_PRP_ACTIVATE', 256); -/** - */ define('IBASE_PRP_DB_ONLINE', 512); -/** - */ define('IBASE_RPR_CHECK_DB', 16); -/** - */ define('IBASE_RPR_IGNORE_CHECKSUM', 32); -/** - */ define('IBASE_RPR_KILL_SHADOWS', 64); -/** - */ define('IBASE_RPR_MEND_DB', 4); -/** - */ define('IBASE_RPR_VALIDATE_DB', 1); -/** - */ define('IBASE_RPR_FULL', 128); /** @@ -1655,17 +1585,9 @@ function fbird_free_event_handler($event) {} * @link https://php.net/manual/en/ibase.constants.php */ define('IBASE_RPR_SWEEP_DB', 2); -/** - */ define('IBASE_STS_DATA_PAGES', 1); -/** - */ define('IBASE_STS_DB_LOG', 2); -/** - */ define('IBASE_STS_HDR_PAGES', 4); -/** - */ define('IBASE_STS_IDX_PAGES', 8); /** @@ -1673,26 +1595,12 @@ function fbird_free_event_handler($event) {} * @link https://php.net/manual/en/ibase.constants.php */ define('IBASE_STS_SYS_RELATIONS', 16); -/** - */ define('IBASE_SVC_SERVER_VERSION', 55); -/** - */ define('IBASE_SVC_IMPLEMENTATION', 56); -/** - */ define('IBASE_SVC_GET_ENV', 59); -/** - */ define('IBASE_SVC_GET_ENV_LOCK', 60); -/** - */ define('IBASE_SVC_GET_ENV_MSG', 61); -/** - */ define('IBASE_SVC_USER_DBPATH', 58); -/** - */ define('IBASE_SVC_SVR_DB_INFO', 50); /** From 38df6dc93adb121b2ea9002eef8598a79648dcad Mon Sep 17 00:00:00 2001 From: Flexo013 Date: Mon, 16 Jan 2023 09:23:40 +0100 Subject: [PATCH 257/419] Include @throws tag for __soapCall --- soap/soap.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/soap/soap.php b/soap/soap.php index f51bf2f25..49550e00d 100644 --- a/soap/soap.php +++ b/soap/soap.php @@ -322,7 +322,12 @@ public function __call( *

*

* On error, if the SoapClient object was constructed with the exceptions - * option set to FALSE, a SoapFault object will be returned. + * option set to FALSE, a SoapFault object will be returned. If this + * option is not set, or is set to TRUE, then a SoapFault object will + * be thrown as an exception. + * @throws SoapFault A SoapFault exception will be thrown if an error occurs + * and the SoapClient was constructed with the exceptions option not set, or + * set to TRUE. * @since 5.0.1 */ #[TentativeType] From 3398d80d4a7bd1c6eef9ab3d600e00e879316a14 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 19 Jan 2023 00:04:55 +0100 Subject: [PATCH 258/419] [phpstorm-stubs] set usleep param as int<0,max> --- standard/standard_0.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_0.php b/standard/standard_0.php index 981013727..62c05f4cb 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -189,7 +189,7 @@ function sleep(int $seconds) {} /** * Delay execution in microseconds * @link https://php.net/manual/en/function.usleep.php - * @param int $microseconds

+ * @param int<0,max> $microseconds

* Halt time in micro seconds. A micro second is one millionth of a * second. *

From 89f6911ddcc89dd6497ab18f9dd7df81705fe992 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 19 Jan 2023 00:05:43 +0100 Subject: [PATCH 259/419] [phpstorm-stubs] templates for ArrayObject --- SPL/SPL.php | 32 ++++++++++++++++++-------------- tests/Model/PHPDocElement.php | 1 + 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index a37021679..4353bb7d4 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -1525,6 +1525,10 @@ public function getPostfix(): string {} /** * This class allows objects to work as arrays. * @link https://php.net/manual/en/class.arrayobject.php + * @template TKey + * @template TValue + * @template-implements IteratorAggregate + * @template-implements ArrayAccess */ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable { @@ -1541,9 +1545,9 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count /** * Construct a new array object * @link https://php.net/manual/en/arrayobject.construct.php - * @param array|object $array The input parameter accepts an array or an Object. + * @param array|object $array The input parameter accepts an array or an Object. * @param int $flags Flags to control the behaviour of the ArrayObject object. - * @param string $iteratorClass Specify the class that will be used for iteration of the ArrayObject object. ArrayIterator is the default class used. + * @param class-string $iteratorClass Specify the class that will be used for iteration of the ArrayObject object. ArrayIterator is the default class used. */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'object|array'], default: '')] $array = [], @@ -1554,7 +1558,7 @@ public function __construct( /** * Returns whether the requested index exists * @link https://php.net/manual/en/arrayobject.offsetexists.php - * @param int|string $key

+ * @param TKey $key

* The index being checked. *

* @return bool true if the requested index exists, otherwise false @@ -1565,7 +1569,7 @@ public function offsetExists(#[LanguageLevelTypeAware(['8.0' => 'mixed'], defaul /** * Returns the value at the specified index * @link https://php.net/manual/en/arrayobject.offsetget.php - * @param int|string $key

+ * @param TKey $key

* The index with the value. *

* @return mixed|false The value at the specified index or false. @@ -1576,10 +1580,10 @@ public function offsetGet(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: /** * Sets the value at the specified index to newval * @link https://php.net/manual/en/arrayobject.offsetset.php - * @param int|string $key

+ * @param TKey $key

* The index being set. *

- * @param mixed $value

+ * @param TValue $value

* The new value for the index. *

* @return void @@ -1593,7 +1597,7 @@ public function offsetSet( /** * Unsets the value at the specified index * @link https://php.net/manual/en/arrayobject.offsetunset.php - * @param int|string $key

+ * @param TKey $key

* The index being unset. *

* @return void @@ -1604,7 +1608,7 @@ public function offsetUnset(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default /** * Appends the value * @link https://php.net/manual/en/arrayobject.append.php - * @param mixed $value

+ * @param TValue $value

* The value being appended. *

* @return void @@ -1615,7 +1619,7 @@ public function append(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '') /** * Creates a copy of the ArrayObject. * @link https://php.net/manual/en/arrayobject.getarraycopy.php - * @return array a copy of the array. When the ArrayObject refers to an object + * @return array a copy of the array. When the ArrayObject refers to an object * an array of the public properties of that object will be returned. */ #[TentativeType] @@ -1697,7 +1701,7 @@ public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = /** * Sort the entries with a user-defined comparison function and maintain key association * @link https://php.net/manual/en/arrayobject.uasort.php - * @param callable $callback

+ * @param callable(TValue, TValue):int $callback

* Function cmp_function should accept two * parameters which will be filled by pairs of entries. * The comparison function must return an integer less than, equal @@ -1713,7 +1717,7 @@ public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: /** * Sort the entries by keys using a user-defined comparison function * @link https://php.net/manual/en/arrayobject.uksort.php - * @param callable $callback

+ * @param callable(TValue, TValue):int $callback

* The callback comparison function. *

*

@@ -1788,7 +1792,7 @@ public function __unserialize(array $data): void {} /** * Create a new iterator from an ArrayObject instance * @link https://php.net/manual/en/arrayobject.getiterator.php - * @return ArrayIterator An iterator from an ArrayObject. + * @return ArrayIterator An iterator from an ArrayObject. */ #[TentativeType] public function getIterator(): Iterator {} @@ -1807,7 +1811,7 @@ public function exchangeArray(#[LanguageLevelTypeAware(['8.0' => 'object|array'] /** * Sets the iterator classname for the ArrayObject. * @link https://php.net/manual/en/arrayobject.setiteratorclass.php - * @param string $iteratorClass

+ * @param class-string $iteratorClass

* The classname of the array iterator to use when iterating over this object. *

* @return void @@ -1818,7 +1822,7 @@ public function setIteratorClass(#[LanguageLevelTypeAware(['8.0' => 'string'], d /** * Gets the iterator classname for the ArrayObject. * @link https://php.net/manual/en/arrayobject.getiteratorclass.php - * @return string the iterator class name that is used to iterate over this object. + * @return class-string the iterator class name that is used to iterate over this object. */ #[TentativeType] public function getIteratorClass(): string {} diff --git a/tests/Model/PHPDocElement.php b/tests/Model/PHPDocElement.php index 336772a82..302a9248d 100644 --- a/tests/Model/PHPDocElement.php +++ b/tests/Model/PHPDocElement.php @@ -84,6 +84,7 @@ protected function collectTags(Node $node) try { $text = $node->getDocComment()->getText(); $text = preg_replace("/int\<\w+,\s*\w+\>/", "int", $text); + $text = preg_replace("/callable\(\w+,\s*\w+\):\s*\w+/", "callable", $text); $this->phpdoc = $text; $phpDoc = DocFactoryProvider::getDocFactory()->create($text); $tags = $phpDoc->getTags(); From 2be5ae90684868912ddf4e917b26b33bc9e92eb9 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 19 Jan 2023 21:55:53 +0100 Subject: [PATCH 260/419] [phpstorm-stubs] templates for Ds --- ds/ds.php | 453 +++++++++++++++++++--------------- tests/Model/PHPDocElement.php | 2 +- tests/StubsPhpDocTest.php | 3 +- 3 files changed, 259 insertions(+), 199 deletions(-) diff --git a/ds/ds.php b/ds/ds.php index 8272ef5ad..e37753d5c 100644 --- a/ds/ds.php +++ b/ds/ds.php @@ -24,6 +24,10 @@ * are traversable, countable, and can be converted to json using * json_encode(). * @package Ds + * + * @template-covariant TKey + * @template-covariant TValue + * @extends IteratorAggregate */ interface Collection extends Countable, IteratorAggregate, JsonSerializable { @@ -36,7 +40,7 @@ public function clear(): void; /** * Returns a shallow copy of the collection. * @link https://www.php.net/manual/en/ds-collection.copy.php - * @return Collection + * @return Collection */ public function copy(); @@ -51,7 +55,7 @@ public function isEmpty(): bool; * Converts the collection to an array. *

Note: Casting to an array is not supported yet.

* @link https://www.php.net/manual/en/ds-collection.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the collection. */ public function toArray(): array; @@ -140,6 +144,8 @@ public function hash(); *
  • A more efficient alternative to SplDoublyLinkedList and SplFixedArray.
  • * * @package Ds + * @template TValue + * @extends Collection */ interface Sequence extends Collection { @@ -157,7 +163,7 @@ public function allocate(int $capacity): void; /** * Updates all values by applying a callback function to each value in * the sequence. - * @param callable $callback A callable to apply to each value in the + * @param callable(TValue): TValue $callback A callable to apply to each value in the * sequence. The callback should return what the value should be * replaced by. * callback ( mixed $value ) : mixed @@ -174,7 +180,7 @@ public function capacity(): int; /** * Determines if the sequence contains all values. - * @param mixed $values Values to check. + * @param TValue ...$values Values to check. * @return bool FALSE if any of the provided values are not in the * sequence, TRUE otherwise. * @link https://www.php.net/manual/en/ds-sequence.contains.php @@ -184,12 +190,12 @@ public function contains(...$values): bool; /** * Creates a new sequence using a callable to determine which values * to include. - * @param null|callable $callback Optional callable which returns TRUE if the + * @param null|callable(TValue): bool $callback Optional callable which returns TRUE if the * value should be included, FALSE otherwise. If a callback is not * provided, only values which are TRUE (see converting to boolean) will * be included. * callback ( mixed $value ) : bool - * @return Sequence A new sequence containing all the values for which + * @return Sequence A new sequence containing all the values for which * either the callback returned TRUE, or all values that convert to * TRUE if a callback was not provided. * @link https://www.php.net/manual/en/ds-sequence.filter.php @@ -198,7 +204,7 @@ public function filter(?callable $callback = null); /** * Returns the index of the value, or FALSE if not found. - * @param mixed $value The value to find. + * @param TValue $value The value to find. * @return int|false The index of the value, or FALSE if not found. * @link https://www.php.net/manual/en/ds-sequence.find.php */ @@ -206,7 +212,7 @@ public function find($value); /** * Returns the first value in the sequence. - * @return mixed The first value in the sequence. + * @return TValue The first value in the sequence. * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-sequence.first.php */ @@ -215,7 +221,7 @@ public function first(); /** * Returns the value at a given index. * @param int $index The index to access, starting at 0. - * @return mixed The value at the requested index. + * @return TValue The value at the requested index. * @throws OutOfRangeException if the index is not valid. * @link https://www.php.net/manual/en/ds-sequence.get.php */ @@ -226,7 +232,7 @@ public function get(int $index); * * @param int $index The index at which to insert. 0 <= index <= count *

    Note: You can insert at the index equal to the number of values.

    - * @param mixed ...$values The value or values to insert. + * @param TValue ...$values The value or values to insert. * @throws OutOfRangeException if the index is not valid. * @link https://www.php.net/manual/en/ds-sequence.insert.php */ @@ -244,7 +250,7 @@ public function join(string $glue = ''): string; /** * Returns the last value in the sequence. - * @return mixed The last value in the sequence. + * @return TValue The last value in the sequence. * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-sequence.last.php */ @@ -253,31 +259,33 @@ public function last(); /** * Returns the result of applying a callback function to each value in * the sequence. - * @param callable $callback A callable to apply to each value in the + * @template TNewValue + * @param callable(TValue): TNewValue $callback A callable to apply to each value in the * sequence. * The callable should return what the new value will be in the new * sequence. * callback ( mixed $value ) : mixed - * @return Sequence The result of applying a callback to each value in + * @return Sequence The result of applying a callback to each value in * the sequence.

    Note: The values of the current instance won't be * affected.

    * @link https://www.php.net/manual/en/ds-sequence.map.php */ - public function map(callable $callback); + public function map(callable $callback): Sequence; /** * Returns the result of adding all given values to the sequence. - * @param iterable $values A traversable object or an array. - * @return Sequence The result of adding all given values to the + * @template TValue2 + * @param iterable $values A traversable object or an array. + * @return Sequence The result of adding all given values to the * sequence, effectively the same as adding the values to a copy, * then returning that copy. * @link https://www.php.net/manual/en/ds-sequence.merge.php */ - public function merge($values); + public function merge($values): Sequence; /** * Removes and returns the last value. - * @return mixed The removed last value. + * @return TValue The removed last value. * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-sequence.pop.php */ @@ -285,21 +293,22 @@ public function pop(); /** * Adds values to the end of the sequence. - * @param mixed ...$values The values to add. + * @param TValue ...$values The values to add. */ public function push(...$values): void; /** * Reduces the sequence to a single value using a callback function. - * @param callable $callback

    + * @template TCarry + * @param callable(TCarry, TValue): TCarry $callback

    * * callback ( mixed $carry , mixed $value ) : mixed * $carry The return value of the previous callback, or initial if it's * the first iteration.
    * $value The value of the current iteration. *

    - * @param mixed $initial The initial value of the carry value. Can be NULL. - * @return mixed The return value of the final callback. + * @param TCarry $initial The initial value of the carry value. Can be NULL. + * @return TCarry The return value of the final callback. * @link https://www.php.net/manual/en/ds-sequence.reduce.php */ public function reduce(callable $callback, $initial = null); @@ -307,7 +316,7 @@ public function reduce(callable $callback, $initial = null); /** * Removes and returns a value by index. * @param int $index The index of the value to remove. - * @return mixed The value that was removed. + * @return TValue The value that was removed. * @link https://www.php.net/manual/en/ds-sequence.remove.php */ public function remove(int $index); @@ -320,7 +329,7 @@ public function reverse(): void; /** * Returns a reversed copy of the sequence. - * @return Sequence A reversed copy of the sequence. + * @return Sequence A reversed copy of the sequence. *

    Note: The current instance is not affected.

    */ public function reversed(); @@ -339,7 +348,7 @@ public function rotate(int $rotations): void; /** * Updates a value at a given index. * @param int $index The index of the value to update. - * @param mixed $value The new value. + * @param TValue $value The new value. * @throws OutOfRangeException if the index is not valid. * @link https://www.php.net/manual/en/ds-sequence.set.php */ @@ -347,7 +356,7 @@ public function set(int $index, $value): void; /** * Removes and returns the first value. - * @return mixed + * @return TValue * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-sequence.shift.php */ @@ -365,14 +374,14 @@ public function shift(); * the sequence will stop that many values from the end. If a length * is not provided, the resulting sequence will contain all values * between the index and the end of the sequence. - * @return Sequence A sub-sequence of the given range. + * @return Sequence A sub-sequence of the given range. * @link https://www.php.net/manual/en/ds-sequence.slice.php */ public function slice(int $index, int $length = null); /** * Sorts the sequence in-place, using an optional comparator function. - * @param callable|null $comparator The comparison function must return + * @param callable(TValue, TValue): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -389,7 +398,7 @@ public function sort(?callable $comparator = null): void; /** * Returns a sorted copy, using an optional comparator function. - * @param callable|null $comparator The comparison function must return + * @param callable(TValue, TValue): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -400,7 +409,7 @@ public function sort(?callable $comparator = null): void; * of the callback's return value. So values such as 0.99 and 0.1 will * both be cast to an integer value of 0, which will compare such * values as equal.

    - * @return Sequence Returns a sorted copy of the sequence. + * @return Sequence Returns a sorted copy of the sequence. * @link https://www.php.net/manual/en/ds-sequence.sort.php */ public function sorted(?callable $comparator = null); @@ -417,11 +426,11 @@ public function sum(): float|int; /** * Adds values to the front of the sequence, moving all the current * values forward to make room for the new values. - * @param mixed $values The values to add to the front of the sequence. + * @param TValue ...$values The values to add to the front of the sequence. *

    Note: Multiple values will be added in the same order that they * are passed.

    */ - public function unshift($values): void; + public function unshift(...$values): void; } /** @@ -448,6 +457,8 @@ public function unshift($values): void; * @link https://www.php.net/manual/en/class.ds-vector.php * * @package Ds + * @template TValue + * @implements Sequence */ class Vector implements Sequence { @@ -456,7 +467,7 @@ class Vector implements Sequence /** * Creates a new instance, using either a traversable object or an array for the initial values. * - * @param iterable $values + * @param array $values */ public function __construct($values = []) {} @@ -474,7 +485,7 @@ public function allocate(int $capacity): void {} /** * Updates all values by applying a callback function to each value in * the vector. - * @param callable $callback + * @param callable(TValue): TValue $callback * callback ( mixed $value ) : mixed * A callable to apply to each value in the vector. The callback should * return what the value should be replaced by. @@ -497,7 +508,7 @@ public function clear(): void {} /** * Determines if the vector contains all values. - * @param mixed ...$values Values to check. + * @param TValue ...$values Values to check. * @return bool FALSE if any of the provided values are not in the * vector, TRUE otherwise. * @link https://www.php.net/manual/en/ds-vector.contains.php @@ -506,7 +517,7 @@ public function contains(...$values): bool {} /** *Returns a shallow copy of the vector. - * @return Vector Returns a shallow copy of the vector. + * @return Vector Returns a shallow copy of the vector. */ public function copy(): Vector {} @@ -514,12 +525,12 @@ public function copy(): Vector {} * Creates a new vector using a callable to determine which values to * include. * - * @param null|callable $callback + * @param null|callable(TValue): bool $callback * Optional callable which returns TRUE if the value should be included, * FALSE otherwise. If a callback is not provided, only values which are * TRUE (see converting to boolean) will be included. * callback ( mixed $value ) : bool - * @return Vector A new vector containing all the values for which + * @return Vector A new vector containing all the values for which * either the callback returned TRUE, or all values that convert to * TRUE if a callback was not provided. * @link https://www.php.net/manual/en/ds-vector.filter.php @@ -528,8 +539,8 @@ public function filter(?callable $callback = null): Vector {} /** * Returns the index of the value, or FALSE if not found. - * @param mixed $value The value to find. - * @return mixed|false The index of the value, or FALSE if not found. + * @param TValue $value The value to find. + * @return int|false The index of the value, or FALSE if not found. *

    Note: Values will be compared by value and by type.

    * @link https://www.php.net/manual/en/ds-vector.find.php */ @@ -537,7 +548,7 @@ public function find($value) {} /** * Returns the first value in the vector. - * @return mixed + * @return TValue * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-vector.first.php */ @@ -546,7 +557,7 @@ public function first() {} /** * Returns the value at a given index. * @param int $index The index to access, starting at 0. - * @return mixed + * @return TValue * @link https://www.php.net/manual/en/ds-vector.get.php */ public function get(int $index) {} @@ -559,7 +570,7 @@ public function getIterator(): Traversable {} * @param int $index The index at which to insert. 0 <= index <= count * Note:
    * You can insert at the index equal to the number of values. - * @param array $values The value or values to insert. + * @param array ...$values The value or values to insert. * @link https://www.php.net/manual/en/ds-vector.insert.php */ public function insert(int $index, ...$values): void {} @@ -576,7 +587,7 @@ public function join(?string $glue = null): string {} /** * Returns the last value in the sequence. * - * @return mixed The last value in the sequence. + * @return TValue The last value in the sequence. * @link https://www.php.net/manual/en/ds-vector.last.php */ public function last() {} @@ -584,10 +595,11 @@ public function last() {} /** * Returns the result of applying a callback function to each value in the sequence. * - * @param callable $callback A callable to apply to each value in the sequence. + * @template TNewValue + * @param callable(TValue): TNewValue $callback A callable to apply to each value in the sequence. *
    The callable should return what the new value will be in the new sequence. * - * @return Vector + * @return Vector * @link https://www.php.net/manual/en/ds-vector.map.php */ public function map(callable $callback): Vector {} @@ -595,8 +607,9 @@ public function map(callable $callback): Vector {} /** * Returns the result of adding all given values to the sequence. * - * @param Traversable|array $values A traversable object or an array. - * @return Vector The result of adding all given values to the sequence, effectively the same as adding the + * @template TValue2 + * @param iterable $values A traversable object or an array. + * @return Vector The result of adding all given values to the sequence, effectively the same as adding the * values to a copy, then returning that copy.
    * Note:
    * The current instance won't be affected. @@ -607,27 +620,28 @@ public function merge($values): Vector {} /** * Removes and returns the last value. * - * @return mixed + * @return TValue * @link https://www.php.net/manual/en/ds-vector.pop.php */ public function pop() {} /** * Adds values to the end of the sequence. - * @param array $values + * @param TValue ...$values * @link https://www.php.net/manual/en/ds-vector.push.php */ public function push(...$values): void {} /** * Reduces the sequence to a single value using a callback function. - * @param callable $callback
    + * @template TCarry + * @param callable(TCarry, TValue): TCarry $callback
    * callback ( mixed $carry , mixed $value ) : mixed
    * carry The return value of the previous callback, or initial if it's the first iteration.
    * value The value of the current iteration. - * @param mixed $initial The initial value of the carry value. Can be NULL. + * @param TCarry $initial The initial value of the carry value. Can be NULL. * - * @return mixed|void The return value of the final callback. + * @return TCarry The return value of the final callback. * * @link https://www.php.net/manual/en/ds-vector.reduce.php */ @@ -636,7 +650,7 @@ public function reduce(callable $callback, $initial = null) {} /** * Removes and returns a value by index. * @param int $index The index of the value to remove. - * @return mixed The value that was removed. + * @return TValue The value that was removed. * @link https://www.php.net/manual/en/ds-vector.remove.php */ public function remove(int $index) {} @@ -649,7 +663,7 @@ public function reverse(): void {} /** * Returns a reversed copy of the sequence. - * @return Vector A reversed copy of the sequence.
    + * @return Vector A reversed copy of the sequence.
    * Note: The current instance is not affected. * @link https://www.php.net/manual/en/ds-vector.reversed.php */ @@ -673,7 +687,7 @@ public function rotate(int $rotations): void {} * @link https://www.php.net/manual/en/ds-vector.set.php * * @param int $index The index of the value to update. - * @param mixed $value The new value. + * @param TValue $value The new value. * * @throws OutOfRangeException if the index is not valid. */ @@ -684,7 +698,7 @@ public function set(int $index, $value): void {} * * @link https://www.php.net/manual/en/ds-vector.shift.php * - * @return mixed The first value, which was removed. + * @return TValue The first value, which was removed. * @throws UnderflowException if empty. */ public function shift() {} @@ -703,14 +717,14 @@ public function shift() {} * the sequence will stop that many values from the end. If a length * is not provided, the resulting sequence will contain all values * between the index and the end of the sequence. - * @return Vector + * @return Vector */ public function slice(int $index, int $length = null): Vector {} /** * Sorts the sequence in-place, using an optional comparator function. * @link https://www.php.net/manual/en/ds-vector.sort.php - * @param callable|null $comparator The comparison function must return an + * @param callable(TValue, TValue): int|null $comparator The comparison function must return an * integer less than, equal to, or greater * than zero if the first argument is considered to be respectively less than, equal to, or greater than the * second. Note that before PHP 7.0.0 this integer had to be in the @@ -727,7 +741,7 @@ public function sort(?callable $comparator = null): void {} /** * Returns a sorted copy, using an optional comparator function. * @link https://www.php.net/manual/en/ds-vector.sorted.php - * @param callable|null $comparator The comparison function must return an integer less than, equal to, or + * @param callable(TValue, TValue): int|null $comparator The comparison function must return an integer less than, equal to, or * greater than zero if the first argument is considered to be respectively less than, equal to, or greater * than the second. Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to * 2147483647.
    @@ -735,7 +749,7 @@ public function sort(?callable $comparator = null): void {} * Caution: Returning non-integer values from the comparison function, such as float, will result in an * internal cast to integer of the callback's return value. So values such as 0.99 and 0.1 will both be cast to * an integer value of 0, which will compare such values as equal. - * @return Vector Returns a sorted copy of the sequence. + * @return Vector Returns a sorted copy of the sequence. */ public function sorted(?callable $comparator = null): Vector {} @@ -751,7 +765,7 @@ public function sum(): float {} /** * Adds values to the front of the sequence, moving all the current * values forward to make room for the new values. - * @param mixed $values The values to add to the front of the sequence.
    + * @param TValue ...$values The values to add to the front of the sequence.
    * Note: Multiple values will be added in the same order that they are * passed. * @link https://www.php.net/manual/en/ds-vector.unshift.php @@ -780,7 +794,7 @@ public function isEmpty(): bool {} * Converts the collection to an array. *

    Note: Casting to an array is not supported yet.

    * @link https://www.php.net/manual/en/ds-vector.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the collection. */ public function toArray(): array {} @@ -795,11 +809,15 @@ public function toArray(): array {} public function jsonSerialize() {} } + /** + * @template TValue + * @implements Sequence + */ class Deque implements Sequence { /** * Creates a new instance, using either a traversable object or an array for the initial values. - * @param mixed ...$values A traversable object or an array to use for the initial values. + * @param TValue ...$values A traversable object or an array to use for the initial values. * * @link https://www.php.net/manual/en/ds-deque.construct.php */ @@ -825,7 +843,7 @@ public function clear(): void {} /** * Returns a shallow copy of the deque. * @link https://www.php.net/manual/en/ds-deque.copy.php - * @return Collection + * @return Deque */ public function copy(): Collection {} @@ -842,7 +860,7 @@ public function isEmpty(): bool {} * Converts the deque to an array. *

    Note: Casting to an array is not supported yet.

    * @link https://www.php.net/manual/en/ds-deque.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the deque. */ public function toArray(): array {} @@ -862,7 +880,7 @@ public function allocate(int $capacity): void {} /** * Updates all values by applying a callback function to each value in * the deque. - * @param callable $callback A callable to apply to each value in the + * @param callable(TValue): TValue $callback A callable to apply to each value in the * deque. The callback should return what the value should be * replaced by.

    * callback ( mixed $value ) : mixed @@ -880,7 +898,7 @@ public function capacity(): int {} /** * Determines if the deque contains all values. - * @param mixed $values Values to check. + * @param TValue $values Values to check. * @return bool FALSE if any of the provided values are not in the * deque, TRUE otherwise. * @link https://www.php.net/manual/en/ds-deque.contains.php @@ -890,13 +908,13 @@ public function contains(...$values): bool {} /** * Creates a new deque using a callable to determine which values * to include. - * @param null|callable $callback Optional callable which returns TRUE if the + * @param null|callable(TValue): bool $callback Optional callable which returns TRUE if the * value should be included, FALSE otherwise. If a callback is not * provided, only values which are TRUE (see converting to boolean) will * be included.

    * callback ( mixed $value ) : bool *

    - * @return Deque A new deque containing all the values for which + * @return Deque A new deque containing all the values for which * either the callback returned TRUE, or all values that convert to * TRUE if a callback was not provided. * @link https://www.php.net/manual/en/ds-deque.filter.php @@ -905,7 +923,7 @@ public function filter(?callable $callback = null): Deque {} /** * Returns the index of the value, or FALSE if not found. - * @param mixed $value The value to find. + * @param TValue $value The value to find. * @return int|false The index of the value, or FALSE if not found. * @link https://www.php.net/manual/en/ds-deque.find.php */ @@ -913,7 +931,7 @@ public function find($value) {} /** * Returns the first value in the deque. - * @return mixed The first value in the deque. + * @return TValue The first value in the deque. * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-deque.first.php */ @@ -922,7 +940,7 @@ public function first() {} /** * Returns the value at a given index. * @param int $index The index to access, starting at 0. - * @return mixed The value at the requested index. + * @return TValue The value at the requested index. * @throws OutOfRangeException if the index is not valid. * @link https://www.php.net/manual/en/ds-deque.get.php */ @@ -933,7 +951,7 @@ public function get(int $index) {} * * @param int $index The index at which to insert. 0 <= index <= count *

    Note: You can insert at the index equal to the number of values.

    - * @param mixed ...$values The value or values to insert. + * @param TValue ...$values The value or values to insert. * @throws OutOfRangeException if the index is not valid. * @link https://www.php.net/manual/en/ds-deque.insert.php */ @@ -951,7 +969,7 @@ public function join(string $glue = ''): string {} /** * Returns the last value in the deque. - * @return mixed The last value in the deque. + * @return TValue The last value in the deque. * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-deque.last.php */ @@ -961,13 +979,14 @@ public function last() {} * Returns the result of applying a callback function to each value in * the deque. * - * @param callable $callback A callable to apply to each value in the + * @template TNewValue + * @param callable(TValue): TNewValue $callback A callable to apply to each value in the * deque. * The callable should return what the new value will be in the new * deque. * callback ( mixed $value ) : mixed * - * @return Deque The result of applying a callback to each value in + * @return Deque The result of applying a callback to each value in * the deque. *

    Note: The values of the current instance won't be * affected.

    @@ -977,8 +996,9 @@ public function map(callable $callback): Deque {} /** * Returns the result of adding all given values to the deque. - * @param iterable $values A traversable object or an array. - * @return Deque The result of adding all given values to the + * @template TValue2 + * @param iterable $values A traversable object or an array. + * @return Deque The result of adding all given values to the * deque, effectively the same as adding the values to a copy, * then returning that copy. * @link https://www.php.net/manual/en/ds-deque.merge.php @@ -987,7 +1007,7 @@ public function merge($values): Deque {} /** * Removes and returns the last value. - * @return mixed The removed last value. + * @return TValue The removed last value. * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-deque.pop.php */ @@ -995,20 +1015,21 @@ public function pop() {} /** * Adds values to the end of the deque. - * @param mixed ...$values The values to add. + * @param TValue ...$values The values to add. */ public function push(...$values): void {} /** * Reduces the deque to a single value using a callback function. - * @param callable $callback + * @template TCarry + * @param callable(TCarry, TValue): TCarry $callback * callback ( mixed $carry , mixed $value ) : mixed * $carry The return value of the previous callback, or initial if it's * the first iteration.

    * $value The value of the current iteration. *

    - * @param mixed $initial The initial value of the carry value. Can be NULL. - * @return mixed The return value of the final callback. + * @param TCarry $initial The initial value of the carry value. Can be NULL. + * @return TCarry The return value of the final callback. * @link https://www.php.net/manual/en/ds-deque.reduce.php */ public function reduce(callable $callback, $initial = null) {} @@ -1016,7 +1037,7 @@ public function reduce(callable $callback, $initial = null) {} /** * Removes and returns a value by index. * @param int $index The index of the value to remove. - * @return mixed The value that was removed. + * @return TValue The value that was removed. * @link https://www.php.net/manual/en/ds-deque.remove.php */ public function remove(int $index) {} @@ -1029,7 +1050,7 @@ public function reverse(): void {} /** * Returns a reversed copy of the deque. - * @return Deque A reversed copy of the deque. + * @return Deque A reversed copy of the deque. *

    Note: The current instance is not affected.

    */ public function reversed(): Deque {} @@ -1048,7 +1069,7 @@ public function rotate(int $rotations): void {} /** * Updates a value at a given index. * @param int $index The index of the value to update. - * @param mixed $value The new value. + * @param TValue $value The new value. * @throws OutOfRangeException if the index is not valid. * @link https://www.php.net/manual/en/ds-deque.set.php */ @@ -1056,7 +1077,7 @@ public function set(int $index, $value): void {} /** * Removes and returns the first value. - * @return mixed + * @return TValue * @throws UnderflowException if empty. * @link https://www.php.net/manual/en/ds-deque.shift.php */ @@ -1074,14 +1095,14 @@ public function shift() {} * the deque will stop that many values from the end. If a length * is not provided, the resulting deque will contain all values * between the index and the end of the deque. - * @return Deque A sub-deque of the given range. + * @return Deque A sub-deque of the given range. * @link https://www.php.net/manual/en/ds-deque.slice.php */ public function slice(int $index, int $length = null): Deque {} /** * Sorts the deque in-place, using an optional comparator function. - * @param callable|null $comparator The comparison function must return + * @param callable(TValue, TValue): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -1098,7 +1119,7 @@ public function sort(?callable $comparator = null): void {} /** * Returns a sorted copy, using an optional comparator function. - * @param callable|null $comparator The comparison function must return + * @param callable(TValue, TValue): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -1109,7 +1130,7 @@ public function sort(?callable $comparator = null): void {} * of the callback's return value. So values such as 0.99 and 0.1 will * both be cast to an integer value of 0, which will compare such * values as equal.

    - * @return Deque Returns a sorted copy of the deque. + * @return Deque Returns a sorted copy of the deque. * @link https://www.php.net/manual/en/ds-deque.sort.php */ public function sorted(?callable $comparator = null): Deque {} @@ -1126,11 +1147,11 @@ public function sum(): float|int {} /** * Adds values to the front of the deque, moving all the current * values forward to make room for the new values. - * @param mixed $values The values to add to the front of the deque. + * @param TValue ...$values The values to add to the front of the deque. *

    Note: Multiple values will be added in the same order that they * are passed.

    */ - public function unshift($values): void {} + public function unshift(...$values): void {} /** * Specify data which should be serialized to JSON @@ -1142,11 +1163,16 @@ public function unshift($values): void {} public function jsonSerialize() {} } + /** + * @template TKey + * @template TValue + * @implements Collection + */ class Map implements Collection { /** * Creates a new instance, using either a traversable object or an array for the initial values. - * @param mixed ...$values A traversable object or an array to use for the initial values. + * @param iterable ...$values A traversable object or an array to use for the initial values. * * @link https://www.php.net/manual/en/ds-map.construct.php */ @@ -1166,7 +1192,7 @@ public function allocate(int $capacity) {} /** * Updates all values by applying a callback function to each value in the map. * - * @param callable $callback A callable to apply to each value in the map. The callback should return what + * @param callable(TKey, TValue): TValue $callback A callable to apply to each value in the map. The callback should return what * the value should be replaced by. * * @link https://www.php.net/manual/en/ds-map.apply.php @@ -1202,7 +1228,7 @@ public function clear(): void {} /** * Returns a shallow copy of the collection. * @link https://www.php.net/manual/en/ds-collection.copy.php - * @return Collection + * @return Map */ public function copy(): Collection {} @@ -1211,9 +1237,10 @@ public function copy(): Collection {} * * A \ B = {x ∈ A | x ∉ B} * - * @param Map $map The map containing the keys to exclude in the resulting map. + * @template TValue2 + * @param Map $map The map containing the keys to exclude in the resulting map. * - * @return Map The result of removing all keys from the current instance that are present in a given map. + * @return Map The result of removing all keys from the current instance that are present in a given map. * * @link https://www.php.net/manual/en/ds-map.diff.php */ @@ -1222,10 +1249,10 @@ public function diff(Map $map): Map {} /** * Creates a new map using a callable to determine which pairs to include * - * @param null|callable $callback Optional callable which returns TRUE if the pair should be included, FALSE + * @param null|callable(TKey, TValue): bool $callback Optional callable which returns TRUE if the pair should be included, FALSE * otherwise. If a callback is not provided, only values which are TRUE (see converting to boolean) will be included. * - * @return Map + * @return Map * * @link https://www.php.net/manual/en/ds-map.filter.php */ @@ -1234,7 +1261,7 @@ public function filter(?callable $callback = null): Map {} /** * Returns the first pair in the map * - * @return Pair The first pair in the map. + * @return Pair The first pair in the map. * * @throws UnderflowException if empty * @@ -1256,10 +1283,11 @@ public function first(): Pair {} * example, $map["1"] will attempt to access int(1), while $map->get("1") will correctly look up the string key. *

    * - * @param mixed $key The key to look up. - * @param mixed $default The optional default value, returned if the key could not be found. + * @template TDefault + * @param TKey $key The key to look up. + * @param TDefault $default The optional default value, returned if the key could not be found. * - * @return mixed The value mapped to the given key, or the default value if provided and the key could not be found in the map. + * @return TValue|TDefault The value mapped to the given key, or the default value if provided and the key could not be found in the map. * * @throws OutOfBoundsException if the key could not be found and a default value was not provided. * @@ -1272,7 +1300,7 @@ public function getIterator(): Traversable {} /** * Determines whether the map contains a given key * - * @param mixed $key The key to look for. + * @param TKey $key The key to look for. * * @return bool Returns TRUE if the key could found, FALSE otherwise. * @@ -1283,7 +1311,7 @@ public function hasKey($key): bool {} /** * Determines whether the map contains a given value * - * @param mixed $value The value to look for. + * @param TValue $value The value to look for. * * @return bool Returns TRUE if the value could found, FALSE otherwise. * @@ -1301,9 +1329,11 @@ public function hasValue($value): bool {} * *

    Note: Values from the current instance will be kept.

    * - * @param Map $map The other map, containing the keys to intersect with. + * @template TKey2 + * @template TValue2 + * @param Map $map The other map, containing the keys to intersect with. * - * @return Map The key intersection of the current instance and another map. + * @return Map The key intersection of the current instance and another map. * * @link https://www.php.net/manual/en/ds-map.intersect.php */ @@ -1332,7 +1362,7 @@ public function isEmpty(): bool {} *

    * * @link https://www.php.net/manual/en/ds-map.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the map. */ public function toArray(): array {} @@ -1349,13 +1379,13 @@ public function jsonSerialize() {} /** * Returns a set containing all the keys of the map, in the same order. * @link https://www.php.net/manual/en/ds-map.keys.php - * @return Set A Ds\Set containing all the keys of the map. + * @return Set A Ds\Set containing all the keys of the map. */ public function keys(): Set {} /** * Sorts the map in-place by key, using an optional comparator function. - * @param callable|null $comparator The comparison function must return + * @param callable(TKey, TKey):int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -1372,7 +1402,7 @@ public function ksort(?callable $comparator = null) {} /** * Returns a copy sorted by key, using an optional comparator function. - * @param callable|null $comparator The comparison function must return + * @param callable(TKey, TKey): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -1383,14 +1413,14 @@ public function ksort(?callable $comparator = null) {} * callback's return value. So values such as 0.99 and 0.1 will both be * cast to an integer value of 0, which will compare such values as * equal.

    - * @return Map Returns a copy of the map, sorted by key. + * @return Map Returns a copy of the map, sorted by key. * @link https://www.php.net/manual/en/ds-map.ksorted.php */ public function ksorted(?callable $comparator = null): Map {} /** * Returns the last pair of the map. - * @return Pair The last pair of the map. + * @return Pair The last pair of the map. * @throws UnderflowException if empty * @link https://www.php.net/manual/en/ds-map.last.php */ @@ -1399,11 +1429,12 @@ public function last(): Pair {} /** * Returns the result of applying a callback function to each value of * the map. - * @param callable $callback A callable to apply to each value in the + * @template TNewValue + * @param callable(TKey, TValue): TNewValue $callback A callable to apply to each value in the * map. The callable should return what the key will be mapped to in the * resulting map. * callback ( mixed $key , mixed $value ) : mixed - * @return Map The result of applying a callback to each value in the + * @return Map The result of applying a callback to each value in the * map. * * Note: The keys and values of the current instance won't be affected. @@ -1416,8 +1447,10 @@ public function map(callable $callback): Map {} * Returns the result of associating all keys of a given traversable * object or array with their corresponding values, combined with the * current instance. - * @param iterable $values A traversable object or an array. - * @return Map The result of associating all keys of a given traversable + * @template TKey2 + * @template TValue2 + * @param iterable $values A traversable object or an array. + * @return Map The result of associating all keys of a given traversable * object or array with their corresponding values, combined with the * current instance. * @@ -1430,7 +1463,7 @@ public function merge($values): Map {} /** * Returns a Ds\Sequence containing all the pairs of the map. * - * @return Sequence Ds\Sequence containing all the pairs of the map. + * @return Sequence> Ds\Sequence containing all the pairs of the map. * * @link https://www.php.net/manual/en/ds-map.pairs.php */ @@ -1439,8 +1472,8 @@ public function pairs(): Sequence {} /** * Associates a key with a value, overwriting a previous association if * one exists. - * @param mixed $key The key to associate the value with. - * @param mixed $value The value to be associated with the key. + * @param TKey $key The key to associate the value with. + * @param TValue $value The value to be associated with the key. * * Note: Keys of type object are supported. If an object implements * Ds\Hashable, equality will be determined by the object's equals @@ -1468,7 +1501,7 @@ public function put($key, $value) {} * Ds\Hashable, objects must be references to the same instance to be * considered equal. * - * @param iterable $pairs traversable object or array. + * @param iterable $pairs traversable object or array. * * @link https://www.php.net/manual/en/ds-map.putall.php */ @@ -1477,16 +1510,18 @@ public function putAll($pairs) {} /** * Reduces the map to a single value using a callback function. * - * @param callable $callback + * @template TCarry + * @param callable(TCarry, TKey, TValue): TCarry $callback * callback ( mixed $carry , mixed $key , mixed $value ) : mixed * carry The return value of the previous callback, or initial if * it's the first iteration. * key The key of the current iteration. * value The value of the current iteration. * - * @param mixed $initial The initial value of the carry value. Can be + * @param TCarry $initial The initial value of the carry value. Can be * NULL. * + * @return TCarry * @link https://www.php.net/manual/en/ds-map.reduce.php */ public function reduce(callable $callback, $initial) {} @@ -1495,8 +1530,9 @@ public function reduce(callable $callback, $initial) {} * Removes and returns a value by key, or return an optional default * value if the key could not be found. * - * @param mixed $key The key to remove. - * @param mixed $default The optional default value, returned if the key + * @template TDefault + * @param TKey $key The key to remove. + * @param TDefault $default The optional default value, returned if the key * could not be found. * * Note: Keys of type object are supported. If an object implements @@ -1513,7 +1549,7 @@ public function reduce(callable $callback, $initial) {} * attempt to access int(1), while $map->get("1") will correctly look up * the string key. * - * @return mixed The value that was removed, or the default value if + * @return TValue|TDefault The value that was removed, or the default value if * provided and the key could not be found in the map. * * @throws OutOfBoundsException if the key could not be found and a @@ -1533,7 +1569,7 @@ public function reverse() {} /** * Returns a reversed copy of the map. * - * @return Map A reversed copy of the map. + * @return Map A reversed copy of the map. * *

    Note: The current instance is not affected.

    * @@ -1546,7 +1582,7 @@ public function reversed(): Map {} * * @param int $position The zero-based positional index to return. * - * @return Pair Returns the Ds\Pair at the given position. + * @return Pair Returns the Ds\Pair at the given position. * * @throws OutOfRangeException if the position is not valid. * @@ -1569,7 +1605,7 @@ public function skip(int $position): Pair {} * resulting map will contain all pairs between the index and the end of * the map. * - * @return Map A subset of the map defined by a starting index and + * @return Map A subset of the map defined by a starting index and * length. * * @link https://www.php.net/manual/en/ds-map.slice.php @@ -1580,7 +1616,7 @@ public function slice(int $index, ?int $length = null): Map {} * Sorts the map in-place by value, using an optional comparator * function. * - * @param callable|null $comparator The comparison function must return + * @param callable(TValue, TValue): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -1601,7 +1637,7 @@ public function sort(?callable $comparator = null) {} /** * Returns a copy, sorted by value using an optional comparator function. * - * @param callable|null $comparator The comparison function must return + * @param callable(TValue, TValue): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -1615,7 +1651,7 @@ public function sort(?callable $comparator = null) {} * cast to an integer value of 0, which will compare such values as * equal. * - * @return Map + * @return Map * * @link https://www.php.net/manual/en/ds-map.sorted.php */ @@ -1643,9 +1679,11 @@ public function sum(): float|int {} *

    Note: Values of the current instance will be overwritten by those * provided where keys are equal.

    * - * @param Map $map The other map, to combine with the current instance. + * @template TKey2 + * @template TValue2 + * @param Map $map The other map, to combine with the current instance. * - * @return Map A new map containing all the pairs of the current + * @return Map A new map containing all the pairs of the current * instance as well as another map. * * @link https://www.php.net/manual/en/ds-map.union.php @@ -1656,7 +1694,7 @@ public function union(Map $map): Map {} * Returns a sequence containing all the values of the map, in the same * order. * - * @return Sequence A Ds\Sequence containing all the values of the map. + * @return Sequence A Ds\Sequence containing all the values of the map. * * @link https://www.php.net/manual/en/ds-map.values.php */ @@ -1668,9 +1706,11 @@ public function values(): Sequence {} * * A ⊖ B = {x : x ∈ (A \ B) ∪ (B \ A)} * - * @param Map $map The other map. + * @template TKey2 + * @template TValue2 + * @param Map $map The other map. * - * @return Map A new map containing keys in the current instance as well + * @return Map A new map containing keys in the current instance as well * as another map, but not in both. * * @link https://www.php.net/manual/en/ds-map.xor.php @@ -1681,24 +1721,26 @@ public function xor(Map $map): Map {} /** * A pair is used by Ds\Map to pair keys with values. * @package Ds + * @template-covariant TKey + * @template-covariant TValue */ class Pair implements JsonSerializable { /** - * @var mixed + * @var TKey */ public $key; /** - * @var mixed + * @var TValue */ public $value; /** * Creates a new instance using a given key and value. * - * @param mixed $key - * @param mixed $value + * @param TKey $key + * @param TValue $value * * @link https://php.net/manual/en/ds-pair.construct.php */ @@ -1714,7 +1756,7 @@ public function clear() {} /** * Returns a shallow copy of the pair. * - * @return Pair Returns a shallow copy of the pair. + * @return Pair Returns a shallow copy of the pair. * * @link https://php.net/manual/en/ds-pair.copy.php */ @@ -1734,7 +1776,7 @@ public function isEmpty(): bool {} * *

    Note: Casting to an array is not supported yet.

    * - * @return array An array containing all the values in the same order as + * @return array{key: TKey, value: TValue} An array containing all the values in the same order as * the pair. * * @link https://php.net/manual/en/ds-pair.toarray.php @@ -1758,6 +1800,8 @@ public function jsonSerialize() {} * @link https://www.php.net/manual/en/class.ds-set.php * * @package Ds + * @template TValue + * @implements Collection */ class Set implements Collection { @@ -1765,7 +1809,7 @@ class Set implements Collection * Creates a new instance, using either a traversable object or an array * for the initial values. * - * @param iterable $values A traversable object of an array to + * @param iterable $values A traversable object of an array to * use the initial values. * * @link https://php.net/manual/en/ds-set.construct.php @@ -1782,7 +1826,7 @@ public function __construct(iterable $values = []) {} * *

    Caution: All comparisons are strict (type and value). * - * @param mixed ...$values Values to add to the set. + * @param TValue ...$values Values to add to the set. * * @link https://php.net/manual/en/ds-set.add.php */ @@ -1813,7 +1857,7 @@ public function allocate(int $capacity) {} * *

    Caution: All comparisons are strict (type and value). * - * @param mixed ...$values Values to check. + * @param TValue ...$values Values to check. * * @return bool * @@ -1849,7 +1893,7 @@ public function count(): int {} /** * Returns a shallow copy of the set. * @link https://www.php.net/manual/en/ds-set.copy.php - * @return Set + * @return Set */ public function copy(): Set {} @@ -1860,9 +1904,10 @@ public function copy(): Set {} * * @link https://www.php.net/manual/en/ds-set.diff.php * - * @param Set $set Set containing the values to exclude. + * @template TValue2 + * @param Set $set Set containing the values to exclude. * - * @return Set A new set containing all values that were not in the + * @return Set A new set containing all values that were not in the * other set. */ public function diff(Set $set): Set {} @@ -1873,12 +1918,12 @@ public function diff(Set $set): Set {} * * @link https://www.php.net/manual/en/ds-set.filter.php * - * @param null|callable $callback Optional callable which returns TRUE if the + * @param null|callable(TValue): bool $callback Optional callable which returns TRUE if the * value should be included, FALSE otherwise. * If a callback is not provided, only values which are TRUE (see * converting to boolean) will be included. * - * @return Set A new set containing all the values for which either the + * @return Set A new set containing all the values for which either the * callback returned TRUE, or all values that convert to TRUE if a * callback was not provided. */ @@ -1889,7 +1934,7 @@ public function filter(?callable $callback = null): Set {} * * @link https://www.php.net/manual/en/ds-set.first.php * - * @return mixed The first value in the set. + * @return TValue The first value in the set. */ public function first() {} @@ -1900,7 +1945,7 @@ public function first() {} * * @param int $index The index to access, starting at 0. * - * @return mixed The value at the requested index. + * @return TValue The value at the requested index. */ public function get(int $index) {} @@ -1915,9 +1960,9 @@ public function getIterator(): Traversable {} * * @link https://www.php.net/manual/en/ds-set.intersect.php * - * @param Set $set The other set. - * - * @return Set The intersection of the current instance and another set. + * @template TValue2 + * @param Set $set The other set. + * @return Set The intersection of the current instance and another set. */ public function intersect(Set $set): Set {} @@ -1944,12 +1989,13 @@ public function join(?string $glue = null): string {} /** * Returns the result of applying a callback function to each value in * the set. - * @param callable $callback A callable to apply to each value in the + * @template TNewValue + * @param callable(TValue): TNewValue $callback A callable to apply to each value in the * set. * The callable should return what the new value will be in the new * set. * callback ( mixed $value ) : mixed - * @return Set The result of applying a callback to each value in + * @return Set The result of applying a callback to each value in * the set. *

    Note: The values of the current instance won't be affected.

    */ @@ -1962,9 +2008,10 @@ public function map(callable $callback): Set {} * * @link https://www.php.net/manual/en/ds-set.merge.php * - * @param iterable $values A traversable object or an array. + * @template TValue2 + * @param iterable $values A traversable object or an array. * - * @return Set The result of adding all given values to the set, + * @return Set The result of adding all given values to the set, * effectively the same as adding the values to a copy, then returning * that copy. */ @@ -1975,16 +2022,17 @@ public function merge($values): Set {} * * @link https://www.php.net/manual/en/ds-set.reduce.php * - * @param callable $callback + * @template TCarry + * @param callable(TCarry, TValue): TCarry $callback * callback ( mixed $carry , mixed $value ) : mixed * $carry The return value of the previous callback, or initial if * it's the first iteration. * $value The value of the current iteration. * - * @param mixed|null $initial The initial value of the carry value. Can be + * @param TCarry $initial The initial value of the carry value. Can be * NULL. * - * @return mixed The return value of the final callback. + * @return TCarry The return value of the final callback. */ public function reduce(callable $callback, $initial = null) {} @@ -1994,7 +2042,7 @@ public function reduce(callable $callback, $initial = null) {} * * @link https://www.php.net/manual/en/ds-set.remove.php * - * @param mixed ...$values The values to remove. + * @param TValue ...$values The values to remove. */ public function remove(...$values) {} @@ -2012,7 +2060,7 @@ public function reverse() {} * *

    Note: The current instance is not affected.

    * - * @return Set A reversed copy of the set. + * @return Set A reversed copy of the set. */ public function reversed(): Set {} @@ -2031,7 +2079,7 @@ public function reversed(): Set {} * resulting set will contain all values between the index and the end * of the set. * - * @return Set A sub-set of the given range. + * @return Set A sub-set of the given range. */ public function slice(int $index, ?int $length = null): Set {} @@ -2040,7 +2088,7 @@ public function slice(int $index, ?int $length = null): Set {} * * @link https://www.php.net/manual/en/ds-set.last.php * - * @return mixed The last value in the set. + * @return TValue The last value in the set. * * @throws UnderflowException if empty. */ @@ -2049,7 +2097,7 @@ public function last() {} /** * Sorts the set in-place, using an optional comparator function. * - * @param callable|null $comparator The comparison function must return + * @param callable(TValue, TValue): int|null $comparator The comparison function must return * an integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -2070,7 +2118,7 @@ public function sort(?callable $comparator = null) {} * * @link https://www.php.net/manual/en/ds-set.sorted.php * - * @param null|callable $comparator The comparison function must return an + * @param null|callable(TValue, TValue): int $comparator The comparison function must return an * integer less than, equal to, or greater than zero if the first * argument is considered to be respectively less than, equal to, or * greater than the second. Note that before PHP 7.0.0 this integer had @@ -2084,7 +2132,7 @@ public function sort(?callable $comparator = null) {} * such as 0.99 and 0.1 will both be cast to an integer value of 0, * which will compare such values as equal.

    * - * @return Set Returns a sorted copy of the set. + * @return Set Returns a sorted copy of the set. */ public function sorted(?callable $comparator = null): Set {} @@ -2109,9 +2157,10 @@ public function sum(): float|int {} * * @link https://www.php.net/manual/en/ds-set.union.php * - * @param Set $set The other set, to combine with the current instance. + * @template TValue2 + * @param Set $set The other set, to combine with the current instance. * - * @return Set A new set containing all the values of the current + * @return Set A new set containing all the values of the current * instance as well as another set. */ public function union(Set $set): Set {} @@ -2124,9 +2173,10 @@ public function union(Set $set): Set {} * * @link https://www.php.net/manual/en/ds-set.xor.php * - * @param Set $set The other set. + * @template TValue2 + * @param Set $set The other set. * - * @return Set A new set containing values in the current instance as + * @return Set A new set containing values in the current instance as * well as another set, but not in both. */ public function xor(Set $set): Set {} @@ -2135,7 +2185,7 @@ public function xor(Set $set): Set {} * Converts the set to an array. *

    Note: Casting to an array is not supported yet.

    * @link https://www.php.net/manual/en/ds-set.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the collection. */ public function toArray(): array {} @@ -2156,6 +2206,8 @@ public function jsonSerialize() {} * order, destructively. * * @package Ds + * @template TValue + * @implements Collection * * @link https://www.php.net/manual/en/class.ds-stack.php */ @@ -2167,7 +2219,7 @@ class Stack implements Collection * * @link https://www.php.net/manual/en/ds-stack.construct.php * - * @param iterable $values A traversable object or an + * @param iterable $values A traversable object or an * array to use for the initial values. */ public function __construct($values = []) {} @@ -2215,7 +2267,7 @@ public function count(): int {} /** * Returns a shallow copy of the collection. * @link https://www.php.net/manual/en/ds-stack.copy.php - * @return Stack + * @return Stack */ public function copy(): Stack {} @@ -2232,7 +2284,7 @@ public function isEmpty(): bool {} * Converts the collection to an array. *

    Note: Casting to an array is not supported yet.

    * @link https://www.php.net/manual/en/ds-stack.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the collection. */ public function toArray(): array {} @@ -2251,7 +2303,7 @@ public function jsonSerialize() {} * * @link https://www.php.net/manual/en/ds-queue.peek.php * - * @return mixed The value at the top of the stack. + * @return TValue The value at the top of the stack. * * @throws UnderflowException */ @@ -2262,7 +2314,7 @@ public function peek() {} * * @link https://www.php.net/manual/en/ds-queue.pop.php * - * @return mixed The removed value which was at the top of the stack. + * @return TValue The removed value which was at the top of the stack. * * @throws UnderflowException */ @@ -2273,7 +2325,7 @@ public function pop() {} * * @link https://www.php.net/manual/en/ds-queue.push.php * - * @param array $values The values to push onto the stack. + * @param TValue ...$values The values to push onto the stack. */ public function push(...$values) {} } @@ -2286,6 +2338,8 @@ public function push(...$values) {} * Uses a Ds\Vector internally. * * @package Ds + * @template TValue + * @implements Collection */ class Queue implements Collection { @@ -2295,7 +2349,7 @@ class Queue implements Collection * * @link https://www.php.net/manual/en/ds-queue.construct.php * - * @param iterable $values A traversable object or an + * @param iterable $values A traversable object or an * array to use for the initial values. */ public function __construct($values = []) {} @@ -2343,10 +2397,13 @@ public function count(): int {} /** * Returns a shallow copy of the collection. * @link https://www.php.net/manual/en/ds-queue.copy.php - * @return Stack + * @return Queue */ - public function copy(): Stack {} + public function copy(): Queue {} + /** + * @return Traversable + */ public function getIterator(): Traversable {} /** @@ -2360,7 +2417,7 @@ public function isEmpty(): bool {} * Converts the collection to an array. *

    Note: Casting to an array is not supported yet.

    * @link https://www.php.net/manual/en/ds-queue.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the collection. */ public function toArray(): array {} @@ -2379,7 +2436,7 @@ public function jsonSerialize() {} * * @link https://www.php.net/manual/en/ds-queue.peek.php * - * @return mixed The value at the top of the queue. + * @return TValue The value at the top of the queue. * * @throws UnderflowException */ @@ -2390,7 +2447,7 @@ public function peek() {} * * @link https://www.php.net/manual/en/ds-queue.pop.php * - * @return mixed The removed value which was at the top of the queue. + * @return TValue The removed value which was at the top of the queue. * * @throws UnderflowException */ @@ -2401,7 +2458,7 @@ public function pop() {} * * @link https://www.php.net/manual/en/ds-queue.push.php * - * @param array $values The values to push onto the queue. + * @param TValue ...$values The values to push onto the queue. */ public function push(...$values) {} } @@ -2414,6 +2471,8 @@ public function push(...$values) {} * Implemented using a max heap. * * @package Ds + * @template TValue + * @implements Collection * * @link https://www.php.net/manual/en/class.ds-priorityqueue.php */ @@ -2436,7 +2495,7 @@ public function count(): int {} * Allocates enough memory for a required capacity * @link https://www.php.net/manual/en/ds-priorityqueue.allocate.php * - * @param int $capacity + * @param int $capacity */ public function allocate(int $capacity): void {} @@ -2457,7 +2516,7 @@ public function clear(): void {} /** * Returns a shallow copy of the collection. * @link https://www.php.net/manual/en/ds-collection.copy.php - * @return Collection + * @return PriorityQueue */ public function copy() {} @@ -2474,7 +2533,7 @@ public function isEmpty(): bool {} * Returns the value at the front of the queue, but does not remove it. * @link https://www.php.net/manual/en/ds-priorityqueue.peek.php * - * @return mixed The value at the front of the queue. + * @return TValue The value at the front of the queue. * @throws UnderflowException if empty. */ public function peek() {} @@ -2483,7 +2542,7 @@ public function peek() {} * Removes and returns the value with the highest priority * @link https://www.php.net/manual/en/ds-priorityqueue.pop.php * - * @return mixed The removed value which was at the front of the queue. + * @return TValue The removed value which was at the front of the queue. * @throws UnderflowException if empty. */ public function pop() {} @@ -2491,8 +2550,8 @@ public function pop() {} /** * Pushes a value with a given priority into the queue. * - * @param mixed $value - * @param int $priority + * @param TValue $value + * @param int $priority */ public function push($value, int $priority) {} @@ -2500,7 +2559,7 @@ public function push($value, int $priority) {} * Converts the collection to an array. *

    Note: Casting to an array is not supported yet.

    * @link https://www.php.net/manual/en/ds-collection.toarray.php - * @return array An array containing all the values in the same order as + * @return array An array containing all the values in the same order as * the collection. */ public function toArray(): array {} diff --git a/tests/Model/PHPDocElement.php b/tests/Model/PHPDocElement.php index 302a9248d..560c8fac5 100644 --- a/tests/Model/PHPDocElement.php +++ b/tests/Model/PHPDocElement.php @@ -84,7 +84,7 @@ protected function collectTags(Node $node) try { $text = $node->getDocComment()->getText(); $text = preg_replace("/int\<\w+,\s*\w+\>/", "int", $text); - $text = preg_replace("/callable\(\w+,\s*\w+\):\s*\w+/", "callable", $text); + $text = preg_replace("/callable\(\w+(,\s*\w+)*\)(:\s*\w*)?/", "callable", $text); $this->phpdoc = $text; $phpDoc = DocFactoryProvider::getDocFactory()->create($text); $tags = $phpDoc->getTags(); diff --git a/tests/StubsPhpDocTest.php b/tests/StubsPhpDocTest.php index 996bad4da..e8ad60115 100644 --- a/tests/StubsPhpDocTest.php +++ b/tests/StubsPhpDocTest.php @@ -187,6 +187,7 @@ private static function checkContainsOnlyValidTags(BasePHPElement $element, stri 'copyright', 'deprecated', 'example', //temporary addition due to the number of existing cases + 'extends', 'inheritdoc', 'inheritDoc', 'internal', @@ -224,7 +225,7 @@ private static function checkContainsOnlyValidTags(BasePHPElement $element, stri private static function checkPHPDocCorrectness(BasePHPElement $element, string $elementName): void { self::checkLinks($element, $elementName); - self::checkHtmlTags($element, $elementName); + //self::checkHtmlTags($element, $elementName); if ($element->stubBelongsToCore) { self::checkDeprecatedRemovedSinceVersionsMajor($element, $elementName); } From 1a27923261cdcf36e4b7eab7efed1fb01d7305c1 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 21 Jan 2023 00:14:00 +0100 Subject: [PATCH 261/419] [phpstorm-stubs] WI-70835 add false to return type --- pgsql/pgsql.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 5e0885f43..8e864acae 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -723,14 +723,15 @@ function pg_fetch_object( * while PGSQL_BOTH, the default, will return both * numerical and associative indices. *

    - * @return array An array with all rows in the result. Each row is an array + * @return array|false An array with all rows in the result. Each row is an array * of field values indexed by field name. *

    *

    * FALSE is returned if there are no rows in the result, or on any * other error. */ -function pg_fetch_all(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $mode = PGSQL_ASSOC): array {} +#[LanguageLevelTypeAware(['8.0' => 'array'], default: 'array|false')] +function pg_fetch_all(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, int $mode = PGSQL_ASSOC) {} /** * Fetches all rows in a particular result column as an array From 2dc7f5d54e937d81ad4672067e3bc9fc8b05501c Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 24 Jan 2023 09:57:58 +0100 Subject: [PATCH 262/419] Fix PDO::query param name --- PDO/PDO.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PDO/PDO.php b/PDO/PDO.php index dce5e5b5a..bed6f480d 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1073,13 +1073,13 @@ public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
    * Executes an SQL statement, returning a result set as a PDOStatement object * @link https://php.net/manual/en/pdo.query.php - * @param string $statement

    + * @param string $query

    * The SQL statement to prepare and execute. *

    *

    * Data inside the query should be properly escaped. *

    - * @param int $mode

    + * @param int $fetchMode

    * The fetch mode must be one of the PDO::FETCH_* constants. *

    * @param mixed $arg3

    @@ -1094,19 +1094,19 @@ public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] * @see PDOStatement::setFetchMode For a full description of the second and following parameters. */ #[PhpStormStubsElementAvailable(to: '7.4')] - public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, $ctorargs = []) {} + public function query($query, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, $ctorargs = []) {} /** * (PHP 5 >= 5.1.0, PHP 7, PHP 8, PECL pdo >= 0.2.0)
    * Executes an SQL statement, returning a result set as a PDOStatement object * @link https://php.net/manual/en/pdo.query.php - * @param string $statement

    + * @param string $query

    * The SQL statement to prepare and execute. *

    *

    * Data inside the query should be properly escaped. *

    - * @param int|null $mode

    + * @param int|null $fetchMode

    * The fetch mode must be one of the PDO::FETCH_* constants. *

    * @param mixed ...$fetch_mode_args

    @@ -1119,8 +1119,8 @@ public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = */ #[PhpStormStubsElementAvailable('8.0')] public function query( - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement, - #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $mode = null, + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $fetchMode = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$fetch_mode_args ) {} From 4e8d7883d8bcfec73d474ab201b71412d5b68555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Mon, 23 Jan 2023 23:23:06 +0100 Subject: [PATCH 263/419] Add opcache `jit` to arrayshape --- Zend OPcache/OPcache.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Zend OPcache/OPcache.php b/Zend OPcache/OPcache.php index c2f9a97d1..0e959fa1e 100644 --- a/Zend OPcache/OPcache.php +++ b/Zend OPcache/OPcache.php @@ -58,6 +58,7 @@ function opcache_reset(): bool {} 'opcache_statistics' => 'array', 'preload_statistics' => 'array', 'scripts' => 'array', + 'jit' => 'array', ])] function opcache_get_status(bool $include_scripts = true): array|false {} From da9fac4a76de48087e5eac123d6f83d5e2e2a53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Wed, 25 Jan 2023 17:19:15 +0100 Subject: [PATCH 264/419] `$iterator` in Redis scan() can be also null See https://github.com/phpredis/phpredis/blob/develop/redis.stub.php#L2915 --- redis/Redis.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index caabec813..2feee0ae0 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -4723,9 +4723,9 @@ public function time() {} /** * Scan the keyspace for keys * - * @param int &$iterator Iterator, initialized to NULL. - * @param string $pattern Pattern to match. - * @param int $count Count of keys per iteration (only a suggestion to Redis). + * @param int|null &$iterator Iterator, initialized to NULL. + * @param string $pattern Pattern to match. + * @param int $count Count of keys per iteration (only a suggestion to Redis). * * @return array|false|Redis This function will return an array of keys or FALSE if there are no more keys or Redis if in multimode * From bc3d19b3a62c5f84da94027a5f9bec6d08573e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Thu, 12 Jan 2023 15:37:27 -0800 Subject: [PATCH 265/419] Create Relay.php --- relay/Relay.php | 3171 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3171 insertions(+) create mode 100644 relay/Relay.php diff --git a/relay/Relay.php b/relay/Relay.php new file mode 100644 index 000000000..f992a89d4 --- /dev/null +++ b/relay/Relay.php @@ -0,0 +1,3171 @@ +) constants. Otherwise it will + * return the string that Redis returns. + * + * @param mixed $key + * @return int|string|false + */ + #[\Relay\Attributes\RedisCommand] + public function type(mixed $key): \Relay\Relay|int|string|bool; + + /** + * Atomically returns and removes the first/last element of the list + * stored at source, and pushes the element at the first/last + * element of the list stored at destination. + * + * @param mixed $srckey + * @param mixed $dstkey + * @param string $srcpos + * @param string $dstpos + * @return string|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): \Relay\Relay|string|null|false; + + /** + * BLMOVE is the blocking variant of LMOVE. When source contains elements, + * this command behaves exactly like LMOVE. When used inside a + * MULTI/EXEC block, this command behaves exactly like LMOVE. + * + * @param mixed $srckey + * @param mixed $dstkey + * @param string $srcpos + * @param string $dstpos + * @param float $timeout + * @return string|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): \Relay\Relay|string|null|false; + + /** + * Returns the specified elements of the list stored at key. + * + * @param mixed $key + * @param int $start + * @param int $stop + * @return array|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function lrange(mixed $key, int $start, int $stop): \Relay\Relay|array|false; + + /** + * Insert all the specified values at the head of the list stored at key. + * + * @param mixed $key + * @param mixed $mem + * @param mixed $mems,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function lpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + + /** + * Insert all the specified values at the tail of the list stored at key. + * + * @param mixed $key + * @param mixed $mem + * @param mixed $mems,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function rpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + + /** + * Inserts specified values at the head of the list stored at key, + * only if key already exists and holds a list. + * + * @param mixed $key + * @param mixed $mem + * @param mixed $mems,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function lpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + + /** + * Inserts specified values at the tail of the list stored at key, + * only if key already exists and holds a list. + * + * @param mixed $key + * @param mixed $mem + * @param mixed $mems,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function rpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + + /** + * Sets the list element at index to element. + * + * @param mixed $key + * @param int $index + * @param mixed $mem + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function lset(mixed $key, int $index, mixed $mem): \Relay\Relay|bool; + + /** + * Removes and returns the first elements of the list stored at key. + * + * @param mixed $key + * @param int $count + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function lpop(mixed $key, int $count = 1): mixed; + + /** + * The command returns the index of matching elements inside a Redis list. + * + * @param mixed $key + * @param mixed $value + * @param array $options + * @return int|array|false|null + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function lpos(mixed $key, mixed $value, ?array $options = null): \Relay\Relay|int|array|false|null; + + /** + * Removes and returns the last elements of the list stored at key. + * + * @param mixed $key + * @param int $count + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function rpop(mixed $key, int $count = 1): mixed; + + /** + * Atomically returns and removes the last element (tail) of the list stored at source, + * and pushes the element at the first element (head) of the list stored at destination. + * + * @param mixed $source + * @param mixed $dest + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function rpoplpush(mixed $source, mixed $dest): mixed; + + /** + * Atomically returns and removes the last element (tail) of the list stored at source, + * and pushes the element at the first element (head) of the list stored at destination. + * This command will block for an element up to the provided timeout. + * + * @param mixed $source + * @param mixed $dest + * @param float $timeout + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed; + + /** + * BLPOP is a blocking list pop primitive. It is the blocking version of LPOP because + * it blocks the connection when there are no elements to pop from any of the given lists. + * + * @param string|array $key + * @param string|float $timeout_or_key + * @param array $extra_args,... + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function blpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + + /** + * Pop elements from a list, or block until one is available + * + * @param float $timeout + * @param array $keys + * @param string $from + * @param int $count + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function blmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + + /** + * Remove and return members with scores in a sorted set or block until one is available + * + * @param float $timeout + * @param array $keys + * @param string $from + * @param int $count + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + + /** + * Pops one or more elements from the first non-empty list key from the list of provided key names. + * + * @param array $keys + * @param string $from + * @param int $count + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function lmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + + /** + * Pops one or more elements, that are member-score pairs, from the + * first non-empty sorted set in the provided list of key names. + * + * @param array $keys + * @param string $from + * @param int $count + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function zmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + + /** + * BRPOP is a blocking list pop primitive. It is the blocking version of RPOP because + * it blocks the connection when there are no elements to pop from any of the given lists. + * + * @param string|array $key + * @param string|float $timeout_or_key + * @param array $extra_args,... + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function brpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + + /** + * BZPOPMAX is the blocking variant of the sorted set ZPOPMAX primitive. + * + * @param string|array $key + * @param string|float $timeout_or_key + * @param array $extra_args,... + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + + /** + * BZPOPMIN is the blocking variant of the sorted set ZPOPMIN primitive. + * + * @param string|array $key + * @param string|float $timeout_or_key + * @param array $extra_args,... + * @return array|null|false + */ + #[\Relay\Attributes\RedisCommand] + public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + + /** + * This is a container command for object introspection commands. + * + * @param string $op + * @param mixed $key + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function object(string $op, mixed $key): mixed; + + /** + * Return the positions (longitude,latitude) of all the specified members + * of the geospatial index represented by the sorted set at key. + * + * @param mixed $key + * @param mixed $members,... + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function geopos(mixed $key, mixed ...$members): \Relay\Relay|array|false; + + /** + * Removes the first count occurrences of elements equal to element from the list stored at key. + * + * @param mixed $key + * @param mixed $mem + * @param int $count + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function lrem(mixed $key, mixed $mem, int $count = 0): \Relay\Relay|int|false; + + /** + * Returns the element at index index in the list stored at key. + * + * @param mixed $key + * @param int $index + * @return mixed + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function lindex(mixed $key, int $index): mixed; + + /** + * Inserts element in the list stored at key either before or after the reference value pivot. + * + * @param mixed $key + * @param string $op + * @param mixed $pivot + * @param mixed $element + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): \Relay\Relay|int|false; + + /** + * Trim an existing list so that it will contain only the specified range of elements specified. + * + * @param mixed $key + * @param int $start + * @param int $end + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function ltrim(mixed $key, int $start, int $end): \Relay\Relay|bool; + + /** + * Returns the value associated with field in the hash stored at key. + * + * @param mixed $hash + * @param mixed $member + * @return mixed + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hget(mixed $hash, mixed $member): mixed; + + /** + * Returns the string length of the value associated with field in the hash stored at key. + * + * @param mixed $hash + * @param mixed $member + * @return int|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hstrlen(mixed $hash, mixed $member): \Relay\Relay|int|false; + + /** + * Returns all fields and values of the hash stored at key. + * + * @param mixed $hash + * @return array|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hgetall(mixed $hash): \Relay\Relay|array|false; + + /** + * Returns all field names in the hash stored at key. + * + * @param mixed $hash + * @return array|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hkeys(mixed $hash): \Relay\Relay|array|false; + + /** + * Returns all values in the hash stored at key. + * + * @param mixed $hash + * @return array|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hvals(mixed $hash): \Relay\Relay|array|false; + + /** + * Returns the values associated with the specified fields in the hash stored at key. + * + * @param mixed $hash + * @param array $members + * @return array|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hmget(mixed $hash, array $members): \Relay\Relay|array|false; + + /** + * When called with just the key argument, return a random field from the hash value stored at key. + * + * @param mixed $hash + * @param array $options + * @return array|string|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hrandfield(mixed $hash, ?array $options = NULL): \Relay\Relay|array|string|false; + + /** + * Sets the specified fields to their respective values in the hash stored at key. + * + * @param mixed $hash + * @param array $members + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function hmset(mixed $hash, array $members): \Relay\Relay|bool; + + /** + * Returns if field is an existing field in the hash stored at key. + * + * @param mixed $hash + * @param mixed $member + * @return bool + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hexists(mixed $hash, mixed $member): \Relay\Relay|bool; + + /** + * Sets field in the hash stored at key to value, only if field does not yet exist. + * + * @param mixed $hash + * @param mixed $member + * @param mixed $value + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function hsetnx(mixed $hash, mixed $member, mixed $value): \Relay\Relay|bool; + + /** + * Sets field in the hash stored at key to value. + * + * @param mixed $key + * @param mixed $mem + * @param mixed $val + * @param mixed $kvals,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): \Relay\Relay|int|false; + + /** + * Removes the specified fields from the hash stored at key. + * + * @param mixed $key + * @param mixed $mem + * @param string $mems,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function hdel(mixed $key, mixed $mem, string ...$mems): \Relay\Relay|int|false; + + /** + * Increments the number stored at field in the hash stored at key by increment. + * + * @param mixed $key + * @param mixed $mem + * @param int $value + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function hincrby(mixed $key, mixed $mem, int $value): \Relay\Relay|int|false; + + /** + * Increment the specified field of a hash stored at key, and representing + * a floating point number, by the specified increment. + * + * @param mixed $key + * @param mixed $mem + * @param float $value + * @return float|bool + */ + #[\Relay\Attributes\RedisCommand] + public function hincrbyfloat(mixed $key, mixed $mem, float $value): \Relay\Relay|float|bool; + + /** + * Increments the number stored at key by one. + * + * @param mixed $key + * @param int $by + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function incr(mixed $key, int $by = 1): \Relay\Relay|int|false; + + /** + * Decrements the number stored at key by one. + * + * @param mixed $key + * @param int $by + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function decr(mixed $key, int $by = 1): \Relay\Relay|int|false; + + /** + * Increments the number stored at key by increment. + * + * @param mixed $key + * @param int $value + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function incrby(mixed $key, int $value): \Relay\Relay|int|false; + + /** + * Decrements the number stored at key by decrement. + * + * @param mixed $key + * @param int $value + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function decrby(mixed $key, int $value): \Relay\Relay|int|false; + + /** + * Increment the string representing a floating point number stored at key by the specified increment. + * + * @param mixed $key + * @param float $value + * @return float|false + */ + #[\Relay\Attributes\RedisCommand] + public function incrbyfloat(mixed $key, float $value): \Relay\Relay|float|false; + + /** + * Returns the members of the set resulting from the difference between the first set and all the successive sets. + * + * @param mixed $key + * @param mixed $other_keys,... + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function sdiff(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false; + + /** + * This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination. + * If destination already exists, it is overwritten. + * + * @param mixed $key + * @param mixed $other_keys,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function sdiffstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false; + + /** + * Returns the members of the set resulting from the intersection of all the given sets. + * + * @param mixed $key + * @param mixed $other_keys,... + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function sinter(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false; + + /** + * Intersect multiple sets and return the cardinality of the result. + * + * @param array $keys + * @param int $limit + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function sintercard(array $keys, int $limit = -1): \Relay\Relay|int|false; + + /** + * This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination. + * If destination already exists, it is overwritten. + * + * @param mixed $key + * @param mixed $other_keys,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function sinterstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false; + + /** + * Returns the members of the set resulting from the union of all the given sets. + * + * @param mixed $key + * @param mixed $other_keys,... + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function sunion(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false; + + /** + * This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination. + * If destination already exists, it is overwritten. + * + * @param mixed $key + * @param mixed $other_keys,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function sunionstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false; + + /** + * Alters the last access time of a key(s). + * + * @param array|string $key_or_array + * @param mixed $more_keys,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function touch(array|string $key_or_array, mixed ...$more_keys): \Relay\Relay|int|false; + + /** + * A pipeline block is simply transmitted faster to the server (like `MULTI`), but without any guarantee of atomicity. + * + * @return bool|\Relay\Relay + */ + #[\Relay\Attributes\Local] + public function pipeline(): \Relay\Relay|bool; + + /** + * Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC. + * + * Accepts `Relay::MULTI` and `Relay::PIPELINE` modes. + * + * @param int $mode + * @return bool|\Relay\Relay + */ + #[\Relay\Attributes\RedisCommand] + public function multi(int $mode = 0): \Relay\Relay|bool; + + /** + * Executes all previously queued commands in a transaction and restores the connection state to normal. + * + * @return array|bool + */ + #[\Relay\Attributes\RedisCommand] + public function exec(): \Relay\Relay|array|bool; + + /** + * Wait for the synchronous replication of all the write + * commands sent in the context of the current connection. + * + * @param int $replicas + * @param int $timeout + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function wait(int $replicas, $timeout): \Relay\Relay|int|false; + + /** + * Marks the given keys to be watched for conditional execution of a transaction. + * + * @param mixed $key + * @param mixed $other_keys,... + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function watch(mixed $key, mixed ...$other_keys): \Relay\Relay|bool; + + /** + * Flushes all the previously watched keys for a transaction. + * If you call EXEC or DISCARD, there's no need to manually call UNWATCH. + * + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function unwatch(): \Relay\Relay|bool; + + /** + * Flushes all previously queued commands in a transaction and restores the connection state to normal. + * If WATCH was used, DISCARD unwatches all keys watched by the connection. + * + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function discard(): bool; + + /** + * Get the mode Relay is currently in. + * `Relay::ATOMIC`, `Relay::PIPELINE` or `Relay::MULTI`. + * + * @param bool $masked + * @return int + */ + #[\Relay\Attributes\Local] + public function getMode(bool $masked = false): int; + + /** + * Clear the accumulated sent and received bytes. + * + * @return void + */ + #[\Relay\Attributes\Local] + public function clearBytes(): void; + + /** + * Scan the keyspace for matching keys. + * + * @param mixed $iterator + * @param mixed $match + * @param int $count + * @param string $type + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function scan(mixed &$iterator, mixed $match = null, int $count = 0, ?string $type = null): array|false; + + /** + * Iterates fields of Hash types and their associated values. + * + * @param mixed $key + * @param mixed $iterator + * @param mixed $match + * @param int $count + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function hscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false; + + /** + * Iterates elements of Sets types. + * + * @param mixed $key + * @param mixed $iterator + * @param mixed $match + * @param int $count + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function sscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false; + + /** + * Iterates elements of Sorted Set types and their associated scores. + * + * @param mixed $key + * @param mixed $iterator + * @param mixed $match + * @param int $count + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false; + + /** + * Returns all keys matching pattern. + * + * @param mixed $pattern + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function keys(mixed $pattern): \Relay\Relay|array|false; + + /** + * Interact with the Redis slowlog. + * + * @param string $operation + * @param string $extra_args,... + * @return array|int|bool + */ + #[\Relay\Attributes\RedisCommand] + public function slowlog(string $operation, string ...$extra_args): \Relay\Relay|array|int|bool; + + /** + * Returns all the members of the set value stored at `$key`. + * + * @param mixed $set + * @return array|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function smembers(mixed $set): \Relay\Relay|array|false; + + /** + * Returns if `$member` is a member of the set stored at `$key`. + * + * @param mixed $set + * @param mixed $member + * @return bool + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function sismember(mixed $set, mixed $member): \Relay\Relay|bool; + + /** + * Returns whether each member is a member of the set stored at `$key`. + * + * @param mixed $set + * @param mixed $members,... + * @return array|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function smismember(mixed $set, mixed ...$members): \Relay\Relay|array|false; + + /** + * Remove the specified members from the set stored at `$key`. + * + * @param mixed $set + * @param mixed $member + * @param mixed $members,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function srem(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false; + + /** + * Add the specified members to the set stored at `$key`. + * + * @param mixed $set + * @param mixed $member + * @param mixed $members,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function sadd(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false; + + /** + * Sort the elements in a list, set or sorted set. + * + * @param mixed $key + * @param array $options + * @return array|int|false + */ + #[\Relay\Attributes\RedisCommand] + public function sort(mixed $key, array $options = []): \Relay\Relay|array|int|false; + + /** + * Sort the elements in a list, set or sorted set. Read-only variant of SORT. + * + * @param mixed $key + * @param array $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function sort_ro(mixed $key, array $options = []): \Relay\Relay|array|false; + + /** + * Move member from the set at source to the set at destination. + * + * @param mixed $srcset + * @param mixed $dstset + * @param mixed $member + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function smove(mixed $srcset, mixed $dstset, mixed $member): \Relay\Relay|bool; + + /** + * Removes and returns one or more random members from the set value store at `$key`. + * + * @param mixed $set + * @param int $count + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function spop(mixed $set, int $count = 1): mixed; + + /** + * Returns one or multiple random members from a set. + * + * @param mixed $set + * @param int $count + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function srandmember(mixed $set, int $count = 1): mixed; + + /** + * Returns the set cardinality (number of elements) of the set stored at `$key`. + * + * @param mixed $key + * @return int|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function scard(mixed $key): \Relay\Relay|int|false; + + /** + * Execute a script management command. + * + * @param string $command + * @param string $args,... + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function script(string $command, string ...$args): mixed; + + /** + * Returns the length of the string value stored at `$key`. + * + * @param mixed $key + * @return int|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function strlen(mixed $key): \Relay\Relay|int|false; + + /** + * Returns the number of fields contained in the hash stored at `$key`. + * + * @param mixed $key + * @return int|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function hlen(mixed $key): \Relay\Relay|int|false; + + /** + * Returns the length of the list stored at `$key`. + * + * @param mixed $key + * @return int|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function llen(mixed $key): \Relay\Relay|int|false; + + /** + * Acknowledge one or more IDs as having been processed by the consumer group. + * + * @param mixed $key + * @param string $group + * @param array $ids + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function xack(mixed $key, string $group, array $ids): \Relay\Relay|int|false; + + /** + * Append a message to a stream. + * + * @param string $key + * @param string $id + * @param int $maxlen + * @param bool $approx + * @param bool $nomkstream + * @return string|false + */ + public function xadd( + string $key, + string $id, + array $values, + int $maxlen = 0, + bool $approx = false, + bool $nomkstream = false + ): \Relay\Relay|string|false; + + /** + * Claim ownership of stream message(s). + * + * @param string $key + * @param string $group + * @param string $consumer + * @param int $min_idle + * @param array $ids + * @param array $options + * @return array|bool + */ + #[\Relay\Attributes\RedisCommand] + public function xclaim( + string $key, + string $group, + string $consumer, + int $min_idle, + array $ids, + array $options + ): \Relay\Relay|array|bool; + + /** + * Automatically take ownership of stream message(s) by metrics + * + * @param string $key + * @param string $group + * @param string $consumer + * @param int $min_idle + * @param string $start + * @param int $count + * @param bool $justid + * @return array|bool + */ + #[\Relay\Attributes\RedisCommand] + public function xautoclaim( + string $key, + string $group, + string $consumer, + int $min_idle, + string $start, + int $count = -1, + bool $justid = false + ): \Relay\Relay|bool|array; + + /** + * Get the length of a stream. + * + * @param string $key + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function xlen(string $key): \Relay\Relay|int|false; + + /** + * Perform utility operations having to do with consumer groups + * + * @param string $operation + * @param mixed $key + * @param string $group + * @param string $id_or_consumer + * @param bool $mkstream + * @param int $entries_read + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function xgroup( + string $operation, + mixed $key = null, + string $group = null, + string $id_or_consumer = null, + bool $mkstream = false, + int $entries_read = -2 + ): mixed; + + /** + * Remove one or more specific IDs from a stream. + * + * @param string $key + * @param array $ids + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function xdel(string $key, array $ids): \Relay\Relay|int|false; + + /** + * Retrieve information about a stream key. + * + * @param string $operation + * @param string $arg1 + * @param string $arg2 + * @param int $count + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1): mixed; + + /** + * Query pending entries in a stream. + * + * @param string $key + * @param string $group + * @param string $start + * @param string $end + * @param int $count + * @param string $consumer + * @param int $idle + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function xpending( + string $key, + string $group, + ?string $start = null, + ?string $end = null, + int $count = -1, + ?string $consumer = null, + int $idle = 0 + ): \Relay\Relay|array|false; + + /** + * Lists elements in a stream. + * + * @param mixed $key + * @param string $start + * @param string $end + * @param int $count = -1 + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function xrange(mixed $key, string $start, string $end, int $count = -1): \Relay\Relay|array|false; + + /** + * Get a range of entries from a STREAM ke in reverse chronological order. + * + * @param string $key + * @param string $end + * @param string $start + * @param int $count + * @return array|bool + */ + #[\Relay\Attributes\RedisCommand] + public function xrevrange(string $key, string $end, string $start, int $count = -1): \Relay\Relay|array|bool; + + /** + * Read messages from a stream. + * + * @param array $streams + * @param int $count + * @param int $block + * @return array|bool|null + */ + #[\Relay\Attributes\RedisCommand] + public function xread(array $streams, int $count = -1, int $block = -1): \Relay\Relay|array|bool|null; + + /** + * Read messages from a stream using a consumer group. + * + * @param string $group + * @param string $consumer + * @param array $streams + * @param int $count + * @param int $block + * @return array|bool|null + */ + #[\Relay\Attributes\RedisCommand] + public function xreadgroup( + string $group, + string $consumer, + array $streams, + int $count = 1, + int $block = 1 + ): \Relay\Relay|array|bool|null; + + /** + * Truncate a STREAM key in various ways. + * + * @param string $key + * @param string $threshold + * @param bool $approx + * @param bool $minid + * @param int $limit + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function xtrim( + string $key, + string $threshold, + bool $approx = false, + bool $minid = false, + int $limit = -1 + ): \Relay\Relay|int|false; + + /** + * Adds all the specified members with the specified scores to the sorted set stored at key. + * + * @param mixed $key + * @param mixed $args,... + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function zadd(mixed $key, mixed ...$args): mixed; + + /** + * When called with just the key argument, return a random element from the sorted set value stored at key. + * If the provided count argument is positive, return an array of distinct elements. + * + * @param mixed $key + * @param array|null $options + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function zrandmember(mixed $key, ?array $options = NULL): mixed; + + /** + * Returns the specified range of elements in the sorted set stored at key. + * + * @param mixed $key + * @param string $start + * @param string $end + * @param mixed $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrange(mixed $key, string $start, string $end, mixed $options = null): \Relay\Relay|array|false; + + /** + * Returns the specified range of elements in the sorted set stored at key. + * + * @param mixed $key + * @param int $start + * @param int $end + * @param mixed $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrevrange(mixed $key, int $start, int $end, mixed $options = null): \Relay\Relay|array|false; + + /** + * Returns all the elements in the sorted set at key with a score between + * min and max (including elements with score equal to min or max). + * + * @param mixed $key + * @param mixed $start + * @param mixed $end + * @param mixed $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false; + + /** + * Returns all the elements in the sorted set at key with a score between + * max and min (including elements with score equal to max or min). + * + * @param mixed $key + * @param mixed $start + * @param mixed $end + * @param mixed $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false; + + /** + * Returns all the elements in the sorted set at key with a score between + * max and min (including elements with score equal to max or min). + * + * @param mixed $dst + * @param mixed $src + * @param mixed $start + * @param mixed $end + * @param mixed $options + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|int|false; + + /** + * When all the elements in a sorted set are inserted with the same score, + * in order to force lexicographical ordering, this command returns all + * the elements in the sorted set at key with a value between min and max. + * + * @param mixed $key + * @param mixed $min + * @param mixed $max + * @param int $offset + * @param int $count + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1): \Relay\Relay|array|false; + + /** + * When all the elements in a sorted set are inserted with the same score, + * in order to force lexicographical ordering, this command returns all + * the elements in the sorted set at key with a value between max and min. + * + * @param mixed $key + * @param mixed $max + * @param mixed $min + * @param int $offset + * @param int $count + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = -1, int $count = -1): \Relay\Relay|array|false; + + /** + * Returns the rank of member in the sorted set stored at key, with the scores + * ordered from low to high. The rank (or index) is 0-based, which means + * that the member with the lowest score has rank 0. + * + * @param mixed $key + * @param mixed $rank + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrank(mixed $key, mixed $rank): \Relay\Relay|int|false; + + /** + * Returns the rank of member in the sorted set stored at key, with the scores + * ordered from high to low. The rank (or index) is 0-based, which means + * that the member with the highest score has rank 0. + * + * @param mixed $key + * @param mixed $rank + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrevrank(mixed $key, mixed $rank): \Relay\Relay|int|false; + + /** + * Removes the specified members from the sorted set stored at key. + * Non existing members are ignored. + * + * @param mixed $key + * @param mixed $args,... + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zrem(mixed $key, mixed ...$args): \Relay\Relay|int|false; + + /** + * When all the elements in a sorted set are inserted with the same score, + * in order to force lexicographical ordering, this command removes all + * elements in the sorted set stored at key between the + * lexicographical range specified by min and max. + * + * @param mixed $key + * @param mixed $min + * @param mixed $max + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zremrangebylex(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + + /** + * Removes all elements in the sorted set stored at key with rank between + * start and stop. Both start and stop are 0 -based indexes with 0 being + * the element with the lowest score. + * + * @param mixed $key + * @param int $start + * @param int $end + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zremrangebyrank(mixed $key, int $start, int $end): \Relay\Relay|int|false; + + /** + * Removes all elements in the sorted set stored at key with + * a score between min and max (inclusive). + * + * @param mixed $key + * @param mixed $min + * @param mixed $max + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zremrangebyscore(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + + /** + * Returns the sorted set cardinality (number of elements) of the sorted set stored at key. + * + * @param mixed $key + * @return int|false + */ + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] + public function zcard(mixed $key): \Relay\Relay|int|false; + + /** + * Returns the number of elements in the sorted set at key with a score between min and max. + * + * @param mixed $key + * @param mixed $min + * @param mixed $max + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + + /** + * This command is similar to ZDIFFSTORE, but instead of storing the + * resulting sorted set, it is returned to the client. + * + * @param array $keys + * @param array $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zdiff(array $keys, ?array $options = null): \Relay\Relay|array|false; + + /** + * Computes the difference between the first and all successive + * input sorted sets and stores the result in destination. + * + * @param mixed $dst + * @param array $keys + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zdiffstore(mixed $dst, array $keys): \Relay\Relay|int|false; + + /** + * Increments the score of member in the sorted set stored at key by increment. + * + * @param mixed $key + * @param float $score + * @param mixed $mem + * @return float|false + */ + #[\Relay\Attributes\RedisCommand] + public function zincrby(mixed $key, float $score, mixed $mem): \Relay\Relay|float|false; + + /** + * When all the elements in a sorted set are inserted with the same score, + * in order to force lexicographical ordering, this command returns the + * number of elements in the sorted set at key with a value between min and max. + * + * @param mixed $key + * @param mixed $min + * @param mixed $max + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zlexcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + + /** + * Returns the scores associated with the specified members in the sorted set stored at key. + * + * @param mixed $key + * @param mixed $mems,... + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zmscore(mixed $key, mixed ...$mems): \Relay\Relay|array|false; + + /** + * Returns the score of member in the sorted set at key. + * + * @param mixed $key + * @param mixed $member + * @return float|false + */ + #[\Relay\Attributes\RedisCommand] + public function zscore(mixed $key, mixed $member): \Relay\Relay|float|false; + + /** + * This command is similar to ZINTERSTORE, but instead of storing + * the resulting sorted set, it is returned to the client. + * + * @param array $keys + * @param array $weights + * @param mixed $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zinter(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false; + + /** + * Intersect multiple sorted sets and return the cardinality of the result. + * + * @param array $keys + * @param int $limit + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zintercard(array $keys, int $limit = -1): \Relay\Relay|int|false; + + /** + * Computes the intersection of numkeys sorted sets given by the + * specified keys, and stores the result in destination. + * + * @param mixed $dst + * @param array $keys + * @param array $weights + * @param mixed $options + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false; + + /** + * This command is similar to ZUNIONSTORE, but instead of storing + * the resulting sorted set, it is returned to the client. + * + * @param array $keys + * @param array $weights + * @param mixed $options + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zunion(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false; + + /** + * Computes the union of numkeys sorted sets given by the + * specified keys, and stores the result in destination. + * + * @param mixed $dst + * @param array $keys + * @param array $weights + * @param mixed $options + * @return int|false + */ + #[\Relay\Attributes\RedisCommand] + public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false; + + /** + * Removes and returns up to count members with the lowest + * scores in the sorted set stored at key. + * + * @param mixed $key + * @param int $count + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zpopmin(mixed $key, int $count = 1): \Relay\Relay|array|false; + + /** + * Removes and returns up to count members with the highest + * scores in the sorted set stored at key. + * + * @param mixed $key + * @param int $count + * @return array|false + */ + #[\Relay\Attributes\RedisCommand] + public function zpopmax(mixed $key, int $count = 1): \Relay\Relay|array|false; + + /** + * Returns keys cached in runtime memory. + * + * @internal Temporary debug helper. Do not use. + * @return mixed + */ + #[\Relay\Attributes\Local] + public function _getKeys(); +} From 22174120975c313b896708efb870d2c6c2ffdc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Thu, 12 Jan 2023 15:39:00 -0800 Subject: [PATCH 266/419] Create Sentinel.php --- relay/Sentinel.php | 174 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 relay/Sentinel.php diff --git a/relay/Sentinel.php b/relay/Sentinel.php new file mode 100644 index 000000000..49b023736 --- /dev/null +++ b/relay/Sentinel.php @@ -0,0 +1,174 @@ + Date: Thu, 12 Jan 2023 15:39:34 -0800 Subject: [PATCH 267/419] Create Event.php --- relay/Event.php | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 relay/Event.php diff --git a/relay/Event.php b/relay/Event.php new file mode 100644 index 000000000..4eb5a7b5f --- /dev/null +++ b/relay/Event.php @@ -0,0 +1,50 @@ + Date: Thu, 12 Jan 2023 15:40:27 -0800 Subject: [PATCH 268/419] Create KeyType.php --- relay/KeyType.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 relay/KeyType.php diff --git a/relay/KeyType.php b/relay/KeyType.php new file mode 100644 index 000000000..bb824d1d4 --- /dev/null +++ b/relay/KeyType.php @@ -0,0 +1,43 @@ + Date: Thu, 12 Jan 2023 15:41:06 -0800 Subject: [PATCH 269/419] Create Exception.php --- relay/Exception.php | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 relay/Exception.php diff --git a/relay/Exception.php b/relay/Exception.php new file mode 100644 index 000000000..0bdd82a2f --- /dev/null +++ b/relay/Exception.php @@ -0,0 +1,10 @@ + Date: Thu, 12 Jan 2023 15:52:09 -0800 Subject: [PATCH 270/419] add method bodies --- relay/Relay.php | 500 ++++++++++++++++++++++----------------------- relay/Sentinel.php | 30 +-- 2 files changed, 265 insertions(+), 265 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index f992a89d4..46f95b971 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -390,7 +390,7 @@ public function __construct( float $command_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0, - ); + ) { } /** * Establishes a new connection to Redis. @@ -416,7 +416,7 @@ public function connect( float $read_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0 - ): bool; + ): bool { } /** * Establishes a persistent connection to Redis. @@ -441,7 +441,7 @@ public function pconnect( float $read_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0 - ): bool; + ): bool { } /** * Closes the current connection, unless it's persistent. @@ -449,7 +449,7 @@ public function pconnect( * @return bool */ #[\Relay\Attributes\Local] - public function close(): bool; + public function close(): bool { } /** * Closes the current connection, if it's persistent. @@ -457,7 +457,7 @@ public function close(): bool; * @return bool */ #[\Relay\Attributes\Local] - public function pclose(): bool; + public function pclose(): bool { } /** * Registers a new event listener. @@ -466,7 +466,7 @@ public function pclose(): bool; * @return bool */ #[\Relay\Attributes\Local] - public function listen(?callable $callback): bool; + public function listen(?callable $callback): bool { } /** * Registers a new `flushed` event listener. @@ -475,7 +475,7 @@ public function listen(?callable $callback): bool; * @return bool */ #[\Relay\Attributes\Local] - public function onFlushed(?callable $callback): bool; + public function onFlushed(?callable $callback): bool { } /** * Registers a new `invalidated` event listener. @@ -485,7 +485,7 @@ public function onFlushed(?callable $callback): bool; * @return bool */ #[\Relay\Attributes\Local] - public function onInvalidated(?callable $callback, ?string $pattern = null): bool; + public function onInvalidated(?callable $callback, ?string $pattern = null): bool { } /** * Dispatches all pending events. @@ -493,7 +493,7 @@ public function onInvalidated(?callable $callback, ?string $pattern = null): boo * @return int|false */ #[\Relay\Attributes\Local] - public function dispatchEvents(): int|false; + public function dispatchEvents(): int|false { } /** * Returns a client option. @@ -502,7 +502,7 @@ public function dispatchEvents(): int|false; * @return mixed */ #[\Relay\Attributes\Local] - public function getOption(int $option): mixed; + public function getOption(int $option): mixed { } /** * Returns or sets a client option. @@ -512,7 +512,7 @@ public function getOption(int $option): mixed; * @return mixed */ #[\Relay\Attributes\Local] - public function option(int $option, mixed $value = null): mixed; + public function option(int $option, mixed $value = null): mixed { } /** * Sets a client option. @@ -543,7 +543,7 @@ public function option(int $option, mixed $value = null): mixed; * @return bool */ #[\Relay\Attributes\Local] - public function setOption(int $option, mixed $value): bool; + public function setOption(int $option, mixed $value): bool { } /** * Returns the connection timeout. @@ -551,7 +551,7 @@ public function setOption(int $option, mixed $value): bool; * @return float|false */ #[\Relay\Attributes\Local] - public function getTimeout(): float|false; + public function getTimeout(): float|false { } /** * @alias Relay\Relay::getTimeout @@ -559,7 +559,7 @@ public function getTimeout(): float|false; * @return float|false */ #[\Relay\Attributes\Local] - public function timeout(): float|false; + public function timeout(): float|false { } /** * Returns the read timeout. @@ -567,7 +567,7 @@ public function timeout(): float|false; * @return float|false */ #[\Relay\Attributes\Local] - public function getReadTimeout(): float|false; + public function getReadTimeout(): float|false { } /** * @alias Relay\Relay::getReadTimeout @@ -575,7 +575,7 @@ public function getReadTimeout(): float|false; * @return float|false */ #[\Relay\Attributes\Local] - public function readTimeout(): float|false; + public function readTimeout(): float|false { } /** * Returns the number of bytes sent and received over the network during the Relay object's @@ -584,7 +584,7 @@ public function readTimeout(): float|false; * @return array A two element array consisting of [$sent_bytes, $received_bytes] */ #[\Relay\Attributes\Local] - public function getBytes(): array; + public function getBytes(): array { } /** * @alias Relay\Relay::getBytes @@ -592,7 +592,7 @@ public function getBytes(): array; * @return array */ #[\Relay\Attributes\Local] - public function bytes(): array; + public function bytes(): array { } /** * Returns the host or unix socket. @@ -600,7 +600,7 @@ public function bytes(): array; * @return string|false */ #[\Relay\Attributes\Local] - public function getHost(): string|false; + public function getHost(): string|false { } /** * Whether Relay is connected to Redis. @@ -608,7 +608,7 @@ public function getHost(): string|false; * @return bool */ #[\Relay\Attributes\Local] - public function isConnected(): bool; + public function isConnected(): bool { } /** * Returns the port. @@ -616,7 +616,7 @@ public function isConnected(): bool; * @return int|false */ #[\Relay\Attributes\Local] - public function getPort(): int|false; + public function getPort(): int|false { } /** * Returns the authentication information. @@ -625,7 +625,7 @@ public function getPort(): int|false; * @return mixed */ #[\Relay\Attributes\Local] - public function getAuth(): mixed; + public function getAuth(): mixed { } /** * Returns the currently selected DB @@ -633,7 +633,7 @@ public function getAuth(): mixed; * @return int|false */ #[\Relay\Attributes\Local] - public function getDbNum(): mixed; + public function getDbNum(): mixed { } /** * Returns the serialized value. @@ -642,7 +642,7 @@ public function getDbNum(): mixed; * @return mixed */ #[\Relay\Attributes\Local] - public function _serialize(mixed $value): mixed; + public function _serialize(mixed $value): mixed { } /** * Returns the unserialized value. @@ -651,7 +651,7 @@ public function _serialize(mixed $value): mixed; * @return mixed */ #[\Relay\Attributes\Local] - public function _unserialize(mixed $value): mixed; + public function _unserialize(mixed $value): mixed { } /** * Compress data with Relay's currently configured compression algorithm. @@ -660,7 +660,7 @@ public function _unserialize(mixed $value): mixed; * @return string */ #[\Relay\Attributes\Local] - public function _compress(string $value): string; + public function _compress(string $value): string { } /** * Uncompress data with Relay's currently configured compression algorithm. @@ -669,7 +669,7 @@ public function _compress(string $value): string; * @return string */ #[\Relay\Attributes\Local] - public function _uncompress(string $value): string; + public function _uncompress(string $value): string { } /** * Returns the serialized and compressed value. @@ -678,7 +678,7 @@ public function _uncompress(string $value): string; * @return string */ #[\Relay\Attributes\Local] - public function _pack(mixed $value): string; + public function _pack(mixed $value): string { } /** * Returns the unserialized and decompressed value. @@ -687,7 +687,7 @@ public function _pack(mixed $value): string; * @return mixed */ #[\Relay\Attributes\Local] - public function _unpack(mixed $value): mixed; + public function _unpack(mixed $value): mixed { } /** * Returns the value with the prefix. @@ -696,7 +696,7 @@ public function _unpack(mixed $value): mixed; * @return string */ #[\Relay\Attributes\Local] - public function _prefix(mixed $value): string; + public function _prefix(mixed $value): string { } /** * Returns the last error message, if any. @@ -704,7 +704,7 @@ public function _prefix(mixed $value): string; * @return string|null */ #[\Relay\Attributes\Local] - public function getLastError(): string|null; + public function getLastError(): string|null { } /** * Clears the last error that is set, if any. @@ -712,7 +712,7 @@ public function getLastError(): string|null; * @return bool */ #[\Relay\Attributes\Local] - public function clearLastError(): bool; + public function clearLastError(): bool { } /** * Returns the connection's endpoint identifier. @@ -720,7 +720,7 @@ public function clearLastError(): bool; * @return string|false */ #[\Relay\Attributes\Local] - public function endpointId(): string|false; + public function endpointId(): string|false { } /** * Returns the connection's endpoint identifier. @@ -729,7 +729,7 @@ public function endpointId(): string|false; * * @return string|false */ - public function getPersistentID(): string|false; + public function getPersistentID(): string|false { } /** * Returns a unique representation of the underlying socket connection identifier. @@ -737,7 +737,7 @@ public function getPersistentID(): string|false; * @return string|false */ #[\Relay\Attributes\Local] - public function socketId(): string|false; + public function socketId(): string|false { } /** * Returns information about the license. @@ -745,7 +745,7 @@ public function socketId(): string|false; * @return array */ #[\Relay\Attributes\Http] - public static function license(): array; + public static function license(): array { } /** @@ -779,7 +779,7 @@ public static function license(): array; * @return array */ #[\Relay\Attributes\Local] - public static function stats(): array; + public static function stats(): array { } /** * Returns the number of bytes allocated, or `0` in client-only mode. @@ -787,7 +787,7 @@ public static function stats(): array; * @return int */ #[\Relay\Attributes\Local] - public static function maxMemory(): int; + public static function maxMemory(): int { } /** * Returns the number of bytes allocated, or `0` in client-only mode. @@ -797,7 +797,7 @@ public static function maxMemory(): int; * @return int */ #[\Relay\Attributes\Local] - public static function memory(): int; + public static function memory(): int { } /** * Execute any command against Redis, without applying @@ -808,7 +808,7 @@ public static function memory(): int; * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function rawCommand(string $cmd, mixed ...$args): mixed; + public function rawCommand(string $cmd, mixed ...$args): mixed { } /** * Select the Redis logical database having the specified zero-based numeric index. @@ -817,7 +817,7 @@ public function rawCommand(string $cmd, mixed ...$args): mixed; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function select(int $db): \Relay\Relay|bool; + public function select(int $db): \Relay\Relay|bool { } /** * Authenticate the connection using a password or an ACL username and password. @@ -826,7 +826,7 @@ public function select(int $db): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function auth(#[\SensitiveParameter] mixed $auth): bool; + public function auth(#[\SensitiveParameter] mixed $auth): bool { } /** * The INFO command returns information and statistics about Redis in a format @@ -838,7 +838,7 @@ public function auth(#[\SensitiveParameter] mixed $auth): bool; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function info(string ...$sections): \Relay\Relay|array|false; + public function info(string ...$sections): \Relay\Relay|array|false { } /** * Deletes all the keys of the currently selected database. @@ -847,7 +847,7 @@ public function info(string ...$sections): \Relay\Relay|array|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function flushdb(bool $async = false): \Relay\Relay|bool; + public function flushdb(bool $async = false): \Relay\Relay|bool { } /** * Deletes all the keys of all the existing databases, not just the currently selected one. @@ -856,7 +856,7 @@ public function flushdb(bool $async = false): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function flushall(bool $async = false): \Relay\Relay|bool; + public function flushall(bool $async = false): \Relay\Relay|bool { } /** * Invokes a Redis function. @@ -868,7 +868,7 @@ public function flushall(bool $async = false): \Relay\Relay|bool; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function fcall(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed; + public function fcall(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed { } /** * Invokes a read-only Redis function. @@ -880,7 +880,7 @@ public function fcall(string $name, array $argv = [], array $keys = [], callable * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function fcall_ro(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed; + public function fcall_ro(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed { } /** * Calls `FUNCTION` sub-command. @@ -890,7 +890,7 @@ public function fcall_ro(string $name, array $argv = [], array $keys = [], calla * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function function(string $op, string ...$args): mixed; + public function function(string $op, string ...$args): mixed { } /** * Flushes Relay's internal memory of all databases, or just the given database index. @@ -899,7 +899,7 @@ public function function(string $op, string ...$args): mixed; * @return bool */ #[\Relay\Attributes\Local] - public static function flushMemory(?string $key = null, int $db = -1): bool; + public static function flushMemory(?string $key = null, int $db = -1): bool { } /** * Returns the number of keys in the currently-selected database. @@ -907,7 +907,7 @@ public static function flushMemory(?string $key = null, int $db = -1): bool; * @return int */ #[\Relay\Attributes\RedisCommand] - public function dbsize(): \Relay\Relay|int|false; + public function dbsize(): \Relay\Relay|int|false { } /** * Serialize and return the value stored at key in a Redis-specific format. @@ -916,7 +916,7 @@ public function dbsize(): \Relay\Relay|int|false; * @return string|false */ #[\Relay\Attributes\RedisCommand] - public function dump(mixed $key): \Relay\Relay|string|false; + public function dump(mixed $key): \Relay\Relay|string|false { } /** * Attach or detach the instance as a replica of another instance. @@ -926,7 +926,7 @@ public function dump(mixed $key): \Relay\Relay|string|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function replicaof(?string $host = null, $port = 0): \Relay\Relay|bool; + public function replicaof(?string $host = null, $port = 0): \Relay\Relay|bool { } /** * Create a key associated with a value that is obtained by deserializing the provided serialized value. @@ -938,7 +938,7 @@ public function replicaof(?string $host = null, $port = 0): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function restore(mixed $key, int $ttl, string $value, ?array $options = null): \Relay\Relay|bool; + public function restore(mixed $key, int $ttl, string $value, ?array $options = null): \Relay\Relay|bool { } /** * Atomically transfer a key from a Redis instance to another one. @@ -963,7 +963,7 @@ public function migrate( bool $copy = false, bool $replace = false, #[\SensitiveParameter] mixed $credentials = null - ): \Relay\Relay|bool; + ): \Relay\Relay|bool { } /** * This command copies the value stored at the source key to the destination key. @@ -974,7 +974,7 @@ public function migrate( * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function copy(mixed $src, mixed $dst, ?array $options = NULL): \Relay\Relay|int|false; + public function copy(mixed $src, mixed $dst, ?array $options = NULL): \Relay\Relay|int|false { } /** * Asks Redis to echo back the provided string. @@ -983,7 +983,7 @@ public function copy(mixed $src, mixed $dst, ?array $options = NULL): \Relay\Rel * @return bool|string */ #[\Relay\Attributes\RedisCommand] - public function echo(string $arg): \Relay\Relay|bool|string; + public function echo(string $arg): \Relay\Relay|bool|string { } /** * Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk. @@ -992,7 +992,7 @@ public function echo(string $arg): \Relay\Relay|bool|string; * @return bool|string */ #[\Relay\Attributes\RedisCommand] - public function ping(string $arg = null): \Relay\Relay|bool|string; + public function ping(string $arg = null): \Relay\Relay|bool|string { } /** * Returns the number of milliseoconds since Relay has seen activity from the server. @@ -1000,7 +1000,7 @@ public function ping(string $arg = null): \Relay\Relay|bool|string; * @return int|false */ #[\Relay\Attributes\Local] - public function idleTime(): \Relay\Relay|int|false; + public function idleTime(): \Relay\Relay|int|false { } /** * Returns a random key from Redis. @@ -1008,7 +1008,7 @@ public function idleTime(): \Relay\Relay|int|false; * @return string|null|bool */ #[\Relay\Attributes\RedisCommand] - public function randomkey(): \Relay\Relay|string|null|bool; + public function randomkey(): \Relay\Relay|string|null|bool { } /** * Returns the current time from Redis. @@ -1016,7 +1016,7 @@ public function randomkey(): \Relay\Relay|string|null|bool; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function time(): \Relay\Relay|array|false; + public function time(): \Relay\Relay|array|false { } /** * Asynchronously rewrite the append-only file. @@ -1024,7 +1024,7 @@ public function time(): \Relay\Relay|array|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function bgrewriteaof(): \Relay\Relay|bool; + public function bgrewriteaof(): \Relay\Relay|bool { } /** * Returns the UNIX time stamp of the last successful save to disk. @@ -1032,7 +1032,7 @@ public function bgrewriteaof(): \Relay\Relay|bool; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lastsave(): \Relay\Relay|int|false; + public function lastsave(): \Relay\Relay|int|false { } /** * Asynchronously save the dataset to disk. @@ -1040,7 +1040,7 @@ public function lastsave(): \Relay\Relay|int|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function bgsave(): \Relay\Relay|bool; + public function bgsave(): \Relay\Relay|bool { } /** * Synchronously save the dataset to disk. @@ -1048,7 +1048,7 @@ public function bgsave(): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function save(): \Relay\Relay|bool; + public function save(): \Relay\Relay|bool { } /** * Returns the role of the instance in the context of replication. @@ -1056,7 +1056,7 @@ public function save(): \Relay\Relay|bool; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function role(): \Relay\Relay|array|false; + public function role(): \Relay\Relay|array|false { } /** * Returns the remaining time to live of a key that has a timeout in seconds. @@ -1065,7 +1065,7 @@ public function role(): \Relay\Relay|array|false; * @return int */ #[\Relay\Attributes\RedisCommand] - public function ttl(mixed $key): \Relay\Relay|int|false; + public function ttl(mixed $key): \Relay\Relay|int|false { } /** * Returns the remaining time to live of a key that has a timeout in milliseconds. @@ -1074,7 +1074,7 @@ public function ttl(mixed $key): \Relay\Relay|int|false; * @return int */ #[\Relay\Attributes\RedisCommand] - public function pttl(mixed $key): \Relay\Relay|int|false; + public function pttl(mixed $key): \Relay\Relay|int|false { } /** * Returns if key(s) exists. @@ -1083,7 +1083,7 @@ public function pttl(mixed $key): \Relay\Relay|int|false; * @return bool|int */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function exists(mixed ...$keys): \Relay\Relay|bool|int; + public function exists(mixed ...$keys): \Relay\Relay|bool|int { } /** * Evaluate script using the Lua interpreter. @@ -1096,7 +1096,7 @@ public function exists(mixed ...$keys): \Relay\Relay|bool|int; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function eval(mixed $script, array $args = [], int $num_keys = 0): mixed; + public function eval(mixed $script, array $args = [], int $num_keys = 0): mixed { } /** * Evaluate script using the Lua interpreter. This is just the "read-only" variant of EVAL @@ -1110,7 +1110,7 @@ public function eval(mixed $script, array $args = [], int $num_keys = 0): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function eval_ro(mixed $script, array $args = [], int $num_keys = 0): mixed; + public function eval_ro(mixed $script, array $args = [], int $num_keys = 0): mixed { } /** * Evaluates a script cached on the server-side by its SHA1 digest. @@ -1122,7 +1122,7 @@ public function eval_ro(mixed $script, array $args = [], int $num_keys = 0): mix * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function evalsha(string $sha, array $args = [], int $num_keys = 0): mixed; + public function evalsha(string $sha, array $args = [], int $num_keys = 0): mixed { } /** * Evaluates a script cached on the server-side by its SHA1 digest. This is just the "read-only" variant @@ -1134,7 +1134,7 @@ public function evalsha(string $sha, array $args = [], int $num_keys = 0): mixed * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function evalsha_ro(string $sha, array $args = [], int $num_keys = 0): mixed; + public function evalsha_ro(string $sha, array $args = [], int $num_keys = 0): mixed { } /** * Executes `CLIENT` command operations. @@ -1144,7 +1144,7 @@ public function evalsha_ro(string $sha, array $args = [], int $num_keys = 0): mi * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function client(string $operation, mixed ...$args): mixed; + public function client(string $operation, mixed ...$args): mixed { } /** * Add one or more members to a geospacial sorted set @@ -1163,7 +1163,7 @@ public function geoadd( float $lat, string $member, mixed ...$other_triples_and_options - ): \Relay\Relay|int|false; + ): \Relay\Relay|int|false { } /** * Get the distance between two members of a geospacially encoded sorted set. @@ -1175,7 +1175,7 @@ public function geoadd( * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function geodist(string $key, string $src, string $dst, ?string $unit = null): \Relay\Relay|float|false; + public function geodist(string $key, string $src, string $dst, ?string $unit = null): \Relay\Relay|float|false { } /** * Retrieve one or more GeoHash encoded strings for members of the set. @@ -1186,7 +1186,7 @@ public function geodist(string $key, string $src, string $dst, ?string $unit = n * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function geohash(string $key, string $member, string ...$other_members): \Relay\Relay|array|false; + public function geohash(string $key, string $member, string ...$other_members): \Relay\Relay|array|false { } /** * Retrieve members of a geospacially sorted set that are within a certain radius of a location. @@ -1200,7 +1200,7 @@ public function geohash(string $key, string $member, string ...$other_members): * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed; + public function georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed { } /** * Similar to `GEORADIUS` except it uses a member as the center of the query. @@ -1213,7 +1213,7 @@ public function georadius(string $key, float $lng, float $lat, float $radius, st * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []): mixed; + public function georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []): mixed { } /** * Similar to `GEORADIUS` except it uses a member as the center of the query. @@ -1226,7 +1226,7 @@ public function georadiusbymember(string $key, string $member, float $radius, st * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): mixed; + public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): mixed { } /** * Retrieve members of a geospacially sorted set that are within a certain radius of a location. @@ -1240,7 +1240,7 @@ public function georadiusbymember_ro(string $key, string $member, float $radius, * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed; + public function georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed { } /** * Search a geospacial sorted set for members in various ways. @@ -1259,7 +1259,7 @@ public function geosearch( array|int|float $shape, string $unit, array $options = [] - ): \Relay\Relay|array; + ): \Relay\Relay|array { } /** * Search a geospacial sorted set for members within a given area or range, storing the results into @@ -1281,7 +1281,7 @@ public function geosearchstore( array|int|float $shape, string $unit, array $options = [] - ): \Relay\Relay|int|false; + ): \Relay\Relay|int|false { } /** * Get the value of key. @@ -1290,7 +1290,7 @@ public function geosearchstore( * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function get(mixed $key): mixed; + public function get(mixed $key): mixed { } /** * Atomically sets key to value and returns the old value stored at key. @@ -1300,7 +1300,7 @@ public function get(mixed $key): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function getset(mixed $key, mixed $value): mixed; + public function getset(mixed $key, mixed $value): mixed { } /** * Returns the substring of the string value stored at key, @@ -1312,7 +1312,7 @@ public function getset(mixed $key, mixed $value): mixed; * @return string|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function getrange(mixed $key, int $start, int $end): \Relay\Relay|string|false; + public function getrange(mixed $key, int $start, int $end): \Relay\Relay|string|false { } /** * Overwrites part of the string stored at key, starting at @@ -1324,7 +1324,7 @@ public function getrange(mixed $key, int $start, int $end): \Relay\Relay|string| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function setrange(mixed $key, int $start, mixed $value): \Relay\Relay|int|false; + public function setrange(mixed $key, int $start, mixed $value): \Relay\Relay|int|false { } /** * Returns the bit value at offset in the string value stored at key. @@ -1334,7 +1334,7 @@ public function setrange(mixed $key, int $start, mixed $value): \Relay\Relay|int * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function getbit(mixed $key, int $pos): \Relay\Relay|int|false; + public function getbit(mixed $key, int $pos): \Relay\Relay|int|false { } /** * Count the number of set bits (population counting) in a string. @@ -1346,7 +1346,7 @@ public function getbit(mixed $key, int $pos): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit = false): \Relay\Relay|int|false; + public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit = false): \Relay\Relay|int|false { } /** * This is a container command for runtime configuration commands. @@ -1357,7 +1357,7 @@ public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit * @return array|bool */ #[\Relay\Attributes\RedisCommand] - public function config(string $operation, mixed $key = null, ?string $value = NULL): \Relay\Relay|array|bool; + public function config(string $operation, mixed $key = null, ?string $value = NULL): \Relay\Relay|array|bool { } /** * Return an array with details about every Redis command. @@ -1366,7 +1366,7 @@ public function config(string $operation, mixed $key = null, ?string $value = NU * @return array|int|false */ #[\Relay\Attributes\RedisCommand] - public function command(mixed ...$args): \Relay\Relay|array|int|false; + public function command(mixed ...$args): \Relay\Relay|array|int|false { } /** * Perform a bitwise operation on one or more keys, storing the result in a new key. @@ -1378,7 +1378,7 @@ public function command(mixed ...$args): \Relay\Relay|array|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function bitop(string $operation, string $dstkey, string $srckey, string ...$other_keys): \Relay\Relay|int|false; + public function bitop(string $operation, string $dstkey, string $srckey, string ...$other_keys): \Relay\Relay|int|false { } /** * Return the position of the first bit set to 1 or 0 in a string. @@ -1391,7 +1391,7 @@ public function bitop(string $operation, string $dstkey, string $srckey, string * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, bool $bybit = false): \Relay\Relay|int|false; + public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, bool $bybit = false): \Relay\Relay|int|false { } /** * Sets or clears the bit at offset in the string value stored at key. @@ -1402,7 +1402,7 @@ public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function setbit(mixed $key, int $pos, int $val): \Relay\Relay|int|false; + public function setbit(mixed $key, int $pos, int $val): \Relay\Relay|int|false { } /** * Interact with Redis' ACLs @@ -1412,7 +1412,7 @@ public function setbit(mixed $key, int $pos, int $val): \Relay\Relay|int|false; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function acl(string $cmd, string ...$args): mixed; + public function acl(string $cmd, string ...$args): mixed { } /** * If key already exists and is a string, this command appends @@ -1425,7 +1425,7 @@ public function acl(string $cmd, string ...$args): mixed; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function append(mixed $key, mixed $value): \Relay\Relay|int|false; + public function append(mixed $key, mixed $value): \Relay\Relay|int|false { } /** * Set key to hold the string value. If key already holds @@ -1437,7 +1437,7 @@ public function append(mixed $key, mixed $value): \Relay\Relay|int|false; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function set(mixed $key, mixed $value, mixed $options = null): mixed; + public function set(mixed $key, mixed $value, mixed $options = null): mixed { } /** * Get the value of key and optionally set its expiration. @@ -1448,7 +1448,7 @@ public function set(mixed $key, mixed $value, mixed $options = null): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function getex(mixed $key, ?array $options = NULL): mixed; + public function getex(mixed $key, ?array $options = NULL): mixed { } /** * Get the value of key and delete the key. This command is similar to GET, @@ -1459,7 +1459,7 @@ public function getex(mixed $key, ?array $options = NULL): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function getdel(mixed $key): mixed; + public function getdel(mixed $key): mixed { } /** * Set key to hold the string value and set key to timeout after a given number of seconds. @@ -1470,7 +1470,7 @@ public function getdel(mixed $key): mixed; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function setex(mixed $key, int $seconds, mixed $value): \Relay\Relay|bool; + public function setex(mixed $key, int $seconds, mixed $value): \Relay\Relay|bool { } /** * Adds the specified elements to the specified HyperLogLog. @@ -1480,7 +1480,7 @@ public function setex(mixed $key, int $seconds, mixed $value): \Relay\Relay|bool * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function pfadd(string $key, array $elements): \Relay\Relay|int|false; + public function pfadd(string $key, array $elements): \Relay\Relay|int|false { } /** * Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). @@ -1489,7 +1489,7 @@ public function pfadd(string $key, array $elements): \Relay\Relay|int|false; * @return int */ #[\Relay\Attributes\RedisCommand] - public function pfcount(string $key): \Relay\Relay|int; + public function pfcount(string $key): \Relay\Relay|int { } /** * Merge given HyperLogLogs into a single one. @@ -1498,7 +1498,7 @@ public function pfcount(string $key): \Relay\Relay|int; * @param array $srckeys * @return bool */ - public function pfmerge(string $dst, array $srckeys): \Relay\Relay|bool; + public function pfmerge(string $dst, array $srckeys): \Relay\Relay|bool { } /** * Set key to hold the string value and set key to timeout after a given number of milliseconds. @@ -1510,7 +1510,7 @@ public function pfmerge(string $dst, array $srckeys): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function psetex(mixed $key, int $milliseconds, mixed $value): \Relay\Relay|bool; + public function psetex(mixed $key, int $milliseconds, mixed $value): \Relay\Relay|bool { } /** * Posts a message to the given channel. @@ -1520,7 +1520,7 @@ public function psetex(mixed $key, int $milliseconds, mixed $value): \Relay\Rela * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function publish(string $channel, string $message): \Relay\Relay|int|false; + public function publish(string $channel, string $message): \Relay\Relay|int|false { } /** * Set key to hold string value if key does not exist. In that case, it is equal to SET. @@ -1532,7 +1532,7 @@ public function publish(string $channel, string $message): \Relay\Relay|int|fals * @return bool */ #[\Relay\Attributes\RedisCommand] - public function setnx(mixed $key, mixed $value): \Relay\Relay|bool; + public function setnx(mixed $key, mixed $value): \Relay\Relay|bool { } /** * Returns the values of all specified keys. @@ -1541,7 +1541,7 @@ public function setnx(mixed $key, mixed $value): \Relay\Relay|bool; * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function mget(array $keys): \Relay\Relay|array|false; + public function mget(array $keys): \Relay\Relay|array|false { } /** * Move key from the currently selected database to the specified destination database. @@ -1551,7 +1551,7 @@ public function mget(array $keys): \Relay\Relay|array|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function move(mixed $key, int $db): \Relay\Relay|int|false; + public function move(mixed $key, int $db): \Relay\Relay|int|false { } /** * Sets the given keys to their respective values. @@ -1561,7 +1561,7 @@ public function move(mixed $key, int $db): \Relay\Relay|int|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function mset(array $kvals): \Relay\Relay|bool; + public function mset(array $kvals): \Relay\Relay|bool { } /** * Sets the given keys to their respective values. @@ -1571,7 +1571,7 @@ public function mset(array $kvals): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function msetnx(array $kvals): \Relay\Relay|bool; + public function msetnx(array $kvals): \Relay\Relay|bool { } /** * Renames key. @@ -1581,7 +1581,7 @@ public function msetnx(array $kvals): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function rename(mixed $key, mixed $newkey): \Relay\Relay|bool; + public function rename(mixed $key, mixed $newkey): \Relay\Relay|bool { } /** * Renames key if the new key does not yet exist. @@ -1591,7 +1591,7 @@ public function rename(mixed $key, mixed $newkey): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function renamenx(mixed $key, mixed $newkey): \Relay\Relay|bool; + public function renamenx(mixed $key, mixed $newkey): \Relay\Relay|bool { } /** * Removes the specified keys. @@ -1600,7 +1600,7 @@ public function renamenx(mixed $key, mixed $newkey): \Relay\Relay|bool; * @return int|bool */ #[\Relay\Attributes\RedisCommand] - public function del(mixed ...$keys): \Relay\Relay|int|bool; + public function del(mixed ...$keys): \Relay\Relay|int|bool { } /** * Removes the specified keys without blocking Redis. @@ -1609,7 +1609,7 @@ public function del(mixed ...$keys): \Relay\Relay|int|bool; * @return int */ #[\Relay\Attributes\RedisCommand] - public function unlink(mixed ...$keys): \Relay\Relay|int|false; + public function unlink(mixed ...$keys): \Relay\Relay|int|false { } /** * Set a timeout on key. @@ -1620,7 +1620,7 @@ public function unlink(mixed ...$keys): \Relay\Relay|int|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function expire(mixed $key, int $seconds, ?string $mode = null): \Relay\Relay|bool; + public function expire(mixed $key, int $seconds, ?string $mode = null): \Relay\Relay|bool { } /** * Set a key's time to live in milliseconds. @@ -1630,7 +1630,7 @@ public function expire(mixed $key, int $seconds, ?string $mode = null): \Relay\R * @return bool */ #[\Relay\Attributes\RedisCommand] - public function pexpire(mixed $key, int $milliseconds): \Relay\Relay|bool; + public function pexpire(mixed $key, int $milliseconds): \Relay\Relay|bool { } /** * Set a timeout on key using a unix timestamp. @@ -1640,7 +1640,7 @@ public function pexpire(mixed $key, int $milliseconds): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function expireat(mixed $key, int $timestamp): \Relay\Relay|bool; + public function expireat(mixed $key, int $timestamp): \Relay\Relay|bool { } /** * Returns the absolute Unix timestamp in seconds at which the given key will expire. @@ -1651,7 +1651,7 @@ public function expireat(mixed $key, int $timestamp): \Relay\Relay|bool; * @return int|false * */ #[\Relay\Attributes\RedisCommand] - public function expiretime(mixed $key): \Relay\Relay|int|false; + public function expiretime(mixed $key): \Relay\Relay|int|false { } /** * Set the expiration for a key as a UNIX timestamp specified in milliseconds. @@ -1661,7 +1661,7 @@ public function expiretime(mixed $key): \Relay\Relay|int|false; * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] - public function pexpireat(mixed $key, int $timestamp_ms): \Relay\Relay|bool; + public function pexpireat(mixed $key, int $timestamp_ms): \Relay\Relay|bool { } /** * Semantic the same as EXPIRETIME, but returns the absolute Unix expiration @@ -1671,7 +1671,7 @@ public function pexpireat(mixed $key, int $timestamp_ms): \Relay\Relay|bool; * @return int|false * */ #[\Relay\Attributes\RedisCommand] - public function pexpiretime(mixed $key): \Relay\Relay|int|false; + public function pexpiretime(mixed $key): \Relay\Relay|int|false { } /** * Remove the existing timeout on key, turning the key from volatile to persistent. @@ -1680,7 +1680,7 @@ public function pexpiretime(mixed $key): \Relay\Relay|int|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function persist(mixed $key): \Relay\Relay|bool; + public function persist(mixed $key): \Relay\Relay|bool { } /** * Returns the type of a given key. @@ -1693,7 +1693,7 @@ public function persist(mixed $key): \Relay\Relay|bool; * @return int|string|false */ #[\Relay\Attributes\RedisCommand] - public function type(mixed $key): \Relay\Relay|int|string|bool; + public function type(mixed $key): \Relay\Relay|int|string|bool { } /** * Atomically returns and removes the first/last element of the list @@ -1707,7 +1707,7 @@ public function type(mixed $key): \Relay\Relay|int|string|bool; * @return string|null|false */ #[\Relay\Attributes\RedisCommand] - public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): \Relay\Relay|string|null|false; + public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): \Relay\Relay|string|null|false { } /** * BLMOVE is the blocking variant of LMOVE. When source contains elements, @@ -1722,7 +1722,7 @@ public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstp * @return string|null|false */ #[\Relay\Attributes\RedisCommand] - public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): \Relay\Relay|string|null|false; + public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): \Relay\Relay|string|null|false { } /** * Returns the specified elements of the list stored at key. @@ -1733,7 +1733,7 @@ public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dst * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function lrange(mixed $key, int $start, int $stop): \Relay\Relay|array|false; + public function lrange(mixed $key, int $start, int $stop): \Relay\Relay|array|false { } /** * Insert all the specified values at the head of the list stored at key. @@ -1744,7 +1744,7 @@ public function lrange(mixed $key, int $start, int $stop): \Relay\Relay|array|fa * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + public function lpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } /** * Insert all the specified values at the tail of the list stored at key. @@ -1755,7 +1755,7 @@ public function lpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function rpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + public function rpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } /** * Inserts specified values at the head of the list stored at key, @@ -1767,7 +1767,7 @@ public function rpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + public function lpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } /** * Inserts specified values at the tail of the list stored at key, @@ -1779,7 +1779,7 @@ public function lpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function rpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false; + public function rpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } /** * Sets the list element at index to element. @@ -1790,7 +1790,7 @@ public function rpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int * @return bool */ #[\Relay\Attributes\RedisCommand] - public function lset(mixed $key, int $index, mixed $mem): \Relay\Relay|bool; + public function lset(mixed $key, int $index, mixed $mem): \Relay\Relay|bool { } /** * Removes and returns the first elements of the list stored at key. @@ -1800,7 +1800,7 @@ public function lset(mixed $key, int $index, mixed $mem): \Relay\Relay|bool; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function lpop(mixed $key, int $count = 1): mixed; + public function lpop(mixed $key, int $count = 1): mixed { } /** * The command returns the index of matching elements inside a Redis list. @@ -1811,7 +1811,7 @@ public function lpop(mixed $key, int $count = 1): mixed; * @return int|array|false|null */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function lpos(mixed $key, mixed $value, ?array $options = null): \Relay\Relay|int|array|false|null; + public function lpos(mixed $key, mixed $value, ?array $options = null): \Relay\Relay|int|array|false|null { } /** * Removes and returns the last elements of the list stored at key. @@ -1821,7 +1821,7 @@ public function lpos(mixed $key, mixed $value, ?array $options = null): \Relay\R * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function rpop(mixed $key, int $count = 1): mixed; + public function rpop(mixed $key, int $count = 1): mixed { } /** * Atomically returns and removes the last element (tail) of the list stored at source, @@ -1832,7 +1832,7 @@ public function rpop(mixed $key, int $count = 1): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function rpoplpush(mixed $source, mixed $dest): mixed; + public function rpoplpush(mixed $source, mixed $dest): mixed { } /** * Atomically returns and removes the last element (tail) of the list stored at source, @@ -1845,7 +1845,7 @@ public function rpoplpush(mixed $source, mixed $dest): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed; + public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed { } /** * BLPOP is a blocking list pop primitive. It is the blocking version of LPOP because @@ -1857,7 +1857,7 @@ public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed; * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function blpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + public function blpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } /** * Pop elements from a list, or block until one is available @@ -1869,7 +1869,7 @@ public function blpop(string|array $key, string|float $timeout_or_key, mixed ... * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function blmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + public function blmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } /** * Remove and return members with scores in a sorted set or block until one is available @@ -1881,7 +1881,7 @@ public function blmpop(float $timeout, array $keys, string $from, int $count = 1 * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } /** * Pops one or more elements from the first non-empty list key from the list of provided key names. @@ -1892,7 +1892,7 @@ public function bzmpop(float $timeout, array $keys, string $from, int $count = 1 * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function lmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + public function lmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } /** * Pops one or more elements, that are member-score pairs, from the @@ -1904,7 +1904,7 @@ public function lmpop(array $keys, string $from, int $count = 1): \Relay\Relay|a * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function zmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false; + public function zmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } /** * BRPOP is a blocking list pop primitive. It is the blocking version of RPOP because @@ -1916,7 +1916,7 @@ public function zmpop(array $keys, string $from, int $count = 1): \Relay\Relay|a * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function brpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + public function brpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } /** * BZPOPMAX is the blocking variant of the sorted set ZPOPMAX primitive. @@ -1927,7 +1927,7 @@ public function brpop(string|array $key, string|float $timeout_or_key, mixed ... * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } /** * BZPOPMIN is the blocking variant of the sorted set ZPOPMIN primitive. @@ -1938,7 +1938,7 @@ public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false; + public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } /** * This is a container command for object introspection commands. @@ -1948,7 +1948,7 @@ public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function object(string $op, mixed $key): mixed; + public function object(string $op, mixed $key): mixed { } /** * Return the positions (longitude,latitude) of all the specified members @@ -1959,7 +1959,7 @@ public function object(string $op, mixed $key): mixed; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function geopos(mixed $key, mixed ...$members): \Relay\Relay|array|false; + public function geopos(mixed $key, mixed ...$members): \Relay\Relay|array|false { } /** * Removes the first count occurrences of elements equal to element from the list stored at key. @@ -1970,7 +1970,7 @@ public function geopos(mixed $key, mixed ...$members): \Relay\Relay|array|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lrem(mixed $key, mixed $mem, int $count = 0): \Relay\Relay|int|false; + public function lrem(mixed $key, mixed $mem, int $count = 0): \Relay\Relay|int|false { } /** * Returns the element at index index in the list stored at key. @@ -1980,7 +1980,7 @@ public function lrem(mixed $key, mixed $mem, int $count = 0): \Relay\Relay|int|f * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function lindex(mixed $key, int $index): mixed; + public function lindex(mixed $key, int $index): mixed { } /** * Inserts element in the list stored at key either before or after the reference value pivot. @@ -1992,7 +1992,7 @@ public function lindex(mixed $key, int $index): mixed; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): \Relay\Relay|int|false; + public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): \Relay\Relay|int|false { } /** * Trim an existing list so that it will contain only the specified range of elements specified. @@ -2003,7 +2003,7 @@ public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): \ * @return bool */ #[\Relay\Attributes\RedisCommand] - public function ltrim(mixed $key, int $start, int $end): \Relay\Relay|bool; + public function ltrim(mixed $key, int $start, int $end): \Relay\Relay|bool { } /** * Returns the value associated with field in the hash stored at key. @@ -2013,7 +2013,7 @@ public function ltrim(mixed $key, int $start, int $end): \Relay\Relay|bool; * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hget(mixed $hash, mixed $member): mixed; + public function hget(mixed $hash, mixed $member): mixed { } /** * Returns the string length of the value associated with field in the hash stored at key. @@ -2023,7 +2023,7 @@ public function hget(mixed $hash, mixed $member): mixed; * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hstrlen(mixed $hash, mixed $member): \Relay\Relay|int|false; + public function hstrlen(mixed $hash, mixed $member): \Relay\Relay|int|false { } /** * Returns all fields and values of the hash stored at key. @@ -2032,7 +2032,7 @@ public function hstrlen(mixed $hash, mixed $member): \Relay\Relay|int|false; * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hgetall(mixed $hash): \Relay\Relay|array|false; + public function hgetall(mixed $hash): \Relay\Relay|array|false { } /** * Returns all field names in the hash stored at key. @@ -2041,7 +2041,7 @@ public function hgetall(mixed $hash): \Relay\Relay|array|false; * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hkeys(mixed $hash): \Relay\Relay|array|false; + public function hkeys(mixed $hash): \Relay\Relay|array|false { } /** * Returns all values in the hash stored at key. @@ -2050,7 +2050,7 @@ public function hkeys(mixed $hash): \Relay\Relay|array|false; * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hvals(mixed $hash): \Relay\Relay|array|false; + public function hvals(mixed $hash): \Relay\Relay|array|false { } /** * Returns the values associated with the specified fields in the hash stored at key. @@ -2060,7 +2060,7 @@ public function hvals(mixed $hash): \Relay\Relay|array|false; * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hmget(mixed $hash, array $members): \Relay\Relay|array|false; + public function hmget(mixed $hash, array $members): \Relay\Relay|array|false { } /** * When called with just the key argument, return a random field from the hash value stored at key. @@ -2070,7 +2070,7 @@ public function hmget(mixed $hash, array $members): \Relay\Relay|array|false; * @return array|string|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hrandfield(mixed $hash, ?array $options = NULL): \Relay\Relay|array|string|false; + public function hrandfield(mixed $hash, ?array $options = NULL): \Relay\Relay|array|string|false { } /** * Sets the specified fields to their respective values in the hash stored at key. @@ -2080,7 +2080,7 @@ public function hrandfield(mixed $hash, ?array $options = NULL): \Relay\Relay|ar * @return bool */ #[\Relay\Attributes\RedisCommand] - public function hmset(mixed $hash, array $members): \Relay\Relay|bool; + public function hmset(mixed $hash, array $members): \Relay\Relay|bool { } /** * Returns if field is an existing field in the hash stored at key. @@ -2090,7 +2090,7 @@ public function hmset(mixed $hash, array $members): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hexists(mixed $hash, mixed $member): \Relay\Relay|bool; + public function hexists(mixed $hash, mixed $member): \Relay\Relay|bool { } /** * Sets field in the hash stored at key to value, only if field does not yet exist. @@ -2101,7 +2101,7 @@ public function hexists(mixed $hash, mixed $member): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function hsetnx(mixed $hash, mixed $member, mixed $value): \Relay\Relay|bool; + public function hsetnx(mixed $hash, mixed $member, mixed $value): \Relay\Relay|bool { } /** * Sets field in the hash stored at key to value. @@ -2113,7 +2113,7 @@ public function hsetnx(mixed $hash, mixed $member, mixed $value): \Relay\Relay|b * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): \Relay\Relay|int|false; + public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): \Relay\Relay|int|false { } /** * Removes the specified fields from the hash stored at key. @@ -2124,7 +2124,7 @@ public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): \Rela * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function hdel(mixed $key, mixed $mem, string ...$mems): \Relay\Relay|int|false; + public function hdel(mixed $key, mixed $mem, string ...$mems): \Relay\Relay|int|false { } /** * Increments the number stored at field in the hash stored at key by increment. @@ -2135,7 +2135,7 @@ public function hdel(mixed $key, mixed $mem, string ...$mems): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function hincrby(mixed $key, mixed $mem, int $value): \Relay\Relay|int|false; + public function hincrby(mixed $key, mixed $mem, int $value): \Relay\Relay|int|false { } /** * Increment the specified field of a hash stored at key, and representing @@ -2147,7 +2147,7 @@ public function hincrby(mixed $key, mixed $mem, int $value): \Relay\Relay|int|fa * @return float|bool */ #[\Relay\Attributes\RedisCommand] - public function hincrbyfloat(mixed $key, mixed $mem, float $value): \Relay\Relay|float|bool; + public function hincrbyfloat(mixed $key, mixed $mem, float $value): \Relay\Relay|float|bool { } /** * Increments the number stored at key by one. @@ -2157,7 +2157,7 @@ public function hincrbyfloat(mixed $key, mixed $mem, float $value): \Relay\Relay * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function incr(mixed $key, int $by = 1): \Relay\Relay|int|false; + public function incr(mixed $key, int $by = 1): \Relay\Relay|int|false { } /** * Decrements the number stored at key by one. @@ -2167,7 +2167,7 @@ public function incr(mixed $key, int $by = 1): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function decr(mixed $key, int $by = 1): \Relay\Relay|int|false; + public function decr(mixed $key, int $by = 1): \Relay\Relay|int|false { } /** * Increments the number stored at key by increment. @@ -2177,7 +2177,7 @@ public function decr(mixed $key, int $by = 1): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function incrby(mixed $key, int $value): \Relay\Relay|int|false; + public function incrby(mixed $key, int $value): \Relay\Relay|int|false { } /** * Decrements the number stored at key by decrement. @@ -2187,7 +2187,7 @@ public function incrby(mixed $key, int $value): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function decrby(mixed $key, int $value): \Relay\Relay|int|false; + public function decrby(mixed $key, int $value): \Relay\Relay|int|false { } /** * Increment the string representing a floating point number stored at key by the specified increment. @@ -2197,7 +2197,7 @@ public function decrby(mixed $key, int $value): \Relay\Relay|int|false; * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function incrbyfloat(mixed $key, float $value): \Relay\Relay|float|false; + public function incrbyfloat(mixed $key, float $value): \Relay\Relay|float|false { } /** * Returns the members of the set resulting from the difference between the first set and all the successive sets. @@ -2207,7 +2207,7 @@ public function incrbyfloat(mixed $key, float $value): \Relay\Relay|float|false; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sdiff(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false; + public function sdiff(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false { } /** * This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination. @@ -2218,7 +2218,7 @@ public function sdiff(mixed $key, mixed ...$other_keys): \Relay\Relay|array|fals * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sdiffstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false; + public function sdiffstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false { } /** * Returns the members of the set resulting from the intersection of all the given sets. @@ -2228,7 +2228,7 @@ public function sdiffstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|f * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sinter(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false; + public function sinter(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false { } /** * Intersect multiple sets and return the cardinality of the result. @@ -2238,7 +2238,7 @@ public function sinter(mixed $key, mixed ...$other_keys): \Relay\Relay|array|fal * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sintercard(array $keys, int $limit = -1): \Relay\Relay|int|false; + public function sintercard(array $keys, int $limit = -1): \Relay\Relay|int|false { } /** * This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination. @@ -2249,7 +2249,7 @@ public function sintercard(array $keys, int $limit = -1): \Relay\Relay|int|false * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sinterstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false; + public function sinterstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false { } /** * Returns the members of the set resulting from the union of all the given sets. @@ -2259,7 +2259,7 @@ public function sinterstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int| * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sunion(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false; + public function sunion(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false { } /** * This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination. @@ -2270,7 +2270,7 @@ public function sunion(mixed $key, mixed ...$other_keys): \Relay\Relay|array|fal * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sunionstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false; + public function sunionstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false { } /** * Alters the last access time of a key(s). @@ -2280,7 +2280,7 @@ public function sunionstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function touch(array|string $key_or_array, mixed ...$more_keys): \Relay\Relay|int|false; + public function touch(array|string $key_or_array, mixed ...$more_keys): \Relay\Relay|int|false { } /** * A pipeline block is simply transmitted faster to the server (like `MULTI`), but without any guarantee of atomicity. @@ -2288,7 +2288,7 @@ public function touch(array|string $key_or_array, mixed ...$more_keys): \Relay\R * @return bool|\Relay\Relay */ #[\Relay\Attributes\Local] - public function pipeline(): \Relay\Relay|bool; + public function pipeline(): \Relay\Relay|bool { } /** * Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC. @@ -2299,7 +2299,7 @@ public function pipeline(): \Relay\Relay|bool; * @return bool|\Relay\Relay */ #[\Relay\Attributes\RedisCommand] - public function multi(int $mode = 0): \Relay\Relay|bool; + public function multi(int $mode = 0): \Relay\Relay|bool { } /** * Executes all previously queued commands in a transaction and restores the connection state to normal. @@ -2307,7 +2307,7 @@ public function multi(int $mode = 0): \Relay\Relay|bool; * @return array|bool */ #[\Relay\Attributes\RedisCommand] - public function exec(): \Relay\Relay|array|bool; + public function exec(): \Relay\Relay|array|bool { } /** * Wait for the synchronous replication of all the write @@ -2318,7 +2318,7 @@ public function exec(): \Relay\Relay|array|bool; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function wait(int $replicas, $timeout): \Relay\Relay|int|false; + public function wait(int $replicas, $timeout): \Relay\Relay|int|false { } /** * Marks the given keys to be watched for conditional execution of a transaction. @@ -2328,7 +2328,7 @@ public function wait(int $replicas, $timeout): \Relay\Relay|int|false; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function watch(mixed $key, mixed ...$other_keys): \Relay\Relay|bool; + public function watch(mixed $key, mixed ...$other_keys): \Relay\Relay|bool { } /** * Flushes all the previously watched keys for a transaction. @@ -2337,7 +2337,7 @@ public function watch(mixed $key, mixed ...$other_keys): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function unwatch(): \Relay\Relay|bool; + public function unwatch(): \Relay\Relay|bool { } /** * Flushes all previously queued commands in a transaction and restores the connection state to normal. @@ -2346,7 +2346,7 @@ public function unwatch(): \Relay\Relay|bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function discard(): bool; + public function discard(): bool { } /** * Get the mode Relay is currently in. @@ -2356,7 +2356,7 @@ public function discard(): bool; * @return int */ #[\Relay\Attributes\Local] - public function getMode(bool $masked = false): int; + public function getMode(bool $masked = false): int { } /** * Clear the accumulated sent and received bytes. @@ -2364,7 +2364,7 @@ public function getMode(bool $masked = false): int; * @return void */ #[\Relay\Attributes\Local] - public function clearBytes(): void; + public function clearBytes(): void { } /** * Scan the keyspace for matching keys. @@ -2376,7 +2376,7 @@ public function clearBytes(): void; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function scan(mixed &$iterator, mixed $match = null, int $count = 0, ?string $type = null): array|false; + public function scan(mixed &$iterator, mixed $match = null, int $count = 0, ?string $type = null): array|false { } /** * Iterates fields of Hash types and their associated values. @@ -2388,7 +2388,7 @@ public function scan(mixed &$iterator, mixed $match = null, int $count = 0, ?str * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function hscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false; + public function hscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false { } /** * Iterates elements of Sets types. @@ -2400,7 +2400,7 @@ public function hscan(mixed $key, mixed &$iterator, mixed $match = null, int $co * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false; + public function sscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false { } /** * Iterates elements of Sorted Set types and their associated scores. @@ -2412,7 +2412,7 @@ public function sscan(mixed $key, mixed &$iterator, mixed $match = null, int $co * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false; + public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false { } /** * Returns all keys matching pattern. @@ -2421,7 +2421,7 @@ public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $co * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function keys(mixed $pattern): \Relay\Relay|array|false; + public function keys(mixed $pattern): \Relay\Relay|array|false { } /** * Interact with the Redis slowlog. @@ -2431,7 +2431,7 @@ public function keys(mixed $pattern): \Relay\Relay|array|false; * @return array|int|bool */ #[\Relay\Attributes\RedisCommand] - public function slowlog(string $operation, string ...$extra_args): \Relay\Relay|array|int|bool; + public function slowlog(string $operation, string ...$extra_args): \Relay\Relay|array|int|bool { } /** * Returns all the members of the set value stored at `$key`. @@ -2440,7 +2440,7 @@ public function slowlog(string $operation, string ...$extra_args): \Relay\Relay| * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function smembers(mixed $set): \Relay\Relay|array|false; + public function smembers(mixed $set): \Relay\Relay|array|false { } /** * Returns if `$member` is a member of the set stored at `$key`. @@ -2450,7 +2450,7 @@ public function smembers(mixed $set): \Relay\Relay|array|false; * @return bool */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function sismember(mixed $set, mixed $member): \Relay\Relay|bool; + public function sismember(mixed $set, mixed $member): \Relay\Relay|bool { } /** * Returns whether each member is a member of the set stored at `$key`. @@ -2460,7 +2460,7 @@ public function sismember(mixed $set, mixed $member): \Relay\Relay|bool; * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function smismember(mixed $set, mixed ...$members): \Relay\Relay|array|false; + public function smismember(mixed $set, mixed ...$members): \Relay\Relay|array|false { } /** * Remove the specified members from the set stored at `$key`. @@ -2471,7 +2471,7 @@ public function smismember(mixed $set, mixed ...$members): \Relay\Relay|array|fa * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function srem(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false; + public function srem(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false { } /** * Add the specified members to the set stored at `$key`. @@ -2482,7 +2482,7 @@ public function srem(mixed $set, mixed $member, mixed ...$members): \Relay\Relay * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sadd(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false; + public function sadd(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false { } /** * Sort the elements in a list, set or sorted set. @@ -2492,7 +2492,7 @@ public function sadd(mixed $set, mixed $member, mixed ...$members): \Relay\Relay * @return array|int|false */ #[\Relay\Attributes\RedisCommand] - public function sort(mixed $key, array $options = []): \Relay\Relay|array|int|false; + public function sort(mixed $key, array $options = []): \Relay\Relay|array|int|false { } /** * Sort the elements in a list, set or sorted set. Read-only variant of SORT. @@ -2502,7 +2502,7 @@ public function sort(mixed $key, array $options = []): \Relay\Relay|array|int|fa * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sort_ro(mixed $key, array $options = []): \Relay\Relay|array|false; + public function sort_ro(mixed $key, array $options = []): \Relay\Relay|array|false { } /** * Move member from the set at source to the set at destination. @@ -2513,7 +2513,7 @@ public function sort_ro(mixed $key, array $options = []): \Relay\Relay|array|fal * @return bool */ #[\Relay\Attributes\RedisCommand] - public function smove(mixed $srcset, mixed $dstset, mixed $member): \Relay\Relay|bool; + public function smove(mixed $srcset, mixed $dstset, mixed $member): \Relay\Relay|bool { } /** * Removes and returns one or more random members from the set value store at `$key`. @@ -2523,7 +2523,7 @@ public function smove(mixed $srcset, mixed $dstset, mixed $member): \Relay\Relay * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function spop(mixed $set, int $count = 1): mixed; + public function spop(mixed $set, int $count = 1): mixed { } /** * Returns one or multiple random members from a set. @@ -2533,7 +2533,7 @@ public function spop(mixed $set, int $count = 1): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function srandmember(mixed $set, int $count = 1): mixed; + public function srandmember(mixed $set, int $count = 1): mixed { } /** * Returns the set cardinality (number of elements) of the set stored at `$key`. @@ -2542,7 +2542,7 @@ public function srandmember(mixed $set, int $count = 1): mixed; * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function scard(mixed $key): \Relay\Relay|int|false; + public function scard(mixed $key): \Relay\Relay|int|false { } /** * Execute a script management command. @@ -2552,7 +2552,7 @@ public function scard(mixed $key): \Relay\Relay|int|false; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function script(string $command, string ...$args): mixed; + public function script(string $command, string ...$args): mixed { } /** * Returns the length of the string value stored at `$key`. @@ -2561,7 +2561,7 @@ public function script(string $command, string ...$args): mixed; * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function strlen(mixed $key): \Relay\Relay|int|false; + public function strlen(mixed $key): \Relay\Relay|int|false { } /** * Returns the number of fields contained in the hash stored at `$key`. @@ -2570,7 +2570,7 @@ public function strlen(mixed $key): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hlen(mixed $key): \Relay\Relay|int|false; + public function hlen(mixed $key): \Relay\Relay|int|false { } /** * Returns the length of the list stored at `$key`. @@ -2579,7 +2579,7 @@ public function hlen(mixed $key): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function llen(mixed $key): \Relay\Relay|int|false; + public function llen(mixed $key): \Relay\Relay|int|false { } /** * Acknowledge one or more IDs as having been processed by the consumer group. @@ -2590,7 +2590,7 @@ public function llen(mixed $key): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function xack(mixed $key, string $group, array $ids): \Relay\Relay|int|false; + public function xack(mixed $key, string $group, array $ids): \Relay\Relay|int|false { } /** * Append a message to a stream. @@ -2609,7 +2609,7 @@ public function xadd( int $maxlen = 0, bool $approx = false, bool $nomkstream = false - ): \Relay\Relay|string|false; + ): \Relay\Relay|string|false { } /** * Claim ownership of stream message(s). @@ -2630,7 +2630,7 @@ public function xclaim( int $min_idle, array $ids, array $options - ): \Relay\Relay|array|bool; + ): \Relay\Relay|array|bool { } /** * Automatically take ownership of stream message(s) by metrics @@ -2653,7 +2653,7 @@ public function xautoclaim( string $start, int $count = -1, bool $justid = false - ): \Relay\Relay|bool|array; + ): \Relay\Relay|bool|array { } /** * Get the length of a stream. @@ -2662,7 +2662,7 @@ public function xautoclaim( * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function xlen(string $key): \Relay\Relay|int|false; + public function xlen(string $key): \Relay\Relay|int|false { } /** * Perform utility operations having to do with consumer groups @@ -2683,7 +2683,7 @@ public function xgroup( string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2 - ): mixed; + ): mixed { } /** * Remove one or more specific IDs from a stream. @@ -2693,7 +2693,7 @@ public function xgroup( * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function xdel(string $key, array $ids): \Relay\Relay|int|false; + public function xdel(string $key, array $ids): \Relay\Relay|int|false { } /** * Retrieve information about a stream key. @@ -2705,7 +2705,7 @@ public function xdel(string $key, array $ids): \Relay\Relay|int|false; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1): mixed; + public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1): mixed { } /** * Query pending entries in a stream. @@ -2728,7 +2728,7 @@ public function xpending( int $count = -1, ?string $consumer = null, int $idle = 0 - ): \Relay\Relay|array|false; + ): \Relay\Relay|array|false { } /** * Lists elements in a stream. @@ -2740,7 +2740,7 @@ public function xpending( * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function xrange(mixed $key, string $start, string $end, int $count = -1): \Relay\Relay|array|false; + public function xrange(mixed $key, string $start, string $end, int $count = -1): \Relay\Relay|array|false { } /** * Get a range of entries from a STREAM ke in reverse chronological order. @@ -2752,7 +2752,7 @@ public function xrange(mixed $key, string $start, string $end, int $count = -1): * @return array|bool */ #[\Relay\Attributes\RedisCommand] - public function xrevrange(string $key, string $end, string $start, int $count = -1): \Relay\Relay|array|bool; + public function xrevrange(string $key, string $end, string $start, int $count = -1): \Relay\Relay|array|bool { } /** * Read messages from a stream. @@ -2763,7 +2763,7 @@ public function xrevrange(string $key, string $end, string $start, int $count = * @return array|bool|null */ #[\Relay\Attributes\RedisCommand] - public function xread(array $streams, int $count = -1, int $block = -1): \Relay\Relay|array|bool|null; + public function xread(array $streams, int $count = -1, int $block = -1): \Relay\Relay|array|bool|null { } /** * Read messages from a stream using a consumer group. @@ -2782,7 +2782,7 @@ public function xreadgroup( array $streams, int $count = 1, int $block = 1 - ): \Relay\Relay|array|bool|null; + ): \Relay\Relay|array|bool|null { } /** * Truncate a STREAM key in various ways. @@ -2801,7 +2801,7 @@ public function xtrim( bool $approx = false, bool $minid = false, int $limit = -1 - ): \Relay\Relay|int|false; + ): \Relay\Relay|int|false { } /** * Adds all the specified members with the specified scores to the sorted set stored at key. @@ -2811,7 +2811,7 @@ public function xtrim( * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function zadd(mixed $key, mixed ...$args): mixed; + public function zadd(mixed $key, mixed ...$args): mixed { } /** * When called with just the key argument, return a random element from the sorted set value stored at key. @@ -2822,7 +2822,7 @@ public function zadd(mixed $key, mixed ...$args): mixed; * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function zrandmember(mixed $key, ?array $options = NULL): mixed; + public function zrandmember(mixed $key, ?array $options = NULL): mixed { } /** * Returns the specified range of elements in the sorted set stored at key. @@ -2834,7 +2834,7 @@ public function zrandmember(mixed $key, ?array $options = NULL): mixed; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrange(mixed $key, string $start, string $end, mixed $options = null): \Relay\Relay|array|false; + public function zrange(mixed $key, string $start, string $end, mixed $options = null): \Relay\Relay|array|false { } /** * Returns the specified range of elements in the sorted set stored at key. @@ -2846,7 +2846,7 @@ public function zrange(mixed $key, string $start, string $end, mixed $options = * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrange(mixed $key, int $start, int $end, mixed $options = null): \Relay\Relay|array|false; + public function zrevrange(mixed $key, int $start, int $end, mixed $options = null): \Relay\Relay|array|false { } /** * Returns all the elements in the sorted set at key with a score between @@ -2859,7 +2859,7 @@ public function zrevrange(mixed $key, int $start, int $end, mixed $options = nul * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false; + public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false { } /** * Returns all the elements in the sorted set at key with a score between @@ -2872,7 +2872,7 @@ public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $optio * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false; + public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false { } /** * Returns all the elements in the sorted set at key with a score between @@ -2886,7 +2886,7 @@ public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $op * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|int|false; + public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|int|false { } /** * When all the elements in a sorted set are inserted with the same score, @@ -2901,7 +2901,7 @@ public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mi * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1): \Relay\Relay|array|false; + public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1): \Relay\Relay|array|false { } /** * When all the elements in a sorted set are inserted with the same score, @@ -2916,7 +2916,7 @@ public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1 * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = -1, int $count = -1): \Relay\Relay|array|false; + public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = -1, int $count = -1): \Relay\Relay|array|false { } /** * Returns the rank of member in the sorted set stored at key, with the scores @@ -2928,7 +2928,7 @@ public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrank(mixed $key, mixed $rank): \Relay\Relay|int|false; + public function zrank(mixed $key, mixed $rank): \Relay\Relay|int|false { } /** * Returns the rank of member in the sorted set stored at key, with the scores @@ -2940,7 +2940,7 @@ public function zrank(mixed $key, mixed $rank): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrank(mixed $key, mixed $rank): \Relay\Relay|int|false; + public function zrevrank(mixed $key, mixed $rank): \Relay\Relay|int|false { } /** * Removes the specified members from the sorted set stored at key. @@ -2951,7 +2951,7 @@ public function zrevrank(mixed $key, mixed $rank): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrem(mixed $key, mixed ...$args): \Relay\Relay|int|false; + public function zrem(mixed $key, mixed ...$args): \Relay\Relay|int|false { } /** * When all the elements in a sorted set are inserted with the same score, @@ -2965,7 +2965,7 @@ public function zrem(mixed $key, mixed ...$args): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zremrangebylex(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + public function zremrangebylex(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } /** * Removes all elements in the sorted set stored at key with rank between @@ -2978,7 +2978,7 @@ public function zremrangebylex(mixed $key, mixed $min, mixed $max): \Relay\Relay * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zremrangebyrank(mixed $key, int $start, int $end): \Relay\Relay|int|false; + public function zremrangebyrank(mixed $key, int $start, int $end): \Relay\Relay|int|false { } /** * Removes all elements in the sorted set stored at key with @@ -2990,7 +2990,7 @@ public function zremrangebyrank(mixed $key, int $start, int $end): \Relay\Relay| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zremrangebyscore(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + public function zremrangebyscore(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } /** * Returns the sorted set cardinality (number of elements) of the sorted set stored at key. @@ -2999,7 +2999,7 @@ public function zremrangebyscore(mixed $key, mixed $min, mixed $max): \Relay\Rel * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function zcard(mixed $key): \Relay\Relay|int|false; + public function zcard(mixed $key): \Relay\Relay|int|false { } /** * Returns the number of elements in the sorted set at key with a score between min and max. @@ -3010,7 +3010,7 @@ public function zcard(mixed $key): \Relay\Relay|int|false; * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + public function zcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } /** * This command is similar to ZDIFFSTORE, but instead of storing the @@ -3021,7 +3021,7 @@ public function zcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|fal * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zdiff(array $keys, ?array $options = null): \Relay\Relay|array|false; + public function zdiff(array $keys, ?array $options = null): \Relay\Relay|array|false { } /** * Computes the difference between the first and all successive @@ -3032,7 +3032,7 @@ public function zdiff(array $keys, ?array $options = null): \Relay\Relay|array|f * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zdiffstore(mixed $dst, array $keys): \Relay\Relay|int|false; + public function zdiffstore(mixed $dst, array $keys): \Relay\Relay|int|false { } /** * Increments the score of member in the sorted set stored at key by increment. @@ -3043,7 +3043,7 @@ public function zdiffstore(mixed $dst, array $keys): \Relay\Relay|int|false; * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function zincrby(mixed $key, float $score, mixed $mem): \Relay\Relay|float|false; + public function zincrby(mixed $key, float $score, mixed $mem): \Relay\Relay|float|false { } /** * When all the elements in a sorted set are inserted with the same score, @@ -3056,7 +3056,7 @@ public function zincrby(mixed $key, float $score, mixed $mem): \Relay\Relay|floa * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zlexcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false; + public function zlexcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } /** * Returns the scores associated with the specified members in the sorted set stored at key. @@ -3066,7 +3066,7 @@ public function zlexcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int| * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zmscore(mixed $key, mixed ...$mems): \Relay\Relay|array|false; + public function zmscore(mixed $key, mixed ...$mems): \Relay\Relay|array|false { } /** * Returns the score of member in the sorted set at key. @@ -3076,7 +3076,7 @@ public function zmscore(mixed $key, mixed ...$mems): \Relay\Relay|array|false; * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function zscore(mixed $key, mixed $member): \Relay\Relay|float|false; + public function zscore(mixed $key, mixed $member): \Relay\Relay|float|false { } /** * This command is similar to ZINTERSTORE, but instead of storing @@ -3088,7 +3088,7 @@ public function zscore(mixed $key, mixed $member): \Relay\Relay|float|false; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zinter(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false; + public function zinter(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false { } /** * Intersect multiple sorted sets and return the cardinality of the result. @@ -3098,7 +3098,7 @@ public function zinter(array $keys, ?array $weights = null, mixed $options = nul * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zintercard(array $keys, int $limit = -1): \Relay\Relay|int|false; + public function zintercard(array $keys, int $limit = -1): \Relay\Relay|int|false { } /** * Computes the intersection of numkeys sorted sets given by the @@ -3111,7 +3111,7 @@ public function zintercard(array $keys, int $limit = -1): \Relay\Relay|int|false * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false; + public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false { } /** * This command is similar to ZUNIONSTORE, but instead of storing @@ -3123,7 +3123,7 @@ public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mix * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zunion(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false; + public function zunion(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false { } /** * Computes the union of numkeys sorted sets given by the @@ -3136,7 +3136,7 @@ public function zunion(array $keys, ?array $weights = null, mixed $options = nul * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false; + public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false { } /** * Removes and returns up to count members with the lowest @@ -3147,7 +3147,7 @@ public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mix * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zpopmin(mixed $key, int $count = 1): \Relay\Relay|array|false; + public function zpopmin(mixed $key, int $count = 1): \Relay\Relay|array|false { } /** * Removes and returns up to count members with the highest @@ -3158,7 +3158,7 @@ public function zpopmin(mixed $key, int $count = 1): \Relay\Relay|array|false; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zpopmax(mixed $key, int $count = 1): \Relay\Relay|array|false; + public function zpopmax(mixed $key, int $count = 1): \Relay\Relay|array|false { } /** * Returns keys cached in runtime memory. @@ -3167,5 +3167,5 @@ public function zpopmax(mixed $key, int $count = 1): \Relay\Relay|array|false; * @return mixed */ #[\Relay\Attributes\Local] - public function _getKeys(); + public function _getKeys() { } } diff --git a/relay/Sentinel.php b/relay/Sentinel.php index 49b023736..da92c07d1 100644 --- a/relay/Sentinel.php +++ b/relay/Sentinel.php @@ -44,7 +44,7 @@ public function __construct( int $retry_interval = 0, float $read_timeout = 0, #[\SensitiveParameter] mixed $auth = null - ); + ) { } /** * Check if the current Sentinel configuration is able to reach the quorum needed @@ -54,7 +54,7 @@ public function __construct( * @return bool */ #[\Relay\Attributes\RedisCommand] - public function ckquorum(string $master): bool; + public function ckquorum(string $master): bool { } /** * Force a failover as if the master was not reachable, @@ -64,7 +64,7 @@ public function ckquorum(string $master): bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function failover(string $master): bool; + public function failover(string $master): bool { } /** * Force Sentinel to rewrite its configuration on disk, @@ -73,7 +73,7 @@ public function failover(string $master): bool; * @return bool */ #[\Relay\Attributes\RedisCommand] - public function flushconfig(): bool; + public function flushconfig(): bool { } /** * Returns the ip and port number of the master with that name. @@ -82,7 +82,7 @@ public function flushconfig(): bool; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function getMasterAddrByName(string $master): array|false; + public function getMasterAddrByName(string $master): array|false { } /** * Returns the state and info of the specified master. @@ -91,7 +91,7 @@ public function getMasterAddrByName(string $master): array|false; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function master(string $master): array|false; + public function master(string $master): array|false { } /** * Returns a list of monitored masters and their state. @@ -99,7 +99,7 @@ public function master(string $master): array|false; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function masters(): array|false; + public function masters(): array|false { } /** * Returns the ID of the Sentinel instance. @@ -107,7 +107,7 @@ public function masters(): array|false; * @return string */ #[\Relay\Attributes\RedisCommand] - public function myid(): string; + public function myid(): string { } /** * Returns PONG if no message is provided, otherwise returns the message. @@ -116,7 +116,7 @@ public function myid(): string; * @return string|bool */ #[\Relay\Attributes\RedisCommand] - public function ping(?string $message = null): string|bool; + public function ping(?string $message = null): string|bool { } /** * Will reset all the masters with matching name. @@ -125,7 +125,7 @@ public function ping(?string $message = null): string|bool; * @return int */ #[\Relay\Attributes\RedisCommand] - public function reset(string $pattern): int; + public function reset(string $pattern): int { } /** * Returns a list of sentinel instances for this master, and their state. @@ -134,7 +134,7 @@ public function reset(string $pattern): int; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sentinels(string $master): array|false; + public function sentinels(string $master): array|false { } /** * Show a list of replicas for this master, and their state. @@ -143,7 +143,7 @@ public function sentinels(string $master): array|false; * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function slaves(string $master): array|false; + public function slaves(string $master): array|false { } /** * Returns the last error message, if any. @@ -151,7 +151,7 @@ public function slaves(string $master): array|false; * @return string|null */ #[\Relay\Attributes\Local] - public function getLastError(): string|null; + public function getLastError(): string|null { } /** * Sets a client option. @@ -161,7 +161,7 @@ public function getLastError(): string|null; * @return bool */ #[\Relay\Attributes\Local] - public function setOption(int $option, mixed $value): bool; + public function setOption(int $option, mixed $value): bool { } /** * Returns a client option. @@ -170,5 +170,5 @@ public function setOption(int $option, mixed $value): bool; * @return mixed */ #[\Relay\Attributes\Local] - public function getOption(int $option): mixed; + public function getOption(int $option): mixed { } } From e81d3b153ee6683ae578b750b2d0b93bfc315845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Thu, 12 Jan 2023 16:04:23 -0800 Subject: [PATCH 271/419] fix formatting --- relay/Event.php | 5 +- relay/Exception.php | 4 +- relay/KeyType.php | 3 +- relay/Relay.php | 504 ++++++++++++++++++++++---------------------- relay/Sentinel.php | 33 +-- 5 files changed, 275 insertions(+), 274 deletions(-) diff --git a/relay/Event.php b/relay/Event.php index 4eb5a7b5f..977b5ef00 100644 --- a/relay/Event.php +++ b/relay/Event.php @@ -5,7 +5,8 @@ /** * Relay event class. */ -final class Event { +final class Event +{ /** * The integer representing the `INVALIDATED` event. * @@ -18,8 +19,8 @@ final class Event { * * @var int */ - public const Invalidated = 1; + /** * The integer representing the `FLUSHED` event. * diff --git a/relay/Exception.php b/relay/Exception.php index 0bdd82a2f..b23a258dd 100644 --- a/relay/Exception.php +++ b/relay/Exception.php @@ -5,6 +5,4 @@ /** * Generic Relay exception. */ -class Exception extends \Exception { - // -} +class Exception extends \Exception {} diff --git a/relay/KeyType.php b/relay/KeyType.php index bb824d1d4..96a865361 100644 --- a/relay/KeyType.php +++ b/relay/KeyType.php @@ -5,7 +5,8 @@ /** * A collection of Redis data types. */ -enum KeyType: int { +enum KeyType: int +{ /** * @see Relay::REDIS_NOT_FOUND */ diff --git a/relay/Relay.php b/relay/Relay.php index 46f95b971..c73182db4 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -5,7 +5,8 @@ /** * Relay client. */ -class Relay { +class Relay +{ /** * Relay's version. * @@ -390,7 +391,7 @@ public function __construct( float $command_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0, - ) { } + ) {} /** * Establishes a new connection to Redis. @@ -416,7 +417,7 @@ public function connect( float $read_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0 - ): bool { } + ): bool {} /** * Establishes a persistent connection to Redis. @@ -441,7 +442,7 @@ public function pconnect( float $read_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0 - ): bool { } + ): bool {} /** * Closes the current connection, unless it's persistent. @@ -449,7 +450,7 @@ public function pconnect( * @return bool */ #[\Relay\Attributes\Local] - public function close(): bool { } + public function close(): bool {} /** * Closes the current connection, if it's persistent. @@ -457,7 +458,7 @@ public function close(): bool { } * @return bool */ #[\Relay\Attributes\Local] - public function pclose(): bool { } + public function pclose(): bool {} /** * Registers a new event listener. @@ -466,7 +467,7 @@ public function pclose(): bool { } * @return bool */ #[\Relay\Attributes\Local] - public function listen(?callable $callback): bool { } + public function listen(?callable $callback): bool {} /** * Registers a new `flushed` event listener. @@ -475,7 +476,7 @@ public function listen(?callable $callback): bool { } * @return bool */ #[\Relay\Attributes\Local] - public function onFlushed(?callable $callback): bool { } + public function onFlushed(?callable $callback): bool {} /** * Registers a new `invalidated` event listener. @@ -485,7 +486,7 @@ public function onFlushed(?callable $callback): bool { } * @return bool */ #[\Relay\Attributes\Local] - public function onInvalidated(?callable $callback, ?string $pattern = null): bool { } + public function onInvalidated(?callable $callback, ?string $pattern = null): bool {} /** * Dispatches all pending events. @@ -493,7 +494,7 @@ public function onInvalidated(?callable $callback, ?string $pattern = null): boo * @return int|false */ #[\Relay\Attributes\Local] - public function dispatchEvents(): int|false { } + public function dispatchEvents(): int|false {} /** * Returns a client option. @@ -502,7 +503,7 @@ public function dispatchEvents(): int|false { } * @return mixed */ #[\Relay\Attributes\Local] - public function getOption(int $option): mixed { } + public function getOption(int $option): mixed {} /** * Returns or sets a client option. @@ -512,7 +513,7 @@ public function getOption(int $option): mixed { } * @return mixed */ #[\Relay\Attributes\Local] - public function option(int $option, mixed $value = null): mixed { } + public function option(int $option, mixed $value = null): mixed {} /** * Sets a client option. @@ -543,7 +544,7 @@ public function option(int $option, mixed $value = null): mixed { } * @return bool */ #[\Relay\Attributes\Local] - public function setOption(int $option, mixed $value): bool { } + public function setOption(int $option, mixed $value): bool {} /** * Returns the connection timeout. @@ -551,7 +552,7 @@ public function setOption(int $option, mixed $value): bool { } * @return float|false */ #[\Relay\Attributes\Local] - public function getTimeout(): float|false { } + public function getTimeout(): float|false {} /** * @alias Relay\Relay::getTimeout @@ -559,7 +560,7 @@ public function getTimeout(): float|false { } * @return float|false */ #[\Relay\Attributes\Local] - public function timeout(): float|false { } + public function timeout(): float|false {} /** * Returns the read timeout. @@ -567,7 +568,7 @@ public function timeout(): float|false { } * @return float|false */ #[\Relay\Attributes\Local] - public function getReadTimeout(): float|false { } + public function getReadTimeout(): float|false {} /** * @alias Relay\Relay::getReadTimeout @@ -575,7 +576,7 @@ public function getReadTimeout(): float|false { } * @return float|false */ #[\Relay\Attributes\Local] - public function readTimeout(): float|false { } + public function readTimeout(): float|false {} /** * Returns the number of bytes sent and received over the network during the Relay object's @@ -584,7 +585,7 @@ public function readTimeout(): float|false { } * @return array A two element array consisting of [$sent_bytes, $received_bytes] */ #[\Relay\Attributes\Local] - public function getBytes(): array { } + public function getBytes(): array {} /** * @alias Relay\Relay::getBytes @@ -592,7 +593,7 @@ public function getBytes(): array { } * @return array */ #[\Relay\Attributes\Local] - public function bytes(): array { } + public function bytes(): array {} /** * Returns the host or unix socket. @@ -600,7 +601,7 @@ public function bytes(): array { } * @return string|false */ #[\Relay\Attributes\Local] - public function getHost(): string|false { } + public function getHost(): string|false {} /** * Whether Relay is connected to Redis. @@ -608,7 +609,7 @@ public function getHost(): string|false { } * @return bool */ #[\Relay\Attributes\Local] - public function isConnected(): bool { } + public function isConnected(): bool {} /** * Returns the port. @@ -616,7 +617,7 @@ public function isConnected(): bool { } * @return int|false */ #[\Relay\Attributes\Local] - public function getPort(): int|false { } + public function getPort(): int|false {} /** * Returns the authentication information. @@ -625,7 +626,7 @@ public function getPort(): int|false { } * @return mixed */ #[\Relay\Attributes\Local] - public function getAuth(): mixed { } + public function getAuth(): mixed {} /** * Returns the currently selected DB @@ -633,7 +634,7 @@ public function getAuth(): mixed { } * @return int|false */ #[\Relay\Attributes\Local] - public function getDbNum(): mixed { } + public function getDbNum(): mixed {} /** * Returns the serialized value. @@ -642,7 +643,7 @@ public function getDbNum(): mixed { } * @return mixed */ #[\Relay\Attributes\Local] - public function _serialize(mixed $value): mixed { } + public function _serialize(mixed $value): mixed {} /** * Returns the unserialized value. @@ -651,7 +652,7 @@ public function _serialize(mixed $value): mixed { } * @return mixed */ #[\Relay\Attributes\Local] - public function _unserialize(mixed $value): mixed { } + public function _unserialize(mixed $value): mixed {} /** * Compress data with Relay's currently configured compression algorithm. @@ -660,7 +661,7 @@ public function _unserialize(mixed $value): mixed { } * @return string */ #[\Relay\Attributes\Local] - public function _compress(string $value): string { } + public function _compress(string $value): string {} /** * Uncompress data with Relay's currently configured compression algorithm. @@ -669,7 +670,7 @@ public function _compress(string $value): string { } * @return string */ #[\Relay\Attributes\Local] - public function _uncompress(string $value): string { } + public function _uncompress(string $value): string {} /** * Returns the serialized and compressed value. @@ -678,7 +679,7 @@ public function _uncompress(string $value): string { } * @return string */ #[\Relay\Attributes\Local] - public function _pack(mixed $value): string { } + public function _pack(mixed $value): string {} /** * Returns the unserialized and decompressed value. @@ -687,7 +688,7 @@ public function _pack(mixed $value): string { } * @return mixed */ #[\Relay\Attributes\Local] - public function _unpack(mixed $value): mixed { } + public function _unpack(mixed $value): mixed {} /** * Returns the value with the prefix. @@ -696,7 +697,7 @@ public function _unpack(mixed $value): mixed { } * @return string */ #[\Relay\Attributes\Local] - public function _prefix(mixed $value): string { } + public function _prefix(mixed $value): string {} /** * Returns the last error message, if any. @@ -704,7 +705,7 @@ public function _prefix(mixed $value): string { } * @return string|null */ #[\Relay\Attributes\Local] - public function getLastError(): string|null { } + public function getLastError(): string|null {} /** * Clears the last error that is set, if any. @@ -712,7 +713,7 @@ public function getLastError(): string|null { } * @return bool */ #[\Relay\Attributes\Local] - public function clearLastError(): bool { } + public function clearLastError(): bool {} /** * Returns the connection's endpoint identifier. @@ -720,7 +721,7 @@ public function clearLastError(): bool { } * @return string|false */ #[\Relay\Attributes\Local] - public function endpointId(): string|false { } + public function endpointId(): string|false {} /** * Returns the connection's endpoint identifier. @@ -729,7 +730,7 @@ public function endpointId(): string|false { } * * @return string|false */ - public function getPersistentID(): string|false { } + public function getPersistentID(): string|false {} /** * Returns a unique representation of the underlying socket connection identifier. @@ -737,7 +738,7 @@ public function getPersistentID(): string|false { } * @return string|false */ #[\Relay\Attributes\Local] - public function socketId(): string|false { } + public function socketId(): string|false {} /** * Returns information about the license. @@ -745,8 +746,7 @@ public function socketId(): string|false { } * @return array */ #[\Relay\Attributes\Http] - public static function license(): array { } - + public static function license(): array {} /** * Returns statistics about Relay. @@ -779,7 +779,7 @@ public static function license(): array { } * @return array */ #[\Relay\Attributes\Local] - public static function stats(): array { } + public static function stats(): array {} /** * Returns the number of bytes allocated, or `0` in client-only mode. @@ -787,7 +787,7 @@ public static function stats(): array { } * @return int */ #[\Relay\Attributes\Local] - public static function maxMemory(): int { } + public static function maxMemory(): int {} /** * Returns the number of bytes allocated, or `0` in client-only mode. @@ -797,7 +797,7 @@ public static function maxMemory(): int { } * @return int */ #[\Relay\Attributes\Local] - public static function memory(): int { } + public static function memory(): int {} /** * Execute any command against Redis, without applying @@ -808,7 +808,7 @@ public static function memory(): int { } * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function rawCommand(string $cmd, mixed ...$args): mixed { } + public function rawCommand(string $cmd, mixed ...$args): mixed {} /** * Select the Redis logical database having the specified zero-based numeric index. @@ -817,7 +817,7 @@ public function rawCommand(string $cmd, mixed ...$args): mixed { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function select(int $db): \Relay\Relay|bool { } + public function select(int $db): Relay|bool {} /** * Authenticate the connection using a password or an ACL username and password. @@ -826,7 +826,7 @@ public function select(int $db): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function auth(#[\SensitiveParameter] mixed $auth): bool { } + public function auth(#[\SensitiveParameter] mixed $auth): bool {} /** * The INFO command returns information and statistics about Redis in a format @@ -838,7 +838,7 @@ public function auth(#[\SensitiveParameter] mixed $auth): bool { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function info(string ...$sections): \Relay\Relay|array|false { } + public function info(string ...$sections): Relay|array|false {} /** * Deletes all the keys of the currently selected database. @@ -847,7 +847,7 @@ public function info(string ...$sections): \Relay\Relay|array|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function flushdb(bool $async = false): \Relay\Relay|bool { } + public function flushdb(bool $async = false): Relay|bool {} /** * Deletes all the keys of all the existing databases, not just the currently selected one. @@ -856,7 +856,7 @@ public function flushdb(bool $async = false): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function flushall(bool $async = false): \Relay\Relay|bool { } + public function flushall(bool $async = false): Relay|bool {} /** * Invokes a Redis function. @@ -868,7 +868,7 @@ public function flushall(bool $async = false): \Relay\Relay|bool { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function fcall(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed { } + public function fcall(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed {} /** * Invokes a read-only Redis function. @@ -880,7 +880,7 @@ public function fcall(string $name, array $argv = [], array $keys = [], callable * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function fcall_ro(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed { } + public function fcall_ro(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed {} /** * Calls `FUNCTION` sub-command. @@ -890,7 +890,7 @@ public function fcall_ro(string $name, array $argv = [], array $keys = [], calla * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function function(string $op, string ...$args): mixed { } + public function function(string $op, string ...$args): mixed {} /** * Flushes Relay's internal memory of all databases, or just the given database index. @@ -899,7 +899,7 @@ public function function(string $op, string ...$args): mixed { } * @return bool */ #[\Relay\Attributes\Local] - public static function flushMemory(?string $key = null, int $db = -1): bool { } + public static function flushMemory(?string $key = null, int $db = -1): bool {} /** * Returns the number of keys in the currently-selected database. @@ -907,7 +907,7 @@ public static function flushMemory(?string $key = null, int $db = -1): bool { } * @return int */ #[\Relay\Attributes\RedisCommand] - public function dbsize(): \Relay\Relay|int|false { } + public function dbsize(): Relay|int|false {} /** * Serialize and return the value stored at key in a Redis-specific format. @@ -916,7 +916,7 @@ public function dbsize(): \Relay\Relay|int|false { } * @return string|false */ #[\Relay\Attributes\RedisCommand] - public function dump(mixed $key): \Relay\Relay|string|false { } + public function dump(mixed $key): Relay|string|false {} /** * Attach or detach the instance as a replica of another instance. @@ -926,7 +926,7 @@ public function dump(mixed $key): \Relay\Relay|string|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function replicaof(?string $host = null, $port = 0): \Relay\Relay|bool { } + public function replicaof(?string $host = null, $port = 0): Relay|bool {} /** * Create a key associated with a value that is obtained by deserializing the provided serialized value. @@ -938,7 +938,7 @@ public function replicaof(?string $host = null, $port = 0): \Relay\Relay|bool { * @return bool */ #[\Relay\Attributes\RedisCommand] - public function restore(mixed $key, int $ttl, string $value, ?array $options = null): \Relay\Relay|bool { } + public function restore(mixed $key, int $ttl, string $value, ?array $options = null): Relay|bool {} /** * Atomically transfer a key from a Redis instance to another one. @@ -963,7 +963,7 @@ public function migrate( bool $copy = false, bool $replace = false, #[\SensitiveParameter] mixed $credentials = null - ): \Relay\Relay|bool { } + ): Relay|bool {} /** * This command copies the value stored at the source key to the destination key. @@ -974,7 +974,7 @@ public function migrate( * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function copy(mixed $src, mixed $dst, ?array $options = NULL): \Relay\Relay|int|false { } + public function copy(mixed $src, mixed $dst, ?array $options = null): Relay|int|false {} /** * Asks Redis to echo back the provided string. @@ -983,7 +983,7 @@ public function copy(mixed $src, mixed $dst, ?array $options = NULL): \Relay\Rel * @return bool|string */ #[\Relay\Attributes\RedisCommand] - public function echo(string $arg): \Relay\Relay|bool|string { } + public function echo(string $arg): Relay|bool|string {} /** * Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk. @@ -992,7 +992,7 @@ public function echo(string $arg): \Relay\Relay|bool|string { } * @return bool|string */ #[\Relay\Attributes\RedisCommand] - public function ping(string $arg = null): \Relay\Relay|bool|string { } + public function ping(string $arg = null): Relay|bool|string {} /** * Returns the number of milliseoconds since Relay has seen activity from the server. @@ -1000,7 +1000,7 @@ public function ping(string $arg = null): \Relay\Relay|bool|string { } * @return int|false */ #[\Relay\Attributes\Local] - public function idleTime(): \Relay\Relay|int|false { } + public function idleTime(): Relay|int|false {} /** * Returns a random key from Redis. @@ -1008,7 +1008,7 @@ public function idleTime(): \Relay\Relay|int|false { } * @return string|null|bool */ #[\Relay\Attributes\RedisCommand] - public function randomkey(): \Relay\Relay|string|null|bool { } + public function randomkey(): Relay|string|null|bool {} /** * Returns the current time from Redis. @@ -1016,7 +1016,7 @@ public function randomkey(): \Relay\Relay|string|null|bool { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function time(): \Relay\Relay|array|false { } + public function time(): Relay|array|false {} /** * Asynchronously rewrite the append-only file. @@ -1024,7 +1024,7 @@ public function time(): \Relay\Relay|array|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function bgrewriteaof(): \Relay\Relay|bool { } + public function bgrewriteaof(): Relay|bool {} /** * Returns the UNIX time stamp of the last successful save to disk. @@ -1032,7 +1032,7 @@ public function bgrewriteaof(): \Relay\Relay|bool { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lastsave(): \Relay\Relay|int|false { } + public function lastsave(): Relay|int|false {} /** * Asynchronously save the dataset to disk. @@ -1040,7 +1040,7 @@ public function lastsave(): \Relay\Relay|int|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function bgsave(): \Relay\Relay|bool { } + public function bgsave(): Relay|bool {} /** * Synchronously save the dataset to disk. @@ -1048,7 +1048,7 @@ public function bgsave(): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function save(): \Relay\Relay|bool { } + public function save(): Relay|bool {} /** * Returns the role of the instance in the context of replication. @@ -1056,7 +1056,7 @@ public function save(): \Relay\Relay|bool { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function role(): \Relay\Relay|array|false { } + public function role(): Relay|array|false {} /** * Returns the remaining time to live of a key that has a timeout in seconds. @@ -1065,7 +1065,7 @@ public function role(): \Relay\Relay|array|false { } * @return int */ #[\Relay\Attributes\RedisCommand] - public function ttl(mixed $key): \Relay\Relay|int|false { } + public function ttl(mixed $key): Relay|int|false {} /** * Returns the remaining time to live of a key that has a timeout in milliseconds. @@ -1074,7 +1074,7 @@ public function ttl(mixed $key): \Relay\Relay|int|false { } * @return int */ #[\Relay\Attributes\RedisCommand] - public function pttl(mixed $key): \Relay\Relay|int|false { } + public function pttl(mixed $key): Relay|int|false {} /** * Returns if key(s) exists. @@ -1083,7 +1083,7 @@ public function pttl(mixed $key): \Relay\Relay|int|false { } * @return bool|int */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function exists(mixed ...$keys): \Relay\Relay|bool|int { } + public function exists(mixed ...$keys): Relay|bool|int {} /** * Evaluate script using the Lua interpreter. @@ -1096,7 +1096,7 @@ public function exists(mixed ...$keys): \Relay\Relay|bool|int { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function eval(mixed $script, array $args = [], int $num_keys = 0): mixed { } + public function eval(mixed $script, array $args = [], int $num_keys = 0): mixed {} /** * Evaluate script using the Lua interpreter. This is just the "read-only" variant of EVAL @@ -1110,7 +1110,7 @@ public function eval(mixed $script, array $args = [], int $num_keys = 0): mixed * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function eval_ro(mixed $script, array $args = [], int $num_keys = 0): mixed { } + public function eval_ro(mixed $script, array $args = [], int $num_keys = 0): mixed {} /** * Evaluates a script cached on the server-side by its SHA1 digest. @@ -1122,7 +1122,7 @@ public function eval_ro(mixed $script, array $args = [], int $num_keys = 0): mix * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function evalsha(string $sha, array $args = [], int $num_keys = 0): mixed { } + public function evalsha(string $sha, array $args = [], int $num_keys = 0): mixed {} /** * Evaluates a script cached on the server-side by its SHA1 digest. This is just the "read-only" variant @@ -1134,7 +1134,7 @@ public function evalsha(string $sha, array $args = [], int $num_keys = 0): mixed * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function evalsha_ro(string $sha, array $args = [], int $num_keys = 0): mixed { } + public function evalsha_ro(string $sha, array $args = [], int $num_keys = 0): mixed {} /** * Executes `CLIENT` command operations. @@ -1144,7 +1144,7 @@ public function evalsha_ro(string $sha, array $args = [], int $num_keys = 0): mi * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function client(string $operation, mixed ...$args): mixed { } + public function client(string $operation, mixed ...$args): mixed {} /** * Add one or more members to a geospacial sorted set @@ -1163,7 +1163,7 @@ public function geoadd( float $lat, string $member, mixed ...$other_triples_and_options - ): \Relay\Relay|int|false { } + ): Relay|int|false {} /** * Get the distance between two members of a geospacially encoded sorted set. @@ -1175,7 +1175,7 @@ public function geoadd( * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function geodist(string $key, string $src, string $dst, ?string $unit = null): \Relay\Relay|float|false { } + public function geodist(string $key, string $src, string $dst, ?string $unit = null): Relay|float|false {} /** * Retrieve one or more GeoHash encoded strings for members of the set. @@ -1186,7 +1186,7 @@ public function geodist(string $key, string $src, string $dst, ?string $unit = n * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function geohash(string $key, string $member, string ...$other_members): \Relay\Relay|array|false { } + public function geohash(string $key, string $member, string ...$other_members): Relay|array|false {} /** * Retrieve members of a geospacially sorted set that are within a certain radius of a location. @@ -1200,7 +1200,7 @@ public function geohash(string $key, string $member, string ...$other_members): * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed { } + public function georadius(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed {} /** * Similar to `GEORADIUS` except it uses a member as the center of the query. @@ -1213,7 +1213,7 @@ public function georadius(string $key, float $lng, float $lat, float $radius, st * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []): mixed { } + public function georadiusbymember(string $key, string $member, float $radius, string $unit, array $options = []): mixed {} /** * Similar to `GEORADIUS` except it uses a member as the center of the query. @@ -1226,7 +1226,7 @@ public function georadiusbymember(string $key, string $member, float $radius, st * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): mixed { } + public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): mixed {} /** * Retrieve members of a geospacially sorted set that are within a certain radius of a location. @@ -1240,7 +1240,7 @@ public function georadiusbymember_ro(string $key, string $member, float $radius, * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed { } + public function georadius_ro(string $key, float $lng, float $lat, float $radius, string $unit, array $options = []): mixed {} /** * Search a geospacial sorted set for members in various ways. @@ -1259,7 +1259,7 @@ public function geosearch( array|int|float $shape, string $unit, array $options = [] - ): \Relay\Relay|array { } + ): Relay|array {} /** * Search a geospacial sorted set for members within a given area or range, storing the results into @@ -1281,7 +1281,7 @@ public function geosearchstore( array|int|float $shape, string $unit, array $options = [] - ): \Relay\Relay|int|false { } + ): Relay|int|false {} /** * Get the value of key. @@ -1290,7 +1290,7 @@ public function geosearchstore( * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function get(mixed $key): mixed { } + public function get(mixed $key): mixed {} /** * Atomically sets key to value and returns the old value stored at key. @@ -1300,7 +1300,7 @@ public function get(mixed $key): mixed { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function getset(mixed $key, mixed $value): mixed { } + public function getset(mixed $key, mixed $value): mixed {} /** * Returns the substring of the string value stored at key, @@ -1312,7 +1312,7 @@ public function getset(mixed $key, mixed $value): mixed { } * @return string|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function getrange(mixed $key, int $start, int $end): \Relay\Relay|string|false { } + public function getrange(mixed $key, int $start, int $end): Relay|string|false {} /** * Overwrites part of the string stored at key, starting at @@ -1324,7 +1324,7 @@ public function getrange(mixed $key, int $start, int $end): \Relay\Relay|string| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function setrange(mixed $key, int $start, mixed $value): \Relay\Relay|int|false { } + public function setrange(mixed $key, int $start, mixed $value): Relay|int|false {} /** * Returns the bit value at offset in the string value stored at key. @@ -1334,7 +1334,7 @@ public function setrange(mixed $key, int $start, mixed $value): \Relay\Relay|int * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function getbit(mixed $key, int $pos): \Relay\Relay|int|false { } + public function getbit(mixed $key, int $pos): Relay|int|false {} /** * Count the number of set bits (population counting) in a string. @@ -1346,7 +1346,7 @@ public function getbit(mixed $key, int $pos): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit = false): \Relay\Relay|int|false { } + public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit = false): Relay|int|false {} /** * This is a container command for runtime configuration commands. @@ -1357,7 +1357,7 @@ public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit * @return array|bool */ #[\Relay\Attributes\RedisCommand] - public function config(string $operation, mixed $key = null, ?string $value = NULL): \Relay\Relay|array|bool { } + public function config(string $operation, mixed $key = null, ?string $value = null): Relay|array|bool {} /** * Return an array with details about every Redis command. @@ -1366,7 +1366,7 @@ public function config(string $operation, mixed $key = null, ?string $value = NU * @return array|int|false */ #[\Relay\Attributes\RedisCommand] - public function command(mixed ...$args): \Relay\Relay|array|int|false { } + public function command(mixed ...$args): Relay|array|int|false {} /** * Perform a bitwise operation on one or more keys, storing the result in a new key. @@ -1378,7 +1378,7 @@ public function command(mixed ...$args): \Relay\Relay|array|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function bitop(string $operation, string $dstkey, string $srckey, string ...$other_keys): \Relay\Relay|int|false { } + public function bitop(string $operation, string $dstkey, string $srckey, string ...$other_keys): Relay|int|false {} /** * Return the position of the first bit set to 1 or 0 in a string. @@ -1391,7 +1391,7 @@ public function bitop(string $operation, string $dstkey, string $srckey, string * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, bool $bybit = false): \Relay\Relay|int|false { } + public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, bool $bybit = false): Relay|int|false {} /** * Sets or clears the bit at offset in the string value stored at key. @@ -1402,7 +1402,7 @@ public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function setbit(mixed $key, int $pos, int $val): \Relay\Relay|int|false { } + public function setbit(mixed $key, int $pos, int $val): Relay|int|false {} /** * Interact with Redis' ACLs @@ -1412,7 +1412,7 @@ public function setbit(mixed $key, int $pos, int $val): \Relay\Relay|int|false { * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function acl(string $cmd, string ...$args): mixed { } + public function acl(string $cmd, string ...$args): mixed {} /** * If key already exists and is a string, this command appends @@ -1425,7 +1425,7 @@ public function acl(string $cmd, string ...$args): mixed { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function append(mixed $key, mixed $value): \Relay\Relay|int|false { } + public function append(mixed $key, mixed $value): Relay|int|false {} /** * Set key to hold the string value. If key already holds @@ -1437,7 +1437,7 @@ public function append(mixed $key, mixed $value): \Relay\Relay|int|false { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function set(mixed $key, mixed $value, mixed $options = null): mixed { } + public function set(mixed $key, mixed $value, mixed $options = null): mixed {} /** * Get the value of key and optionally set its expiration. @@ -1448,7 +1448,7 @@ public function set(mixed $key, mixed $value, mixed $options = null): mixed { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function getex(mixed $key, ?array $options = NULL): mixed { } + public function getex(mixed $key, ?array $options = null): mixed {} /** * Get the value of key and delete the key. This command is similar to GET, @@ -1459,7 +1459,7 @@ public function getex(mixed $key, ?array $options = NULL): mixed { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function getdel(mixed $key): mixed { } + public function getdel(mixed $key): mixed {} /** * Set key to hold the string value and set key to timeout after a given number of seconds. @@ -1470,7 +1470,7 @@ public function getdel(mixed $key): mixed { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function setex(mixed $key, int $seconds, mixed $value): \Relay\Relay|bool { } + public function setex(mixed $key, int $seconds, mixed $value): Relay|bool {} /** * Adds the specified elements to the specified HyperLogLog. @@ -1480,7 +1480,7 @@ public function setex(mixed $key, int $seconds, mixed $value): \Relay\Relay|bool * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function pfadd(string $key, array $elements): \Relay\Relay|int|false { } + public function pfadd(string $key, array $elements): Relay|int|false {} /** * Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). @@ -1489,7 +1489,7 @@ public function pfadd(string $key, array $elements): \Relay\Relay|int|false { } * @return int */ #[\Relay\Attributes\RedisCommand] - public function pfcount(string $key): \Relay\Relay|int { } + public function pfcount(string $key): Relay|int {} /** * Merge given HyperLogLogs into a single one. @@ -1498,7 +1498,7 @@ public function pfcount(string $key): \Relay\Relay|int { } * @param array $srckeys * @return bool */ - public function pfmerge(string $dst, array $srckeys): \Relay\Relay|bool { } + public function pfmerge(string $dst, array $srckeys): Relay|bool {} /** * Set key to hold the string value and set key to timeout after a given number of milliseconds. @@ -1510,7 +1510,7 @@ public function pfmerge(string $dst, array $srckeys): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function psetex(mixed $key, int $milliseconds, mixed $value): \Relay\Relay|bool { } + public function psetex(mixed $key, int $milliseconds, mixed $value): Relay|bool {} /** * Posts a message to the given channel. @@ -1520,7 +1520,7 @@ public function psetex(mixed $key, int $milliseconds, mixed $value): \Relay\Rela * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function publish(string $channel, string $message): \Relay\Relay|int|false { } + public function publish(string $channel, string $message): Relay|int|false {} /** * Set key to hold string value if key does not exist. In that case, it is equal to SET. @@ -1532,7 +1532,7 @@ public function publish(string $channel, string $message): \Relay\Relay|int|fals * @return bool */ #[\Relay\Attributes\RedisCommand] - public function setnx(mixed $key, mixed $value): \Relay\Relay|bool { } + public function setnx(mixed $key, mixed $value): Relay|bool {} /** * Returns the values of all specified keys. @@ -1541,7 +1541,7 @@ public function setnx(mixed $key, mixed $value): \Relay\Relay|bool { } * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function mget(array $keys): \Relay\Relay|array|false { } + public function mget(array $keys): Relay|array|false {} /** * Move key from the currently selected database to the specified destination database. @@ -1551,7 +1551,7 @@ public function mget(array $keys): \Relay\Relay|array|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function move(mixed $key, int $db): \Relay\Relay|int|false { } + public function move(mixed $key, int $db): Relay|int|false {} /** * Sets the given keys to their respective values. @@ -1561,7 +1561,7 @@ public function move(mixed $key, int $db): \Relay\Relay|int|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function mset(array $kvals): \Relay\Relay|bool { } + public function mset(array $kvals): Relay|bool {} /** * Sets the given keys to their respective values. @@ -1571,7 +1571,7 @@ public function mset(array $kvals): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function msetnx(array $kvals): \Relay\Relay|bool { } + public function msetnx(array $kvals): Relay|bool {} /** * Renames key. @@ -1581,7 +1581,7 @@ public function msetnx(array $kvals): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function rename(mixed $key, mixed $newkey): \Relay\Relay|bool { } + public function rename(mixed $key, mixed $newkey): Relay|bool {} /** * Renames key if the new key does not yet exist. @@ -1591,7 +1591,7 @@ public function rename(mixed $key, mixed $newkey): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function renamenx(mixed $key, mixed $newkey): \Relay\Relay|bool { } + public function renamenx(mixed $key, mixed $newkey): Relay|bool {} /** * Removes the specified keys. @@ -1600,7 +1600,7 @@ public function renamenx(mixed $key, mixed $newkey): \Relay\Relay|bool { } * @return int|bool */ #[\Relay\Attributes\RedisCommand] - public function del(mixed ...$keys): \Relay\Relay|int|bool { } + public function del(mixed ...$keys): Relay|int|bool {} /** * Removes the specified keys without blocking Redis. @@ -1609,7 +1609,7 @@ public function del(mixed ...$keys): \Relay\Relay|int|bool { } * @return int */ #[\Relay\Attributes\RedisCommand] - public function unlink(mixed ...$keys): \Relay\Relay|int|false { } + public function unlink(mixed ...$keys): Relay|int|false {} /** * Set a timeout on key. @@ -1620,7 +1620,7 @@ public function unlink(mixed ...$keys): \Relay\Relay|int|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function expire(mixed $key, int $seconds, ?string $mode = null): \Relay\Relay|bool { } + public function expire(mixed $key, int $seconds, ?string $mode = null): Relay|bool {} /** * Set a key's time to live in milliseconds. @@ -1630,7 +1630,7 @@ public function expire(mixed $key, int $seconds, ?string $mode = null): \Relay\R * @return bool */ #[\Relay\Attributes\RedisCommand] - public function pexpire(mixed $key, int $milliseconds): \Relay\Relay|bool { } + public function pexpire(mixed $key, int $milliseconds): Relay|bool {} /** * Set a timeout on key using a unix timestamp. @@ -1640,7 +1640,7 @@ public function pexpire(mixed $key, int $milliseconds): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function expireat(mixed $key, int $timestamp): \Relay\Relay|bool { } + public function expireat(mixed $key, int $timestamp): Relay|bool {} /** * Returns the absolute Unix timestamp in seconds at which the given key will expire. @@ -1651,7 +1651,7 @@ public function expireat(mixed $key, int $timestamp): \Relay\Relay|bool { } * @return int|false * */ #[\Relay\Attributes\RedisCommand] - public function expiretime(mixed $key): \Relay\Relay|int|false { } + public function expiretime(mixed $key): Relay|int|false {} /** * Set the expiration for a key as a UNIX timestamp specified in milliseconds. @@ -1661,7 +1661,7 @@ public function expiretime(mixed $key): \Relay\Relay|int|false { } * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] - public function pexpireat(mixed $key, int $timestamp_ms): \Relay\Relay|bool { } + public function pexpireat(mixed $key, int $timestamp_ms): Relay|bool {} /** * Semantic the same as EXPIRETIME, but returns the absolute Unix expiration @@ -1671,7 +1671,7 @@ public function pexpireat(mixed $key, int $timestamp_ms): \Relay\Relay|bool { } * @return int|false * */ #[\Relay\Attributes\RedisCommand] - public function pexpiretime(mixed $key): \Relay\Relay|int|false { } + public function pexpiretime(mixed $key): Relay|int|false {} /** * Remove the existing timeout on key, turning the key from volatile to persistent. @@ -1680,7 +1680,7 @@ public function pexpiretime(mixed $key): \Relay\Relay|int|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function persist(mixed $key): \Relay\Relay|bool { } + public function persist(mixed $key): Relay|bool {} /** * Returns the type of a given key. @@ -1693,7 +1693,7 @@ public function persist(mixed $key): \Relay\Relay|bool { } * @return int|string|false */ #[\Relay\Attributes\RedisCommand] - public function type(mixed $key): \Relay\Relay|int|string|bool { } + public function type(mixed $key): Relay|int|string|bool {} /** * Atomically returns and removes the first/last element of the list @@ -1707,7 +1707,7 @@ public function type(mixed $key): \Relay\Relay|int|string|bool { } * @return string|null|false */ #[\Relay\Attributes\RedisCommand] - public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): \Relay\Relay|string|null|false { } + public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): Relay|string|null|false {} /** * BLMOVE is the blocking variant of LMOVE. When source contains elements, @@ -1722,7 +1722,7 @@ public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstp * @return string|null|false */ #[\Relay\Attributes\RedisCommand] - public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): \Relay\Relay|string|null|false { } + public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): Relay|string|null|false {} /** * Returns the specified elements of the list stored at key. @@ -1733,7 +1733,7 @@ public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dst * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function lrange(mixed $key, int $start, int $stop): \Relay\Relay|array|false { } + public function lrange(mixed $key, int $start, int $stop): Relay|array|false {} /** * Insert all the specified values at the head of the list stored at key. @@ -1744,7 +1744,7 @@ public function lrange(mixed $key, int $start, int $stop): \Relay\Relay|array|fa * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } + public function lpush(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} /** * Insert all the specified values at the tail of the list stored at key. @@ -1755,7 +1755,7 @@ public function lpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function rpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } + public function rpush(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} /** * Inserts specified values at the head of the list stored at key, @@ -1767,7 +1767,7 @@ public function rpush(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } + public function lpushx(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} /** * Inserts specified values at the tail of the list stored at key, @@ -1779,7 +1779,7 @@ public function lpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function rpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int|false { } + public function rpushx(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} /** * Sets the list element at index to element. @@ -1790,7 +1790,7 @@ public function rpushx(mixed $key, mixed $mem, mixed ...$mems): \Relay\Relay|int * @return bool */ #[\Relay\Attributes\RedisCommand] - public function lset(mixed $key, int $index, mixed $mem): \Relay\Relay|bool { } + public function lset(mixed $key, int $index, mixed $mem): Relay|bool {} /** * Removes and returns the first elements of the list stored at key. @@ -1800,7 +1800,7 @@ public function lset(mixed $key, int $index, mixed $mem): \Relay\Relay|bool { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function lpop(mixed $key, int $count = 1): mixed { } + public function lpop(mixed $key, int $count = 1): mixed {} /** * The command returns the index of matching elements inside a Redis list. @@ -1811,7 +1811,7 @@ public function lpop(mixed $key, int $count = 1): mixed { } * @return int|array|false|null */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function lpos(mixed $key, mixed $value, ?array $options = null): \Relay\Relay|int|array|false|null { } + public function lpos(mixed $key, mixed $value, ?array $options = null): Relay|int|array|false|null {} /** * Removes and returns the last elements of the list stored at key. @@ -1821,7 +1821,7 @@ public function lpos(mixed $key, mixed $value, ?array $options = null): \Relay\R * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function rpop(mixed $key, int $count = 1): mixed { } + public function rpop(mixed $key, int $count = 1): mixed {} /** * Atomically returns and removes the last element (tail) of the list stored at source, @@ -1832,7 +1832,7 @@ public function rpop(mixed $key, int $count = 1): mixed { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function rpoplpush(mixed $source, mixed $dest): mixed { } + public function rpoplpush(mixed $source, mixed $dest): mixed {} /** * Atomically returns and removes the last element (tail) of the list stored at source, @@ -1845,7 +1845,7 @@ public function rpoplpush(mixed $source, mixed $dest): mixed { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed { } + public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed {} /** * BLPOP is a blocking list pop primitive. It is the blocking version of LPOP because @@ -1857,7 +1857,7 @@ public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed { * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function blpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } + public function blpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} /** * Pop elements from a list, or block until one is available @@ -1869,7 +1869,7 @@ public function blpop(string|array $key, string|float $timeout_or_key, mixed ... * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function blmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } + public function blmpop(float $timeout, array $keys, string $from, int $count = 1): Relay|array|null|false {} /** * Remove and return members with scores in a sorted set or block until one is available @@ -1881,7 +1881,7 @@ public function blmpop(float $timeout, array $keys, string $from, int $count = 1 * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } + public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): Relay|array|null|false {} /** * Pops one or more elements from the first non-empty list key from the list of provided key names. @@ -1892,7 +1892,7 @@ public function bzmpop(float $timeout, array $keys, string $from, int $count = 1 * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function lmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } + public function lmpop(array $keys, string $from, int $count = 1): Relay|array|null|false {} /** * Pops one or more elements, that are member-score pairs, from the @@ -1904,7 +1904,7 @@ public function lmpop(array $keys, string $from, int $count = 1): \Relay\Relay|a * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function zmpop(array $keys, string $from, int $count = 1): \Relay\Relay|array|null|false { } + public function zmpop(array $keys, string $from, int $count = 1): Relay|array|null|false {} /** * BRPOP is a blocking list pop primitive. It is the blocking version of RPOP because @@ -1916,7 +1916,7 @@ public function zmpop(array $keys, string $from, int $count = 1): \Relay\Relay|a * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function brpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } + public function brpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} /** * BZPOPMAX is the blocking variant of the sorted set ZPOPMAX primitive. @@ -1927,7 +1927,7 @@ public function brpop(string|array $key, string|float $timeout_or_key, mixed ... * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } + public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} /** * BZPOPMIN is the blocking variant of the sorted set ZPOPMIN primitive. @@ -1938,7 +1938,7 @@ public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed * @return array|null|false */ #[\Relay\Attributes\RedisCommand] - public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): \Relay\Relay|array|null|false { } + public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} /** * This is a container command for object introspection commands. @@ -1948,7 +1948,7 @@ public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function object(string $op, mixed $key): mixed { } + public function object(string $op, mixed $key): mixed {} /** * Return the positions (longitude,latitude) of all the specified members @@ -1959,7 +1959,7 @@ public function object(string $op, mixed $key): mixed { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function geopos(mixed $key, mixed ...$members): \Relay\Relay|array|false { } + public function geopos(mixed $key, mixed ...$members): Relay|array|false {} /** * Removes the first count occurrences of elements equal to element from the list stored at key. @@ -1970,7 +1970,7 @@ public function geopos(mixed $key, mixed ...$members): \Relay\Relay|array|false * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function lrem(mixed $key, mixed $mem, int $count = 0): \Relay\Relay|int|false { } + public function lrem(mixed $key, mixed $mem, int $count = 0): Relay|int|false {} /** * Returns the element at index index in the list stored at key. @@ -1980,7 +1980,7 @@ public function lrem(mixed $key, mixed $mem, int $count = 0): \Relay\Relay|int|f * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function lindex(mixed $key, int $index): mixed { } + public function lindex(mixed $key, int $index): mixed {} /** * Inserts element in the list stored at key either before or after the reference value pivot. @@ -1992,7 +1992,7 @@ public function lindex(mixed $key, int $index): mixed { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): \Relay\Relay|int|false { } + public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): Relay|int|false {} /** * Trim an existing list so that it will contain only the specified range of elements specified. @@ -2003,7 +2003,7 @@ public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): \ * @return bool */ #[\Relay\Attributes\RedisCommand] - public function ltrim(mixed $key, int $start, int $end): \Relay\Relay|bool { } + public function ltrim(mixed $key, int $start, int $end): Relay|bool {} /** * Returns the value associated with field in the hash stored at key. @@ -2013,7 +2013,7 @@ public function ltrim(mixed $key, int $start, int $end): \Relay\Relay|bool { } * @return mixed */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hget(mixed $hash, mixed $member): mixed { } + public function hget(mixed $hash, mixed $member): mixed {} /** * Returns the string length of the value associated with field in the hash stored at key. @@ -2023,7 +2023,7 @@ public function hget(mixed $hash, mixed $member): mixed { } * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hstrlen(mixed $hash, mixed $member): \Relay\Relay|int|false { } + public function hstrlen(mixed $hash, mixed $member): Relay|int|false {} /** * Returns all fields and values of the hash stored at key. @@ -2032,7 +2032,7 @@ public function hstrlen(mixed $hash, mixed $member): \Relay\Relay|int|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hgetall(mixed $hash): \Relay\Relay|array|false { } + public function hgetall(mixed $hash): Relay|array|false {} /** * Returns all field names in the hash stored at key. @@ -2041,7 +2041,7 @@ public function hgetall(mixed $hash): \Relay\Relay|array|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hkeys(mixed $hash): \Relay\Relay|array|false { } + public function hkeys(mixed $hash): Relay|array|false {} /** * Returns all values in the hash stored at key. @@ -2050,7 +2050,7 @@ public function hkeys(mixed $hash): \Relay\Relay|array|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hvals(mixed $hash): \Relay\Relay|array|false { } + public function hvals(mixed $hash): Relay|array|false {} /** * Returns the values associated with the specified fields in the hash stored at key. @@ -2060,7 +2060,7 @@ public function hvals(mixed $hash): \Relay\Relay|array|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hmget(mixed $hash, array $members): \Relay\Relay|array|false { } + public function hmget(mixed $hash, array $members): Relay|array|false {} /** * When called with just the key argument, return a random field from the hash value stored at key. @@ -2070,7 +2070,7 @@ public function hmget(mixed $hash, array $members): \Relay\Relay|array|false { } * @return array|string|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hrandfield(mixed $hash, ?array $options = NULL): \Relay\Relay|array|string|false { } + public function hrandfield(mixed $hash, ?array $options = null): Relay|array|string|false {} /** * Sets the specified fields to their respective values in the hash stored at key. @@ -2080,7 +2080,7 @@ public function hrandfield(mixed $hash, ?array $options = NULL): \Relay\Relay|ar * @return bool */ #[\Relay\Attributes\RedisCommand] - public function hmset(mixed $hash, array $members): \Relay\Relay|bool { } + public function hmset(mixed $hash, array $members): Relay|bool {} /** * Returns if field is an existing field in the hash stored at key. @@ -2090,7 +2090,7 @@ public function hmset(mixed $hash, array $members): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hexists(mixed $hash, mixed $member): \Relay\Relay|bool { } + public function hexists(mixed $hash, mixed $member): Relay|bool {} /** * Sets field in the hash stored at key to value, only if field does not yet exist. @@ -2101,7 +2101,7 @@ public function hexists(mixed $hash, mixed $member): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function hsetnx(mixed $hash, mixed $member, mixed $value): \Relay\Relay|bool { } + public function hsetnx(mixed $hash, mixed $member, mixed $value): Relay|bool {} /** * Sets field in the hash stored at key to value. @@ -2113,7 +2113,7 @@ public function hsetnx(mixed $hash, mixed $member, mixed $value): \Relay\Relay|b * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): \Relay\Relay|int|false { } + public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): Relay|int|false {} /** * Removes the specified fields from the hash stored at key. @@ -2124,7 +2124,7 @@ public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): \Rela * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function hdel(mixed $key, mixed $mem, string ...$mems): \Relay\Relay|int|false { } + public function hdel(mixed $key, mixed $mem, string ...$mems): Relay|int|false {} /** * Increments the number stored at field in the hash stored at key by increment. @@ -2135,7 +2135,7 @@ public function hdel(mixed $key, mixed $mem, string ...$mems): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function hincrby(mixed $key, mixed $mem, int $value): \Relay\Relay|int|false { } + public function hincrby(mixed $key, mixed $mem, int $value): Relay|int|false {} /** * Increment the specified field of a hash stored at key, and representing @@ -2147,7 +2147,7 @@ public function hincrby(mixed $key, mixed $mem, int $value): \Relay\Relay|int|fa * @return float|bool */ #[\Relay\Attributes\RedisCommand] - public function hincrbyfloat(mixed $key, mixed $mem, float $value): \Relay\Relay|float|bool { } + public function hincrbyfloat(mixed $key, mixed $mem, float $value): Relay|float|bool {} /** * Increments the number stored at key by one. @@ -2157,7 +2157,7 @@ public function hincrbyfloat(mixed $key, mixed $mem, float $value): \Relay\Relay * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function incr(mixed $key, int $by = 1): \Relay\Relay|int|false { } + public function incr(mixed $key, int $by = 1): Relay|int|false {} /** * Decrements the number stored at key by one. @@ -2167,7 +2167,7 @@ public function incr(mixed $key, int $by = 1): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function decr(mixed $key, int $by = 1): \Relay\Relay|int|false { } + public function decr(mixed $key, int $by = 1): Relay|int|false {} /** * Increments the number stored at key by increment. @@ -2177,7 +2177,7 @@ public function decr(mixed $key, int $by = 1): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function incrby(mixed $key, int $value): \Relay\Relay|int|false { } + public function incrby(mixed $key, int $value): Relay|int|false {} /** * Decrements the number stored at key by decrement. @@ -2187,7 +2187,7 @@ public function incrby(mixed $key, int $value): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function decrby(mixed $key, int $value): \Relay\Relay|int|false { } + public function decrby(mixed $key, int $value): Relay|int|false {} /** * Increment the string representing a floating point number stored at key by the specified increment. @@ -2197,7 +2197,7 @@ public function decrby(mixed $key, int $value): \Relay\Relay|int|false { } * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function incrbyfloat(mixed $key, float $value): \Relay\Relay|float|false { } + public function incrbyfloat(mixed $key, float $value): Relay|float|false {} /** * Returns the members of the set resulting from the difference between the first set and all the successive sets. @@ -2207,7 +2207,7 @@ public function incrbyfloat(mixed $key, float $value): \Relay\Relay|float|false * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sdiff(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false { } + public function sdiff(mixed $key, mixed ...$other_keys): Relay|array|false {} /** * This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination. @@ -2218,7 +2218,7 @@ public function sdiff(mixed $key, mixed ...$other_keys): \Relay\Relay|array|fals * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sdiffstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false { } + public function sdiffstore(mixed $key, mixed ...$other_keys): Relay|int|false {} /** * Returns the members of the set resulting from the intersection of all the given sets. @@ -2228,7 +2228,7 @@ public function sdiffstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|f * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sinter(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false { } + public function sinter(mixed $key, mixed ...$other_keys): Relay|array|false {} /** * Intersect multiple sets and return the cardinality of the result. @@ -2238,7 +2238,7 @@ public function sinter(mixed $key, mixed ...$other_keys): \Relay\Relay|array|fal * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sintercard(array $keys, int $limit = -1): \Relay\Relay|int|false { } + public function sintercard(array $keys, int $limit = -1): Relay|int|false {} /** * This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination. @@ -2249,7 +2249,7 @@ public function sintercard(array $keys, int $limit = -1): \Relay\Relay|int|false * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sinterstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false { } + public function sinterstore(mixed $key, mixed ...$other_keys): Relay|int|false {} /** * Returns the members of the set resulting from the union of all the given sets. @@ -2259,7 +2259,7 @@ public function sinterstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int| * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sunion(mixed $key, mixed ...$other_keys): \Relay\Relay|array|false { } + public function sunion(mixed $key, mixed ...$other_keys): Relay|array|false {} /** * This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination. @@ -2270,7 +2270,7 @@ public function sunion(mixed $key, mixed ...$other_keys): \Relay\Relay|array|fal * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sunionstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int|false { } + public function sunionstore(mixed $key, mixed ...$other_keys): Relay|int|false {} /** * Alters the last access time of a key(s). @@ -2280,7 +2280,7 @@ public function sunionstore(mixed $key, mixed ...$other_keys): \Relay\Relay|int| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function touch(array|string $key_or_array, mixed ...$more_keys): \Relay\Relay|int|false { } + public function touch(array|string $key_or_array, mixed ...$more_keys): Relay|int|false {} /** * A pipeline block is simply transmitted faster to the server (like `MULTI`), but without any guarantee of atomicity. @@ -2288,7 +2288,7 @@ public function touch(array|string $key_or_array, mixed ...$more_keys): \Relay\R * @return bool|\Relay\Relay */ #[\Relay\Attributes\Local] - public function pipeline(): \Relay\Relay|bool { } + public function pipeline(): Relay|bool {} /** * Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC. @@ -2299,7 +2299,7 @@ public function pipeline(): \Relay\Relay|bool { } * @return bool|\Relay\Relay */ #[\Relay\Attributes\RedisCommand] - public function multi(int $mode = 0): \Relay\Relay|bool { } + public function multi(int $mode = 0): Relay|bool {} /** * Executes all previously queued commands in a transaction and restores the connection state to normal. @@ -2307,7 +2307,7 @@ public function multi(int $mode = 0): \Relay\Relay|bool { } * @return array|bool */ #[\Relay\Attributes\RedisCommand] - public function exec(): \Relay\Relay|array|bool { } + public function exec(): Relay|array|bool {} /** * Wait for the synchronous replication of all the write @@ -2318,7 +2318,7 @@ public function exec(): \Relay\Relay|array|bool { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function wait(int $replicas, $timeout): \Relay\Relay|int|false { } + public function wait(int $replicas, $timeout): Relay|int|false {} /** * Marks the given keys to be watched for conditional execution of a transaction. @@ -2328,7 +2328,7 @@ public function wait(int $replicas, $timeout): \Relay\Relay|int|false { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function watch(mixed $key, mixed ...$other_keys): \Relay\Relay|bool { } + public function watch(mixed $key, mixed ...$other_keys): Relay|bool {} /** * Flushes all the previously watched keys for a transaction. @@ -2337,7 +2337,7 @@ public function watch(mixed $key, mixed ...$other_keys): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function unwatch(): \Relay\Relay|bool { } + public function unwatch(): Relay|bool {} /** * Flushes all previously queued commands in a transaction and restores the connection state to normal. @@ -2346,7 +2346,7 @@ public function unwatch(): \Relay\Relay|bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function discard(): bool { } + public function discard(): bool {} /** * Get the mode Relay is currently in. @@ -2356,7 +2356,7 @@ public function discard(): bool { } * @return int */ #[\Relay\Attributes\Local] - public function getMode(bool $masked = false): int { } + public function getMode(bool $masked = false): int {} /** * Clear the accumulated sent and received bytes. @@ -2364,7 +2364,7 @@ public function getMode(bool $masked = false): int { } * @return void */ #[\Relay\Attributes\Local] - public function clearBytes(): void { } + public function clearBytes(): void {} /** * Scan the keyspace for matching keys. @@ -2376,7 +2376,7 @@ public function clearBytes(): void { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function scan(mixed &$iterator, mixed $match = null, int $count = 0, ?string $type = null): array|false { } + public function scan(mixed &$iterator, mixed $match = null, int $count = 0, ?string $type = null): array|false {} /** * Iterates fields of Hash types and their associated values. @@ -2388,7 +2388,7 @@ public function scan(mixed &$iterator, mixed $match = null, int $count = 0, ?str * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function hscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false { } + public function hscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false {} /** * Iterates elements of Sets types. @@ -2400,7 +2400,7 @@ public function hscan(mixed $key, mixed &$iterator, mixed $match = null, int $co * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false { } + public function sscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false {} /** * Iterates elements of Sorted Set types and their associated scores. @@ -2412,7 +2412,7 @@ public function sscan(mixed $key, mixed &$iterator, mixed $match = null, int $co * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false { } + public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $count = 0): array|false {} /** * Returns all keys matching pattern. @@ -2421,7 +2421,7 @@ public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $co * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function keys(mixed $pattern): \Relay\Relay|array|false { } + public function keys(mixed $pattern): Relay|array|false {} /** * Interact with the Redis slowlog. @@ -2431,7 +2431,7 @@ public function keys(mixed $pattern): \Relay\Relay|array|false { } * @return array|int|bool */ #[\Relay\Attributes\RedisCommand] - public function slowlog(string $operation, string ...$extra_args): \Relay\Relay|array|int|bool { } + public function slowlog(string $operation, string ...$extra_args): Relay|array|int|bool {} /** * Returns all the members of the set value stored at `$key`. @@ -2440,7 +2440,7 @@ public function slowlog(string $operation, string ...$extra_args): \Relay\Relay| * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function smembers(mixed $set): \Relay\Relay|array|false { } + public function smembers(mixed $set): Relay|array|false {} /** * Returns if `$member` is a member of the set stored at `$key`. @@ -2450,7 +2450,7 @@ public function smembers(mixed $set): \Relay\Relay|array|false { } * @return bool */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function sismember(mixed $set, mixed $member): \Relay\Relay|bool { } + public function sismember(mixed $set, mixed $member): Relay|bool {} /** * Returns whether each member is a member of the set stored at `$key`. @@ -2460,7 +2460,7 @@ public function sismember(mixed $set, mixed $member): \Relay\Relay|bool { } * @return array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function smismember(mixed $set, mixed ...$members): \Relay\Relay|array|false { } + public function smismember(mixed $set, mixed ...$members): Relay|array|false {} /** * Remove the specified members from the set stored at `$key`. @@ -2471,7 +2471,7 @@ public function smismember(mixed $set, mixed ...$members): \Relay\Relay|array|fa * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function srem(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false { } + public function srem(mixed $set, mixed $member, mixed ...$members): Relay|int|false {} /** * Add the specified members to the set stored at `$key`. @@ -2482,7 +2482,7 @@ public function srem(mixed $set, mixed $member, mixed ...$members): \Relay\Relay * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function sadd(mixed $set, mixed $member, mixed ...$members): \Relay\Relay|int|false { } + public function sadd(mixed $set, mixed $member, mixed ...$members): Relay|int|false {} /** * Sort the elements in a list, set or sorted set. @@ -2492,7 +2492,7 @@ public function sadd(mixed $set, mixed $member, mixed ...$members): \Relay\Relay * @return array|int|false */ #[\Relay\Attributes\RedisCommand] - public function sort(mixed $key, array $options = []): \Relay\Relay|array|int|false { } + public function sort(mixed $key, array $options = []): Relay|array|int|false {} /** * Sort the elements in a list, set or sorted set. Read-only variant of SORT. @@ -2502,7 +2502,7 @@ public function sort(mixed $key, array $options = []): \Relay\Relay|array|int|fa * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sort_ro(mixed $key, array $options = []): \Relay\Relay|array|false { } + public function sort_ro(mixed $key, array $options = []): Relay|array|false {} /** * Move member from the set at source to the set at destination. @@ -2513,7 +2513,7 @@ public function sort_ro(mixed $key, array $options = []): \Relay\Relay|array|fal * @return bool */ #[\Relay\Attributes\RedisCommand] - public function smove(mixed $srcset, mixed $dstset, mixed $member): \Relay\Relay|bool { } + public function smove(mixed $srcset, mixed $dstset, mixed $member): Relay|bool {} /** * Removes and returns one or more random members from the set value store at `$key`. @@ -2523,7 +2523,7 @@ public function smove(mixed $srcset, mixed $dstset, mixed $member): \Relay\Relay * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function spop(mixed $set, int $count = 1): mixed { } + public function spop(mixed $set, int $count = 1): mixed {} /** * Returns one or multiple random members from a set. @@ -2533,7 +2533,7 @@ public function spop(mixed $set, int $count = 1): mixed { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function srandmember(mixed $set, int $count = 1): mixed { } + public function srandmember(mixed $set, int $count = 1): mixed {} /** * Returns the set cardinality (number of elements) of the set stored at `$key`. @@ -2542,7 +2542,7 @@ public function srandmember(mixed $set, int $count = 1): mixed { } * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function scard(mixed $key): \Relay\Relay|int|false { } + public function scard(mixed $key): Relay|int|false {} /** * Execute a script management command. @@ -2552,7 +2552,7 @@ public function scard(mixed $key): \Relay\Relay|int|false { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function script(string $command, string ...$args): mixed { } + public function script(string $command, string ...$args): mixed {} /** * Returns the length of the string value stored at `$key`. @@ -2561,7 +2561,7 @@ public function script(string $command, string ...$args): mixed { } * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function strlen(mixed $key): \Relay\Relay|int|false { } + public function strlen(mixed $key): Relay|int|false {} /** * Returns the number of fields contained in the hash stored at `$key`. @@ -2570,7 +2570,7 @@ public function strlen(mixed $key): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function hlen(mixed $key): \Relay\Relay|int|false { } + public function hlen(mixed $key): Relay|int|false {} /** * Returns the length of the list stored at `$key`. @@ -2579,7 +2579,7 @@ public function hlen(mixed $key): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function llen(mixed $key): \Relay\Relay|int|false { } + public function llen(mixed $key): Relay|int|false {} /** * Acknowledge one or more IDs as having been processed by the consumer group. @@ -2590,7 +2590,7 @@ public function llen(mixed $key): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function xack(mixed $key, string $group, array $ids): \Relay\Relay|int|false { } + public function xack(mixed $key, string $group, array $ids): Relay|int|false {} /** * Append a message to a stream. @@ -2609,7 +2609,7 @@ public function xadd( int $maxlen = 0, bool $approx = false, bool $nomkstream = false - ): \Relay\Relay|string|false { } + ): Relay|string|false {} /** * Claim ownership of stream message(s). @@ -2630,7 +2630,7 @@ public function xclaim( int $min_idle, array $ids, array $options - ): \Relay\Relay|array|bool { } + ): Relay|array|bool {} /** * Automatically take ownership of stream message(s) by metrics @@ -2653,7 +2653,7 @@ public function xautoclaim( string $start, int $count = -1, bool $justid = false - ): \Relay\Relay|bool|array { } + ): Relay|bool|array {} /** * Get the length of a stream. @@ -2662,7 +2662,7 @@ public function xautoclaim( * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function xlen(string $key): \Relay\Relay|int|false { } + public function xlen(string $key): Relay|int|false {} /** * Perform utility operations having to do with consumer groups @@ -2683,7 +2683,7 @@ public function xgroup( string $id_or_consumer = null, bool $mkstream = false, int $entries_read = -2 - ): mixed { } + ): mixed {} /** * Remove one or more specific IDs from a stream. @@ -2693,7 +2693,7 @@ public function xgroup( * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function xdel(string $key, array $ids): \Relay\Relay|int|false { } + public function xdel(string $key, array $ids): Relay|int|false {} /** * Retrieve information about a stream key. @@ -2705,7 +2705,7 @@ public function xdel(string $key, array $ids): \Relay\Relay|int|false { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1): mixed { } + public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = null, int $count = -1): mixed {} /** * Query pending entries in a stream. @@ -2728,7 +2728,7 @@ public function xpending( int $count = -1, ?string $consumer = null, int $idle = 0 - ): \Relay\Relay|array|false { } + ): Relay|array|false {} /** * Lists elements in a stream. @@ -2740,7 +2740,7 @@ public function xpending( * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function xrange(mixed $key, string $start, string $end, int $count = -1): \Relay\Relay|array|false { } + public function xrange(mixed $key, string $start, string $end, int $count = -1): Relay|array|false {} /** * Get a range of entries from a STREAM ke in reverse chronological order. @@ -2752,7 +2752,7 @@ public function xrange(mixed $key, string $start, string $end, int $count = -1): * @return array|bool */ #[\Relay\Attributes\RedisCommand] - public function xrevrange(string $key, string $end, string $start, int $count = -1): \Relay\Relay|array|bool { } + public function xrevrange(string $key, string $end, string $start, int $count = -1): Relay|array|bool {} /** * Read messages from a stream. @@ -2763,7 +2763,7 @@ public function xrevrange(string $key, string $end, string $start, int $count = * @return array|bool|null */ #[\Relay\Attributes\RedisCommand] - public function xread(array $streams, int $count = -1, int $block = -1): \Relay\Relay|array|bool|null { } + public function xread(array $streams, int $count = -1, int $block = -1): Relay|array|bool|null {} /** * Read messages from a stream using a consumer group. @@ -2782,7 +2782,7 @@ public function xreadgroup( array $streams, int $count = 1, int $block = 1 - ): \Relay\Relay|array|bool|null { } + ): Relay|array|bool|null {} /** * Truncate a STREAM key in various ways. @@ -2801,7 +2801,7 @@ public function xtrim( bool $approx = false, bool $minid = false, int $limit = -1 - ): \Relay\Relay|int|false { } + ): Relay|int|false {} /** * Adds all the specified members with the specified scores to the sorted set stored at key. @@ -2811,7 +2811,7 @@ public function xtrim( * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function zadd(mixed $key, mixed ...$args): mixed { } + public function zadd(mixed $key, mixed ...$args): mixed {} /** * When called with just the key argument, return a random element from the sorted set value stored at key. @@ -2822,7 +2822,7 @@ public function zadd(mixed $key, mixed ...$args): mixed { } * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function zrandmember(mixed $key, ?array $options = NULL): mixed { } + public function zrandmember(mixed $key, ?array $options = null): mixed {} /** * Returns the specified range of elements in the sorted set stored at key. @@ -2834,7 +2834,7 @@ public function zrandmember(mixed $key, ?array $options = NULL): mixed { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrange(mixed $key, string $start, string $end, mixed $options = null): \Relay\Relay|array|false { } + public function zrange(mixed $key, string $start, string $end, mixed $options = null): Relay|array|false {} /** * Returns the specified range of elements in the sorted set stored at key. @@ -2846,7 +2846,7 @@ public function zrange(mixed $key, string $start, string $end, mixed $options = * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrange(mixed $key, int $start, int $end, mixed $options = null): \Relay\Relay|array|false { } + public function zrevrange(mixed $key, int $start, int $end, mixed $options = null): Relay|array|false {} /** * Returns all the elements in the sorted set at key with a score between @@ -2859,7 +2859,7 @@ public function zrevrange(mixed $key, int $start, int $end, mixed $options = nul * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false { } + public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): Relay|array|false {} /** * Returns all the elements in the sorted set at key with a score between @@ -2872,7 +2872,7 @@ public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $optio * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|array|false { } + public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): Relay|array|false {} /** * Returns all the elements in the sorted set at key with a score between @@ -2886,7 +2886,7 @@ public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $op * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mixed $options = null): \Relay\Relay|int|false { } + public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mixed $options = null): Relay|int|false {} /** * When all the elements in a sorted set are inserted with the same score, @@ -2901,7 +2901,7 @@ public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mi * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1): \Relay\Relay|array|false { } + public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1): Relay|array|false {} /** * When all the elements in a sorted set are inserted with the same score, @@ -2916,7 +2916,7 @@ public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1 * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = -1, int $count = -1): \Relay\Relay|array|false { } + public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = -1, int $count = -1): Relay|array|false {} /** * Returns the rank of member in the sorted set stored at key, with the scores @@ -2928,7 +2928,7 @@ public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrank(mixed $key, mixed $rank): \Relay\Relay|int|false { } + public function zrank(mixed $key, mixed $rank): Relay|int|false {} /** * Returns the rank of member in the sorted set stored at key, with the scores @@ -2940,7 +2940,7 @@ public function zrank(mixed $key, mixed $rank): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrank(mixed $key, mixed $rank): \Relay\Relay|int|false { } + public function zrevrank(mixed $key, mixed $rank): Relay|int|false {} /** * Removes the specified members from the sorted set stored at key. @@ -2951,7 +2951,7 @@ public function zrevrank(mixed $key, mixed $rank): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zrem(mixed $key, mixed ...$args): \Relay\Relay|int|false { } + public function zrem(mixed $key, mixed ...$args): Relay|int|false {} /** * When all the elements in a sorted set are inserted with the same score, @@ -2965,7 +2965,7 @@ public function zrem(mixed $key, mixed ...$args): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zremrangebylex(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } + public function zremrangebylex(mixed $key, mixed $min, mixed $max): Relay|int|false {} /** * Removes all elements in the sorted set stored at key with rank between @@ -2978,7 +2978,7 @@ public function zremrangebylex(mixed $key, mixed $min, mixed $max): \Relay\Relay * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zremrangebyrank(mixed $key, int $start, int $end): \Relay\Relay|int|false { } + public function zremrangebyrank(mixed $key, int $start, int $end): Relay|int|false {} /** * Removes all elements in the sorted set stored at key with @@ -2990,7 +2990,7 @@ public function zremrangebyrank(mixed $key, int $start, int $end): \Relay\Relay| * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zremrangebyscore(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } + public function zremrangebyscore(mixed $key, mixed $min, mixed $max): Relay|int|false {} /** * Returns the sorted set cardinality (number of elements) of the sorted set stored at key. @@ -2999,7 +2999,7 @@ public function zremrangebyscore(mixed $key, mixed $min, mixed $max): \Relay\Rel * @return int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] - public function zcard(mixed $key): \Relay\Relay|int|false { } + public function zcard(mixed $key): Relay|int|false {} /** * Returns the number of elements in the sorted set at key with a score between min and max. @@ -3010,7 +3010,7 @@ public function zcard(mixed $key): \Relay\Relay|int|false { } * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } + public function zcount(mixed $key, mixed $min, mixed $max): Relay|int|false {} /** * This command is similar to ZDIFFSTORE, but instead of storing the @@ -3021,7 +3021,7 @@ public function zcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|fal * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zdiff(array $keys, ?array $options = null): \Relay\Relay|array|false { } + public function zdiff(array $keys, ?array $options = null): Relay|array|false {} /** * Computes the difference between the first and all successive @@ -3032,7 +3032,7 @@ public function zdiff(array $keys, ?array $options = null): \Relay\Relay|array|f * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zdiffstore(mixed $dst, array $keys): \Relay\Relay|int|false { } + public function zdiffstore(mixed $dst, array $keys): Relay|int|false {} /** * Increments the score of member in the sorted set stored at key by increment. @@ -3043,7 +3043,7 @@ public function zdiffstore(mixed $dst, array $keys): \Relay\Relay|int|false { } * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function zincrby(mixed $key, float $score, mixed $mem): \Relay\Relay|float|false { } + public function zincrby(mixed $key, float $score, mixed $mem): Relay|float|false {} /** * When all the elements in a sorted set are inserted with the same score, @@ -3056,7 +3056,7 @@ public function zincrby(mixed $key, float $score, mixed $mem): \Relay\Relay|floa * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zlexcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int|false { } + public function zlexcount(mixed $key, mixed $min, mixed $max): Relay|int|false {} /** * Returns the scores associated with the specified members in the sorted set stored at key. @@ -3066,7 +3066,7 @@ public function zlexcount(mixed $key, mixed $min, mixed $max): \Relay\Relay|int| * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zmscore(mixed $key, mixed ...$mems): \Relay\Relay|array|false { } + public function zmscore(mixed $key, mixed ...$mems): Relay|array|false {} /** * Returns the score of member in the sorted set at key. @@ -3076,7 +3076,7 @@ public function zmscore(mixed $key, mixed ...$mems): \Relay\Relay|array|false { * @return float|false */ #[\Relay\Attributes\RedisCommand] - public function zscore(mixed $key, mixed $member): \Relay\Relay|float|false { } + public function zscore(mixed $key, mixed $member): Relay|float|false {} /** * This command is similar to ZINTERSTORE, but instead of storing @@ -3088,7 +3088,7 @@ public function zscore(mixed $key, mixed $member): \Relay\Relay|float|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zinter(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false { } + public function zinter(array $keys, ?array $weights = null, mixed $options = null): Relay|array|false {} /** * Intersect multiple sorted sets and return the cardinality of the result. @@ -3098,7 +3098,7 @@ public function zinter(array $keys, ?array $weights = null, mixed $options = nul * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zintercard(array $keys, int $limit = -1): \Relay\Relay|int|false { } + public function zintercard(array $keys, int $limit = -1): Relay|int|false {} /** * Computes the intersection of numkeys sorted sets given by the @@ -3111,7 +3111,7 @@ public function zintercard(array $keys, int $limit = -1): \Relay\Relay|int|false * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false { } + public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): Relay|int|false {} /** * This command is similar to ZUNIONSTORE, but instead of storing @@ -3123,7 +3123,7 @@ public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mix * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zunion(array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|array|false { } + public function zunion(array $keys, ?array $weights = null, mixed $options = null): Relay|array|false {} /** * Computes the union of numkeys sorted sets given by the @@ -3136,7 +3136,7 @@ public function zunion(array $keys, ?array $weights = null, mixed $options = nul * @return int|false */ #[\Relay\Attributes\RedisCommand] - public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): \Relay\Relay|int|false { } + public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): Relay|int|false {} /** * Removes and returns up to count members with the lowest @@ -3147,7 +3147,7 @@ public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mix * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zpopmin(mixed $key, int $count = 1): \Relay\Relay|array|false { } + public function zpopmin(mixed $key, int $count = 1): Relay|array|false {} /** * Removes and returns up to count members with the highest @@ -3158,7 +3158,7 @@ public function zpopmin(mixed $key, int $count = 1): \Relay\Relay|array|false { * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function zpopmax(mixed $key, int $count = 1): \Relay\Relay|array|false { } + public function zpopmax(mixed $key, int $count = 1): Relay|array|false {} /** * Returns keys cached in runtime memory. @@ -3167,5 +3167,5 @@ public function zpopmax(mixed $key, int $count = 1): \Relay\Relay|array|false { * @return mixed */ #[\Relay\Attributes\Local] - public function _getKeys() { } + public function _getKeys() {} } diff --git a/relay/Sentinel.php b/relay/Sentinel.php index da92c07d1..9889cb0bc 100644 --- a/relay/Sentinel.php +++ b/relay/Sentinel.php @@ -7,7 +7,8 @@ * * @see https://redis.io/docs/management/sentinel/ */ -class Sentinel { +class Sentinel +{ /** * Whether to throw an exception on `-ERR` replies. Default: false * @@ -44,7 +45,7 @@ public function __construct( int $retry_interval = 0, float $read_timeout = 0, #[\SensitiveParameter] mixed $auth = null - ) { } + ) {} /** * Check if the current Sentinel configuration is able to reach the quorum needed @@ -54,7 +55,7 @@ public function __construct( * @return bool */ #[\Relay\Attributes\RedisCommand] - public function ckquorum(string $master): bool { } + public function ckquorum(string $master): bool {} /** * Force a failover as if the master was not reachable, @@ -64,7 +65,7 @@ public function ckquorum(string $master): bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function failover(string $master): bool { } + public function failover(string $master): bool {} /** * Force Sentinel to rewrite its configuration on disk, @@ -73,7 +74,7 @@ public function failover(string $master): bool { } * @return bool */ #[\Relay\Attributes\RedisCommand] - public function flushconfig(): bool { } + public function flushconfig(): bool {} /** * Returns the ip and port number of the master with that name. @@ -82,7 +83,7 @@ public function flushconfig(): bool { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function getMasterAddrByName(string $master): array|false { } + public function getMasterAddrByName(string $master): array|false {} /** * Returns the state and info of the specified master. @@ -91,7 +92,7 @@ public function getMasterAddrByName(string $master): array|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function master(string $master): array|false { } + public function master(string $master): array|false {} /** * Returns a list of monitored masters and their state. @@ -99,7 +100,7 @@ public function master(string $master): array|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function masters(): array|false { } + public function masters(): array|false {} /** * Returns the ID of the Sentinel instance. @@ -107,7 +108,7 @@ public function masters(): array|false { } * @return string */ #[\Relay\Attributes\RedisCommand] - public function myid(): string { } + public function myid(): string {} /** * Returns PONG if no message is provided, otherwise returns the message. @@ -116,7 +117,7 @@ public function myid(): string { } * @return string|bool */ #[\Relay\Attributes\RedisCommand] - public function ping(?string $message = null): string|bool { } + public function ping(?string $message = null): string|bool {} /** * Will reset all the masters with matching name. @@ -125,7 +126,7 @@ public function ping(?string $message = null): string|bool { } * @return int */ #[\Relay\Attributes\RedisCommand] - public function reset(string $pattern): int { } + public function reset(string $pattern): int {} /** * Returns a list of sentinel instances for this master, and their state. @@ -134,7 +135,7 @@ public function reset(string $pattern): int { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function sentinels(string $master): array|false { } + public function sentinels(string $master): array|false {} /** * Show a list of replicas for this master, and their state. @@ -143,7 +144,7 @@ public function sentinels(string $master): array|false { } * @return array|false */ #[\Relay\Attributes\RedisCommand] - public function slaves(string $master): array|false { } + public function slaves(string $master): array|false {} /** * Returns the last error message, if any. @@ -151,7 +152,7 @@ public function slaves(string $master): array|false { } * @return string|null */ #[\Relay\Attributes\Local] - public function getLastError(): string|null { } + public function getLastError(): string|null {} /** * Sets a client option. @@ -161,7 +162,7 @@ public function getLastError(): string|null { } * @return bool */ #[\Relay\Attributes\Local] - public function setOption(int $option, mixed $value): bool { } + public function setOption(int $option, mixed $value): bool {} /** * Returns a client option. @@ -170,5 +171,5 @@ public function setOption(int $option, mixed $value): bool { } * @return mixed */ #[\Relay\Attributes\Local] - public function getOption(int $option): mixed { } + public function getOption(int $option): mixed {} } From 4623981bb54858040b5d32c4eacc89c7a8b21339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Fri, 13 Jan 2023 08:44:17 -0800 Subject: [PATCH 272/419] fix phpdoc return type --- relay/Relay.php | 346 ++++++++++++++++++++++++------------------------ 1 file changed, 173 insertions(+), 173 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index c73182db4..5091911b3 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -181,7 +181,7 @@ class Relay /** * Integer representing the PhpRedis compatibility mode option. * - * Returns `false` instead of `null` if a key doesn’t exist and will throw an exception if there is an error. + * Returns `false` instead of `null` if a key doesn’t exist and will throw an exception if there is an error. * * @var int */ @@ -223,21 +223,21 @@ class Relay public const OPT_NULL_MULTIBULK_AS_NULL = 10; /** - * Integer representing Relay’s invalidations option. + * Integer representing Relay’s invalidations option. * * @var int */ public const OPT_CLIENT_INVALIDATIONS = 101; /** - * Integer representing Relay’s allow patterns option. + * Integer representing Relay’s allow patterns option. * * @var int */ public const OPT_ALLOW_PATTERNS = 102; /** - * Integer representing Relay’s ignore patterns option. + * Integer representing Relay’s ignore patterns option. * * @var int */ @@ -381,7 +381,7 @@ class Relay * @param float $connect_timeout * @param float $command_timeout * @param array $context - * @return \Relay\Relay + * @return Relay */ #[\Relay\Attributes\Server] public function __construct( @@ -814,7 +814,7 @@ public function rawCommand(string $cmd, mixed ...$args): mixed {} * Select the Redis logical database having the specified zero-based numeric index. * * @param int $db - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function select(int $db): Relay|bool {} @@ -835,7 +835,7 @@ public function auth(#[\SensitiveParameter] mixed $auth): bool {} * @see https://redis.io/commands/info * * @param string $sections,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function info(string ...$sections): Relay|array|false {} @@ -844,7 +844,7 @@ public function info(string ...$sections): Relay|array|false {} * Deletes all the keys of the currently selected database. * * @param bool $async - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function flushdb(bool $async = false): Relay|bool {} @@ -853,7 +853,7 @@ public function flushdb(bool $async = false): Relay|bool {} * Deletes all the keys of all the existing databases, not just the currently selected one. * * @param bool $async - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function flushall(bool $async = false): Relay|bool {} @@ -904,7 +904,7 @@ public static function flushMemory(?string $key = null, int $db = -1): bool {} /** * Returns the number of keys in the currently-selected database. * - * @return int + * @return Relay|int */ #[\Relay\Attributes\RedisCommand] public function dbsize(): Relay|int|false {} @@ -913,7 +913,7 @@ public function dbsize(): Relay|int|false {} * Serialize and return the value stored at key in a Redis-specific format. * * @param mixed $key - * @return string|false + * @return Relay|string|false */ #[\Relay\Attributes\RedisCommand] public function dump(mixed $key): Relay|string|false {} @@ -923,7 +923,7 @@ public function dump(mixed $key): Relay|string|false {} * * @param string $host * @param int $port - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function replicaof(?string $host = null, $port = 0): Relay|bool {} @@ -935,7 +935,7 @@ public function replicaof(?string $host = null, $port = 0): Relay|bool {} * @param int $ttl * @param string $value * @param array $options - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function restore(mixed $key, int $ttl, string $value, ?array $options = null): Relay|bool {} @@ -951,7 +951,7 @@ public function restore(mixed $key, int $ttl, string $value, ?array $options = n * @param bool $copy * @param bool $replace * @param mixed $credentials - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function migrate( @@ -971,7 +971,7 @@ public function migrate( * @param mixed $src * @param mixed $dst * @param array $options - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function copy(mixed $src, mixed $dst, ?array $options = null): Relay|int|false {} @@ -980,7 +980,7 @@ public function copy(mixed $src, mixed $dst, ?array $options = null): Relay|int| * Asks Redis to echo back the provided string. * * @param string $arg - * @return bool|string + * @return Relay|bool|string */ #[\Relay\Attributes\RedisCommand] public function echo(string $arg): Relay|bool|string {} @@ -989,7 +989,7 @@ public function echo(string $arg): Relay|bool|string {} * Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk. * * @param string $arg - * @return bool|string + * @return Relay|bool|string */ #[\Relay\Attributes\RedisCommand] public function ping(string $arg = null): Relay|bool|string {} @@ -997,7 +997,7 @@ public function ping(string $arg = null): Relay|bool|string {} /** * Returns the number of milliseoconds since Relay has seen activity from the server. * - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\Local] public function idleTime(): Relay|int|false {} @@ -1005,7 +1005,7 @@ public function idleTime(): Relay|int|false {} /** * Returns a random key from Redis. * - * @return string|null|bool + * @return Relay|string|null|bool */ #[\Relay\Attributes\RedisCommand] public function randomkey(): Relay|string|null|bool {} @@ -1013,7 +1013,7 @@ public function randomkey(): Relay|string|null|bool {} /** * Returns the current time from Redis. * - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function time(): Relay|array|false {} @@ -1021,7 +1021,7 @@ public function time(): Relay|array|false {} /** * Asynchronously rewrite the append-only file. * - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function bgrewriteaof(): Relay|bool {} @@ -1029,7 +1029,7 @@ public function bgrewriteaof(): Relay|bool {} /** * Returns the UNIX time stamp of the last successful save to disk. * - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function lastsave(): Relay|int|false {} @@ -1037,7 +1037,7 @@ public function lastsave(): Relay|int|false {} /** * Asynchronously save the dataset to disk. * - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function bgsave(): Relay|bool {} @@ -1045,7 +1045,7 @@ public function bgsave(): Relay|bool {} /** * Synchronously save the dataset to disk. * - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function save(): Relay|bool {} @@ -1053,7 +1053,7 @@ public function save(): Relay|bool {} /** * Returns the role of the instance in the context of replication. * - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function role(): Relay|array|false {} @@ -1062,7 +1062,7 @@ public function role(): Relay|array|false {} * Returns the remaining time to live of a key that has a timeout in seconds. * * @param mixed $key - * @return int + * @return Relay|int */ #[\Relay\Attributes\RedisCommand] public function ttl(mixed $key): Relay|int|false {} @@ -1071,7 +1071,7 @@ public function ttl(mixed $key): Relay|int|false {} * Returns the remaining time to live of a key that has a timeout in milliseconds. * * @param mixed $key - * @return int + * @return Relay|int */ #[\Relay\Attributes\RedisCommand] public function pttl(mixed $key): Relay|int|false {} @@ -1080,7 +1080,7 @@ public function pttl(mixed $key): Relay|int|false {} * Returns if key(s) exists. * * @param mixed $keys,... - * @return bool|int + * @return Relay|bool|int */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function exists(mixed ...$keys): Relay|bool|int {} @@ -1154,7 +1154,7 @@ public function client(string $operation, mixed ...$args): mixed {} * @param float $lat * @param string $member * @param mixed $other_triples_and_options,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function geoadd( @@ -1172,7 +1172,7 @@ public function geoadd( * @param string $src * @param string $dst * @param string|null $unit - * @return float|false + * @return Relay|float|false */ #[\Relay\Attributes\RedisCommand] public function geodist(string $key, string $src, string $dst, ?string $unit = null): Relay|float|false {} @@ -1183,7 +1183,7 @@ public function geodist(string $key, string $src, string $dst, ?string $unit = n * @param string $key * @param string $member * @param string $other_members,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function geohash(string $key, string $member, string ...$other_members): Relay|array|false {} @@ -1250,7 +1250,7 @@ public function georadius_ro(string $key, float $lng, float $lat, float $radius, * @param array|int|float $shape * @param string $unit * @param array $options - * @return array + * @return Relay|array */ #[\Relay\Attributes\RedisCommand] public function geosearch( @@ -1271,7 +1271,7 @@ public function geosearch( * @param array|int|float $shape * @param string $unit * @param array $options - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function geosearchstore( @@ -1309,7 +1309,7 @@ public function getset(mixed $key, mixed $value): mixed {} * @param mixed $key * @param int $start * @param int $end - * @return string|false + * @return Relay|string|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function getrange(mixed $key, int $start, int $end): Relay|string|false {} @@ -1321,7 +1321,7 @@ public function getrange(mixed $key, int $start, int $end): Relay|string|false { * @param mixed $key * @param int $start * @param mixed $value - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function setrange(mixed $key, int $start, mixed $value): Relay|int|false {} @@ -1331,7 +1331,7 @@ public function setrange(mixed $key, int $start, mixed $value): Relay|int|false * * @param mixed $key * @param int $pos - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function getbit(mixed $key, int $pos): Relay|int|false {} @@ -1343,7 +1343,7 @@ public function getbit(mixed $key, int $pos): Relay|int|false {} * @param int $start * @param int $end * @param bool $by_bit - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit = false): Relay|int|false {} @@ -1354,7 +1354,7 @@ public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit * @param string $operation * @param mixed $key * @param string $value - * @return array|bool + * @return Relay|array|bool */ #[\Relay\Attributes\RedisCommand] public function config(string $operation, mixed $key = null, ?string $value = null): Relay|array|bool {} @@ -1363,7 +1363,7 @@ public function config(string $operation, mixed $key = null, ?string $value = nu * Return an array with details about every Redis command. * * @param array $args,... - * @return array|int|false + * @return Relay|array|int|false */ #[\Relay\Attributes\RedisCommand] public function command(mixed ...$args): Relay|array|int|false {} @@ -1375,7 +1375,7 @@ public function command(mixed ...$args): Relay|array|int|false {} * @param string $dstkey * @param string $srckey * @param string $other_keys,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function bitop(string $operation, string $dstkey, string $srckey, string ...$other_keys): Relay|int|false {} @@ -1388,7 +1388,7 @@ public function bitop(string $operation, string $dstkey, string $srckey, string * @param int $start * @param int $end * @param bool $bybit - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, bool $bybit = false): Relay|int|false {} @@ -1399,7 +1399,7 @@ public function bitpos(mixed $key, int $bit, int $start = null, int $end = null, * @param mixed $key * @param int $pos * @param int $val - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function setbit(mixed $key, int $pos, int $val): Relay|int|false {} @@ -1422,7 +1422,7 @@ public function acl(string $cmd, string ...$args): mixed {} * * @param mixed $key * @param mixed $value - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function append(mixed $key, mixed $value): Relay|int|false {} @@ -1467,7 +1467,7 @@ public function getdel(mixed $key): mixed {} * @param mixed $key * @param int $seconds * @param mixed $value - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function setex(mixed $key, int $seconds, mixed $value): Relay|bool {} @@ -1477,7 +1477,7 @@ public function setex(mixed $key, int $seconds, mixed $value): Relay|bool {} * * @param string $key * @param array $elements - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function pfadd(string $key, array $elements): Relay|int|false {} @@ -1486,7 +1486,7 @@ public function pfadd(string $key, array $elements): Relay|int|false {} * Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). * * @param string $key - * @return int + * @return Relay|int */ #[\Relay\Attributes\RedisCommand] public function pfcount(string $key): Relay|int {} @@ -1496,7 +1496,7 @@ public function pfcount(string $key): Relay|int {} * * @param string $dst * @param array $srckeys - * @return bool + * @return Relay|bool */ public function pfmerge(string $dst, array $srckeys): Relay|bool {} @@ -1507,7 +1507,7 @@ public function pfmerge(string $dst, array $srckeys): Relay|bool {} * @param mixed $key * @param int $milliseconds * @param mixed $value - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function psetex(mixed $key, int $milliseconds, mixed $value): Relay|bool {} @@ -1517,7 +1517,7 @@ public function psetex(mixed $key, int $milliseconds, mixed $value): Relay|bool * * @param string $channel * @param string $message - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function publish(string $channel, string $message): Relay|int|false {} @@ -1529,7 +1529,7 @@ public function publish(string $channel, string $message): Relay|int|false {} * * @param mixed $key * @param mixed $value - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function setnx(mixed $key, mixed $value): Relay|bool {} @@ -1538,7 +1538,7 @@ public function setnx(mixed $key, mixed $value): Relay|bool {} * Returns the values of all specified keys. * * @param array $keys - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function mget(array $keys): Relay|array|false {} @@ -1548,7 +1548,7 @@ public function mget(array $keys): Relay|array|false {} * * @param mixed $key * @param int $db - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function move(mixed $key, int $db): Relay|int|false {} @@ -1558,7 +1558,7 @@ public function move(mixed $key, int $db): Relay|int|false {} * MSET replaces existing values with new values, just as regular SET. * * @param array $kvals - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function mset(array $kvals): Relay|bool {} @@ -1568,7 +1568,7 @@ public function mset(array $kvals): Relay|bool {} * MSETNX will not perform any operation at all even if just a single key already exists. * * @param array $kvals - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function msetnx(array $kvals): Relay|bool {} @@ -1578,7 +1578,7 @@ public function msetnx(array $kvals): Relay|bool {} * * @param mixed $key * @param mixed $newkey - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function rename(mixed $key, mixed $newkey): Relay|bool {} @@ -1588,7 +1588,7 @@ public function rename(mixed $key, mixed $newkey): Relay|bool {} * * @param mixed $key * @param mixed $newkey - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function renamenx(mixed $key, mixed $newkey): Relay|bool {} @@ -1597,7 +1597,7 @@ public function renamenx(mixed $key, mixed $newkey): Relay|bool {} * Removes the specified keys. * * @param mixed $keys,... - * @return int|bool + * @return Relay|int|bool */ #[\Relay\Attributes\RedisCommand] public function del(mixed ...$keys): Relay|int|bool {} @@ -1606,7 +1606,7 @@ public function del(mixed ...$keys): Relay|int|bool {} * Removes the specified keys without blocking Redis. * * @param mixed $keys,... - * @return int + * @return Relay|int */ #[\Relay\Attributes\RedisCommand] public function unlink(mixed ...$keys): Relay|int|false {} @@ -1617,7 +1617,7 @@ public function unlink(mixed ...$keys): Relay|int|false {} * @param mixed $key * @param int $seconds * @param string $mode - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function expire(mixed $key, int $seconds, ?string $mode = null): Relay|bool {} @@ -1627,7 +1627,7 @@ public function expire(mixed $key, int $seconds, ?string $mode = null): Relay|bo * * @param mixed $key * @param int $milliseconds - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function pexpire(mixed $key, int $milliseconds): Relay|bool {} @@ -1637,7 +1637,7 @@ public function pexpire(mixed $key, int $milliseconds): Relay|bool {} * * @param mixed $key * @param int $timestamp - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function expireat(mixed $key, int $timestamp): Relay|bool {} @@ -1648,7 +1648,7 @@ public function expireat(mixed $key, int $timestamp): Relay|bool {} * If the key does not exist -2. * * @param mixed $key - * @return int|false + * @return Relay|int|false * */ #[\Relay\Attributes\RedisCommand] public function expiretime(mixed $key): Relay|int|false {} @@ -1668,7 +1668,7 @@ public function pexpireat(mixed $key, int $timestamp_ms): Relay|bool {} * timestamp in milliseconds instead of seconds. * * @param mixed $key - * @return int|false + * @return Relay|int|false * */ #[\Relay\Attributes\RedisCommand] public function pexpiretime(mixed $key): Relay|int|false {} @@ -1677,7 +1677,7 @@ public function pexpiretime(mixed $key): Relay|int|false {} * Remove the existing timeout on key, turning the key from volatile to persistent. * * @param mixed $key - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function persist(mixed $key): Relay|bool {} @@ -1690,7 +1690,7 @@ public function persist(mixed $key): Relay|bool {} * return the string that Redis returns. * * @param mixed $key - * @return int|string|false + * @return Relay|int|string|false */ #[\Relay\Attributes\RedisCommand] public function type(mixed $key): Relay|int|string|bool {} @@ -1704,7 +1704,7 @@ public function type(mixed $key): Relay|int|string|bool {} * @param mixed $dstkey * @param string $srcpos * @param string $dstpos - * @return string|null|false + * @return Relay|string|null|false */ #[\Relay\Attributes\RedisCommand] public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): Relay|string|null|false {} @@ -1719,7 +1719,7 @@ public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstp * @param string $srcpos * @param string $dstpos * @param float $timeout - * @return string|null|false + * @return Relay|string|null|false */ #[\Relay\Attributes\RedisCommand] public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): Relay|string|null|false {} @@ -1730,7 +1730,7 @@ public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dst * @param mixed $key * @param int $start * @param int $stop - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function lrange(mixed $key, int $start, int $stop): Relay|array|false {} @@ -1741,7 +1741,7 @@ public function lrange(mixed $key, int $start, int $stop): Relay|array|false {} * @param mixed $key * @param mixed $mem * @param mixed $mems,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function lpush(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} @@ -1752,7 +1752,7 @@ public function lpush(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false { * @param mixed $key * @param mixed $mem * @param mixed $mems,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function rpush(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} @@ -1764,7 +1764,7 @@ public function rpush(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false { * @param mixed $key * @param mixed $mem * @param mixed $mems,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function lpushx(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} @@ -1776,7 +1776,7 @@ public function lpushx(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false * @param mixed $key * @param mixed $mem * @param mixed $mems,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function rpushx(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false {} @@ -1787,7 +1787,7 @@ public function rpushx(mixed $key, mixed $mem, mixed ...$mems): Relay|int|false * @param mixed $key * @param int $index * @param mixed $mem - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function lset(mixed $key, int $index, mixed $mem): Relay|bool {} @@ -1808,7 +1808,7 @@ public function lpop(mixed $key, int $count = 1): mixed {} * @param mixed $key * @param mixed $value * @param array $options - * @return int|array|false|null + * @return Relay|int|array|false|null */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function lpos(mixed $key, mixed $value, ?array $options = null): Relay|int|array|false|null {} @@ -1854,7 +1854,7 @@ public function brpoplpush(mixed $source, mixed $dest, float $timeout): mixed {} * @param string|array $key * @param string|float $timeout_or_key * @param array $extra_args,... - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function blpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} @@ -1866,7 +1866,7 @@ public function blpop(string|array $key, string|float $timeout_or_key, mixed ... * @param array $keys * @param string $from * @param int $count - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function blmpop(float $timeout, array $keys, string $from, int $count = 1): Relay|array|null|false {} @@ -1878,7 +1878,7 @@ public function blmpop(float $timeout, array $keys, string $from, int $count = 1 * @param array $keys * @param string $from * @param int $count - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function bzmpop(float $timeout, array $keys, string $from, int $count = 1): Relay|array|null|false {} @@ -1889,7 +1889,7 @@ public function bzmpop(float $timeout, array $keys, string $from, int $count = 1 * @param array $keys * @param string $from * @param int $count - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function lmpop(array $keys, string $from, int $count = 1): Relay|array|null|false {} @@ -1901,7 +1901,7 @@ public function lmpop(array $keys, string $from, int $count = 1): Relay|array|nu * @param array $keys * @param string $from * @param int $count - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function zmpop(array $keys, string $from, int $count = 1): Relay|array|null|false {} @@ -1913,7 +1913,7 @@ public function zmpop(array $keys, string $from, int $count = 1): Relay|array|nu * @param string|array $key * @param string|float $timeout_or_key * @param array $extra_args,... - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function brpop(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} @@ -1924,7 +1924,7 @@ public function brpop(string|array $key, string|float $timeout_or_key, mixed ... * @param string|array $key * @param string|float $timeout_or_key * @param array $extra_args,... - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} @@ -1935,7 +1935,7 @@ public function bzpopmax(string|array $key, string|float $timeout_or_key, mixed * @param string|array $key * @param string|float $timeout_or_key * @param array $extra_args,... - * @return array|null|false + * @return Relay|array|null|false */ #[\Relay\Attributes\RedisCommand] public function bzpopmin(string|array $key, string|float $timeout_or_key, mixed ...$extra_args): Relay|array|null|false {} @@ -1956,7 +1956,7 @@ public function object(string $op, mixed $key): mixed {} * * @param mixed $key * @param mixed $members,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function geopos(mixed $key, mixed ...$members): Relay|array|false {} @@ -1967,7 +1967,7 @@ public function geopos(mixed $key, mixed ...$members): Relay|array|false {} * @param mixed $key * @param mixed $mem * @param int $count - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function lrem(mixed $key, mixed $mem, int $count = 0): Relay|int|false {} @@ -1989,7 +1989,7 @@ public function lindex(mixed $key, int $index): mixed {} * @param string $op * @param mixed $pivot * @param mixed $element - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): Relay|int|false {} @@ -2000,7 +2000,7 @@ public function linsert(mixed $key, string $op, mixed $pivot, mixed $element): R * @param mixed $key * @param int $start * @param int $end - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function ltrim(mixed $key, int $start, int $end): Relay|bool {} @@ -2020,7 +2020,7 @@ public function hget(mixed $hash, mixed $member): mixed {} * * @param mixed $hash * @param mixed $member - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hstrlen(mixed $hash, mixed $member): Relay|int|false {} @@ -2029,7 +2029,7 @@ public function hstrlen(mixed $hash, mixed $member): Relay|int|false {} * Returns all fields and values of the hash stored at key. * * @param mixed $hash - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hgetall(mixed $hash): Relay|array|false {} @@ -2038,7 +2038,7 @@ public function hgetall(mixed $hash): Relay|array|false {} * Returns all field names in the hash stored at key. * * @param mixed $hash - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hkeys(mixed $hash): Relay|array|false {} @@ -2047,7 +2047,7 @@ public function hkeys(mixed $hash): Relay|array|false {} * Returns all values in the hash stored at key. * * @param mixed $hash - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hvals(mixed $hash): Relay|array|false {} @@ -2057,7 +2057,7 @@ public function hvals(mixed $hash): Relay|array|false {} * * @param mixed $hash * @param array $members - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hmget(mixed $hash, array $members): Relay|array|false {} @@ -2067,7 +2067,7 @@ public function hmget(mixed $hash, array $members): Relay|array|false {} * * @param mixed $hash * @param array $options - * @return array|string|false + * @return Relay|array|string|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hrandfield(mixed $hash, ?array $options = null): Relay|array|string|false {} @@ -2077,7 +2077,7 @@ public function hrandfield(mixed $hash, ?array $options = null): Relay|array|str * * @param mixed $hash * @param array $members - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function hmset(mixed $hash, array $members): Relay|bool {} @@ -2087,7 +2087,7 @@ public function hmset(mixed $hash, array $members): Relay|bool {} * * @param mixed $hash * @param mixed $member - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hexists(mixed $hash, mixed $member): Relay|bool {} @@ -2098,7 +2098,7 @@ public function hexists(mixed $hash, mixed $member): Relay|bool {} * @param mixed $hash * @param mixed $member * @param mixed $value - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function hsetnx(mixed $hash, mixed $member, mixed $value): Relay|bool {} @@ -2110,7 +2110,7 @@ public function hsetnx(mixed $hash, mixed $member, mixed $value): Relay|bool {} * @param mixed $mem * @param mixed $val * @param mixed $kvals,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): Relay|int|false {} @@ -2121,7 +2121,7 @@ public function hset(mixed $key, mixed $mem, mixed $val, mixed ...$kvals): Relay * @param mixed $key * @param mixed $mem * @param string $mems,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function hdel(mixed $key, mixed $mem, string ...$mems): Relay|int|false {} @@ -2132,7 +2132,7 @@ public function hdel(mixed $key, mixed $mem, string ...$mems): Relay|int|false { * @param mixed $key * @param mixed $mem * @param int $value - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function hincrby(mixed $key, mixed $mem, int $value): Relay|int|false {} @@ -2144,7 +2144,7 @@ public function hincrby(mixed $key, mixed $mem, int $value): Relay|int|false {} * @param mixed $key * @param mixed $mem * @param float $value - * @return float|bool + * @return Relay|float|bool */ #[\Relay\Attributes\RedisCommand] public function hincrbyfloat(mixed $key, mixed $mem, float $value): Relay|float|bool {} @@ -2154,7 +2154,7 @@ public function hincrbyfloat(mixed $key, mixed $mem, float $value): Relay|float| * * @param mixed $key * @param int $by - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function incr(mixed $key, int $by = 1): Relay|int|false {} @@ -2164,7 +2164,7 @@ public function incr(mixed $key, int $by = 1): Relay|int|false {} * * @param mixed $key * @param int $by - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function decr(mixed $key, int $by = 1): Relay|int|false {} @@ -2174,7 +2174,7 @@ public function decr(mixed $key, int $by = 1): Relay|int|false {} * * @param mixed $key * @param int $value - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function incrby(mixed $key, int $value): Relay|int|false {} @@ -2184,7 +2184,7 @@ public function incrby(mixed $key, int $value): Relay|int|false {} * * @param mixed $key * @param int $value - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function decrby(mixed $key, int $value): Relay|int|false {} @@ -2194,7 +2194,7 @@ public function decrby(mixed $key, int $value): Relay|int|false {} * * @param mixed $key * @param float $value - * @return float|false + * @return Relay|float|false */ #[\Relay\Attributes\RedisCommand] public function incrbyfloat(mixed $key, float $value): Relay|float|false {} @@ -2204,7 +2204,7 @@ public function incrbyfloat(mixed $key, float $value): Relay|float|false {} * * @param mixed $key * @param mixed $other_keys,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function sdiff(mixed $key, mixed ...$other_keys): Relay|array|false {} @@ -2215,7 +2215,7 @@ public function sdiff(mixed $key, mixed ...$other_keys): Relay|array|false {} * * @param mixed $key * @param mixed $other_keys,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function sdiffstore(mixed $key, mixed ...$other_keys): Relay|int|false {} @@ -2225,7 +2225,7 @@ public function sdiffstore(mixed $key, mixed ...$other_keys): Relay|int|false {} * * @param mixed $key * @param mixed $other_keys,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function sinter(mixed $key, mixed ...$other_keys): Relay|array|false {} @@ -2235,7 +2235,7 @@ public function sinter(mixed $key, mixed ...$other_keys): Relay|array|false {} * * @param array $keys * @param int $limit - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function sintercard(array $keys, int $limit = -1): Relay|int|false {} @@ -2246,7 +2246,7 @@ public function sintercard(array $keys, int $limit = -1): Relay|int|false {} * * @param mixed $key * @param mixed $other_keys,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function sinterstore(mixed $key, mixed ...$other_keys): Relay|int|false {} @@ -2256,7 +2256,7 @@ public function sinterstore(mixed $key, mixed ...$other_keys): Relay|int|false { * * @param mixed $key * @param mixed $other_keys,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function sunion(mixed $key, mixed ...$other_keys): Relay|array|false {} @@ -2267,7 +2267,7 @@ public function sunion(mixed $key, mixed ...$other_keys): Relay|array|false {} * * @param mixed $key * @param mixed $other_keys,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function sunionstore(mixed $key, mixed ...$other_keys): Relay|int|false {} @@ -2277,7 +2277,7 @@ public function sunionstore(mixed $key, mixed ...$other_keys): Relay|int|false { * * @param array|string $key_or_array * @param mixed $more_keys,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function touch(array|string $key_or_array, mixed ...$more_keys): Relay|int|false {} @@ -2285,7 +2285,7 @@ public function touch(array|string $key_or_array, mixed ...$more_keys): Relay|in /** * A pipeline block is simply transmitted faster to the server (like `MULTI`), but without any guarantee of atomicity. * - * @return bool|\Relay\Relay + * @return Relay|bool */ #[\Relay\Attributes\Local] public function pipeline(): Relay|bool {} @@ -2296,7 +2296,7 @@ public function pipeline(): Relay|bool {} * Accepts `Relay::MULTI` and `Relay::PIPELINE` modes. * * @param int $mode - * @return bool|\Relay\Relay + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function multi(int $mode = 0): Relay|bool {} @@ -2304,7 +2304,7 @@ public function multi(int $mode = 0): Relay|bool {} /** * Executes all previously queued commands in a transaction and restores the connection state to normal. * - * @return array|bool + * @return Relay|array|bool */ #[\Relay\Attributes\RedisCommand] public function exec(): Relay|array|bool {} @@ -2315,7 +2315,7 @@ public function exec(): Relay|array|bool {} * * @param int $replicas * @param int $timeout - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function wait(int $replicas, $timeout): Relay|int|false {} @@ -2325,7 +2325,7 @@ public function wait(int $replicas, $timeout): Relay|int|false {} * * @param mixed $key * @param mixed $other_keys,... - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function watch(mixed $key, mixed ...$other_keys): Relay|bool {} @@ -2334,7 +2334,7 @@ public function watch(mixed $key, mixed ...$other_keys): Relay|bool {} * Flushes all the previously watched keys for a transaction. * If you call EXEC or DISCARD, there's no need to manually call UNWATCH. * - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function unwatch(): Relay|bool {} @@ -2418,7 +2418,7 @@ public function zscan(mixed $key, mixed &$iterator, mixed $match = null, int $co * Returns all keys matching pattern. * * @param mixed $pattern - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function keys(mixed $pattern): Relay|array|false {} @@ -2428,7 +2428,7 @@ public function keys(mixed $pattern): Relay|array|false {} * * @param string $operation * @param string $extra_args,... - * @return array|int|bool + * @return Relay|array|int|bool */ #[\Relay\Attributes\RedisCommand] public function slowlog(string $operation, string ...$extra_args): Relay|array|int|bool {} @@ -2437,7 +2437,7 @@ public function slowlog(string $operation, string ...$extra_args): Relay|array|i * Returns all the members of the set value stored at `$key`. * * @param mixed $set - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function smembers(mixed $set): Relay|array|false {} @@ -2447,7 +2447,7 @@ public function smembers(mixed $set): Relay|array|false {} * * @param mixed $set * @param mixed $member - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function sismember(mixed $set, mixed $member): Relay|bool {} @@ -2457,7 +2457,7 @@ public function sismember(mixed $set, mixed $member): Relay|bool {} * * @param mixed $set * @param mixed $members,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function smismember(mixed $set, mixed ...$members): Relay|array|false {} @@ -2468,7 +2468,7 @@ public function smismember(mixed $set, mixed ...$members): Relay|array|false {} * @param mixed $set * @param mixed $member * @param mixed $members,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function srem(mixed $set, mixed $member, mixed ...$members): Relay|int|false {} @@ -2479,7 +2479,7 @@ public function srem(mixed $set, mixed $member, mixed ...$members): Relay|int|fa * @param mixed $set * @param mixed $member * @param mixed $members,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function sadd(mixed $set, mixed $member, mixed ...$members): Relay|int|false {} @@ -2489,7 +2489,7 @@ public function sadd(mixed $set, mixed $member, mixed ...$members): Relay|int|fa * * @param mixed $key * @param array $options - * @return array|int|false + * @return Relay|array|int|false */ #[\Relay\Attributes\RedisCommand] public function sort(mixed $key, array $options = []): Relay|array|int|false {} @@ -2499,7 +2499,7 @@ public function sort(mixed $key, array $options = []): Relay|array|int|false {} * * @param mixed $key * @param array $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function sort_ro(mixed $key, array $options = []): Relay|array|false {} @@ -2510,7 +2510,7 @@ public function sort_ro(mixed $key, array $options = []): Relay|array|false {} * @param mixed $srcset * @param mixed $dstset * @param mixed $member - * @return bool + * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] public function smove(mixed $srcset, mixed $dstset, mixed $member): Relay|bool {} @@ -2539,7 +2539,7 @@ public function srandmember(mixed $set, int $count = 1): mixed {} * Returns the set cardinality (number of elements) of the set stored at `$key`. * * @param mixed $key - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function scard(mixed $key): Relay|int|false {} @@ -2558,7 +2558,7 @@ public function script(string $command, string ...$args): mixed {} * Returns the length of the string value stored at `$key`. * * @param mixed $key - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function strlen(mixed $key): Relay|int|false {} @@ -2567,7 +2567,7 @@ public function strlen(mixed $key): Relay|int|false {} * Returns the number of fields contained in the hash stored at `$key`. * * @param mixed $key - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function hlen(mixed $key): Relay|int|false {} @@ -2576,7 +2576,7 @@ public function hlen(mixed $key): Relay|int|false {} * Returns the length of the list stored at `$key`. * * @param mixed $key - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function llen(mixed $key): Relay|int|false {} @@ -2587,7 +2587,7 @@ public function llen(mixed $key): Relay|int|false {} * @param mixed $key * @param string $group * @param array $ids - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function xack(mixed $key, string $group, array $ids): Relay|int|false {} @@ -2600,7 +2600,7 @@ public function xack(mixed $key, string $group, array $ids): Relay|int|false {} * @param int $maxlen * @param bool $approx * @param bool $nomkstream - * @return string|false + * @return Relay|string|false */ public function xadd( string $key, @@ -2620,7 +2620,7 @@ public function xadd( * @param int $min_idle * @param array $ids * @param array $options - * @return array|bool + * @return Relay|array|bool */ #[\Relay\Attributes\RedisCommand] public function xclaim( @@ -2642,7 +2642,7 @@ public function xclaim( * @param string $start * @param int $count * @param bool $justid - * @return array|bool + * @return Relay|array|bool */ #[\Relay\Attributes\RedisCommand] public function xautoclaim( @@ -2659,7 +2659,7 @@ public function xautoclaim( * Get the length of a stream. * * @param string $key - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function xlen(string $key): Relay|int|false {} @@ -2690,7 +2690,7 @@ public function xgroup( * * @param string $key * @param array $ids - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function xdel(string $key, array $ids): Relay|int|false {} @@ -2701,7 +2701,7 @@ public function xdel(string $key, array $ids): Relay|int|false {} * @param string $operation * @param string $arg1 * @param string $arg2 - * @param int $count + * @param int $count * @return mixed */ #[\Relay\Attributes\RedisCommand] @@ -2717,7 +2717,7 @@ public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = n * @param int $count * @param string $consumer * @param int $idle - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function xpending( @@ -2737,7 +2737,7 @@ public function xpending( * @param string $start * @param string $end * @param int $count = -1 - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function xrange(mixed $key, string $start, string $end, int $count = -1): Relay|array|false {} @@ -2749,7 +2749,7 @@ public function xrange(mixed $key, string $start, string $end, int $count = -1): * @param string $end * @param string $start * @param int $count - * @return array|bool + * @return Relay|array|bool */ #[\Relay\Attributes\RedisCommand] public function xrevrange(string $key, string $end, string $start, int $count = -1): Relay|array|bool {} @@ -2760,7 +2760,7 @@ public function xrevrange(string $key, string $end, string $start, int $count = * @param array $streams * @param int $count * @param int $block - * @return array|bool|null + * @return Relay|array|bool|null */ #[\Relay\Attributes\RedisCommand] public function xread(array $streams, int $count = -1, int $block = -1): Relay|array|bool|null {} @@ -2773,7 +2773,7 @@ public function xread(array $streams, int $count = -1, int $block = -1): Relay|a * @param array $streams * @param int $count * @param int $block - * @return array|bool|null + * @return Relay|array|bool|null */ #[\Relay\Attributes\RedisCommand] public function xreadgroup( @@ -2792,7 +2792,7 @@ public function xreadgroup( * @param bool $approx * @param bool $minid * @param int $limit - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function xtrim( @@ -2831,7 +2831,7 @@ public function zrandmember(mixed $key, ?array $options = null): mixed {} * @param string $start * @param string $end * @param mixed $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zrange(mixed $key, string $start, string $end, mixed $options = null): Relay|array|false {} @@ -2843,7 +2843,7 @@ public function zrange(mixed $key, string $start, string $end, mixed $options = * @param int $start * @param int $end * @param mixed $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zrevrange(mixed $key, int $start, int $end, mixed $options = null): Relay|array|false {} @@ -2856,7 +2856,7 @@ public function zrevrange(mixed $key, int $start, int $end, mixed $options = nul * @param mixed $start * @param mixed $end * @param mixed $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): Relay|array|false {} @@ -2869,7 +2869,7 @@ public function zrangebyscore(mixed $key, mixed $start, mixed $end, mixed $optio * @param mixed $start * @param mixed $end * @param mixed $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $options = null): Relay|array|false {} @@ -2883,7 +2883,7 @@ public function zrevrangebyscore(mixed $key, mixed $start, mixed $end, mixed $op * @param mixed $start * @param mixed $end * @param mixed $options - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mixed $options = null): Relay|int|false {} @@ -2898,7 +2898,7 @@ public function zrangestore(mixed $dst, mixed $src, mixed $start, mixed $end, mi * @param mixed $max * @param int $offset * @param int $count - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1): Relay|array|false {} @@ -2913,7 +2913,7 @@ public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1 * @param mixed $min * @param int $offset * @param int $count - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = -1, int $count = -1): Relay|array|false {} @@ -2925,7 +2925,7 @@ public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = * * @param mixed $key * @param mixed $rank - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zrank(mixed $key, mixed $rank): Relay|int|false {} @@ -2937,7 +2937,7 @@ public function zrank(mixed $key, mixed $rank): Relay|int|false {} * * @param mixed $key * @param mixed $rank - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zrevrank(mixed $key, mixed $rank): Relay|int|false {} @@ -2948,7 +2948,7 @@ public function zrevrank(mixed $key, mixed $rank): Relay|int|false {} * * @param mixed $key * @param mixed $args,... - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zrem(mixed $key, mixed ...$args): Relay|int|false {} @@ -2962,7 +2962,7 @@ public function zrem(mixed $key, mixed ...$args): Relay|int|false {} * @param mixed $key * @param mixed $min * @param mixed $max - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zremrangebylex(mixed $key, mixed $min, mixed $max): Relay|int|false {} @@ -2975,7 +2975,7 @@ public function zremrangebylex(mixed $key, mixed $min, mixed $max): Relay|int|fa * @param mixed $key * @param int $start * @param int $end - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zremrangebyrank(mixed $key, int $start, int $end): Relay|int|false {} @@ -2987,7 +2987,7 @@ public function zremrangebyrank(mixed $key, int $start, int $end): Relay|int|fal * @param mixed $key * @param mixed $min * @param mixed $max - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zremrangebyscore(mixed $key, mixed $min, mixed $max): Relay|int|false {} @@ -2996,7 +2996,7 @@ public function zremrangebyscore(mixed $key, mixed $min, mixed $max): Relay|int| * Returns the sorted set cardinality (number of elements) of the sorted set stored at key. * * @param mixed $key - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function zcard(mixed $key): Relay|int|false {} @@ -3007,7 +3007,7 @@ public function zcard(mixed $key): Relay|int|false {} * @param mixed $key * @param mixed $min * @param mixed $max - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zcount(mixed $key, mixed $min, mixed $max): Relay|int|false {} @@ -3018,7 +3018,7 @@ public function zcount(mixed $key, mixed $min, mixed $max): Relay|int|false {} * * @param array $keys * @param array $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zdiff(array $keys, ?array $options = null): Relay|array|false {} @@ -3029,7 +3029,7 @@ public function zdiff(array $keys, ?array $options = null): Relay|array|false {} * * @param mixed $dst * @param array $keys - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zdiffstore(mixed $dst, array $keys): Relay|int|false {} @@ -3040,7 +3040,7 @@ public function zdiffstore(mixed $dst, array $keys): Relay|int|false {} * @param mixed $key * @param float $score * @param mixed $mem - * @return float|false + * @return Relay|float|false */ #[\Relay\Attributes\RedisCommand] public function zincrby(mixed $key, float $score, mixed $mem): Relay|float|false {} @@ -3053,7 +3053,7 @@ public function zincrby(mixed $key, float $score, mixed $mem): Relay|float|false * @param mixed $key * @param mixed $min * @param mixed $max - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zlexcount(mixed $key, mixed $min, mixed $max): Relay|int|false {} @@ -3063,7 +3063,7 @@ public function zlexcount(mixed $key, mixed $min, mixed $max): Relay|int|false { * * @param mixed $key * @param mixed $mems,... - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zmscore(mixed $key, mixed ...$mems): Relay|array|false {} @@ -3073,7 +3073,7 @@ public function zmscore(mixed $key, mixed ...$mems): Relay|array|false {} * * @param mixed $key * @param mixed $member - * @return float|false + * @return Relay|float|false */ #[\Relay\Attributes\RedisCommand] public function zscore(mixed $key, mixed $member): Relay|float|false {} @@ -3085,7 +3085,7 @@ public function zscore(mixed $key, mixed $member): Relay|float|false {} * @param array $keys * @param array $weights * @param mixed $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zinter(array $keys, ?array $weights = null, mixed $options = null): Relay|array|false {} @@ -3095,7 +3095,7 @@ public function zinter(array $keys, ?array $weights = null, mixed $options = nul * * @param array $keys * @param int $limit - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zintercard(array $keys, int $limit = -1): Relay|int|false {} @@ -3108,7 +3108,7 @@ public function zintercard(array $keys, int $limit = -1): Relay|int|false {} * @param array $keys * @param array $weights * @param mixed $options - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): Relay|int|false {} @@ -3120,7 +3120,7 @@ public function zinterstore(mixed $dst, array $keys, ?array $weights = null, mix * @param array $keys * @param array $weights * @param mixed $options - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zunion(array $keys, ?array $weights = null, mixed $options = null): Relay|array|false {} @@ -3133,7 +3133,7 @@ public function zunion(array $keys, ?array $weights = null, mixed $options = nul * @param array $keys * @param array $weights * @param mixed $options - * @return int|false + * @return Relay|int|false */ #[\Relay\Attributes\RedisCommand] public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mixed $options = null): Relay|int|false {} @@ -3144,7 +3144,7 @@ public function zunionstore(mixed $dst, array $keys, ?array $weights = null, mix * * @param mixed $key * @param int $count - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zpopmin(mixed $key, int $count = 1): Relay|array|false {} @@ -3155,7 +3155,7 @@ public function zpopmin(mixed $key, int $count = 1): Relay|array|false {} * * @param mixed $key * @param int $count - * @return array|false + * @return Relay|array|false */ #[\Relay\Attributes\RedisCommand] public function zpopmax(mixed $key, int $count = 1): Relay|array|false {} From 295b01dd2d6b47aa60c5ac1c3aec915bc3d5baa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Thu, 26 Jan 2023 11:27:57 -0800 Subject: [PATCH 273/419] remove constructor @return --- relay/Relay.php | 1 - relay/Sentinel.php | 1 - 2 files changed, 2 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index 5091911b3..1b07e6fa5 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -381,7 +381,6 @@ class Relay * @param float $connect_timeout * @param float $command_timeout * @param array $context - * @return Relay */ #[\Relay\Attributes\Server] public function __construct( diff --git a/relay/Sentinel.php b/relay/Sentinel.php index 9889cb0bc..e2a14c4df 100644 --- a/relay/Sentinel.php +++ b/relay/Sentinel.php @@ -34,7 +34,6 @@ class Sentinel * @param int $retry_interval * @param float $read_timeout * @param mixed $auth - * @return void */ #[\Relay\Attributes\Server] public function __construct( From 3c1c355cd49a50b0671ceca2f3512dd4cce9d39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Thu, 26 Jan 2023 11:39:48 -0800 Subject: [PATCH 274/419] specify array return value --- relay/Relay.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index 1b07e6fa5..87a5664ab 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -581,7 +581,7 @@ public function readTimeout(): float|false {} * Returns the number of bytes sent and received over the network during the Relay object's * lifetime, or since the last time {@link Relay::clearBytes()} was called. * - * @return array A two element array consisting of [$sent_bytes, $received_bytes] + * @return array{int, int} */ #[\Relay\Attributes\Local] public function getBytes(): array {} @@ -589,7 +589,7 @@ public function getBytes(): array {} /** * @alias Relay\Relay::getBytes * - * @return array + * @return array{int, int} */ #[\Relay\Attributes\Local] public function bytes(): array {} From 906c6c76a2d3f4aa348138c7786b36bdfce173b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Thu, 26 Jan 2023 11:39:58 -0800 Subject: [PATCH 275/419] use @see over @alias --- relay/Relay.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index 87a5664ab..e19341e76 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -554,7 +554,9 @@ public function setOption(int $option, mixed $value): bool {} public function getTimeout(): float|false {} /** - * @alias Relay\Relay::getTimeout + * Returns the connection timeout. + * + * @see Relay\Relay::getTimeout() Alias. * * @return float|false */ @@ -570,7 +572,9 @@ public function timeout(): float|false {} public function getReadTimeout(): float|false {} /** - * @alias Relay\Relay::getReadTimeout + * Returns the read timeout. + * + * @see Relay::getReadTimeout() Alias. * * @return float|false */ @@ -587,7 +591,10 @@ public function readTimeout(): float|false {} public function getBytes(): array {} /** - * @alias Relay\Relay::getBytes + * Returns the number of bytes sent and received over the network during the Relay object's + * lifetime, or since the last time {@link Relay::clearBytes()} was called. + * + * @see Relay::getBytes() Alias. * * @return array{int, int} */ @@ -725,7 +732,7 @@ public function endpointId(): string|false {} /** * Returns the connection's endpoint identifier. * - * @alias Relay\Relay::endpointId + * @see Relay\Relay::endpointId() Alias. * * @return string|false */ From 59b9938bc12a6c91f79643b3d2822145e0b2d831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Thu, 26 Jan 2023 11:41:18 -0800 Subject: [PATCH 276/419] add `relay` to `StubDirectoryMap` --- tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php index fce27e505..38d2c6d9f 100644 --- a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php +++ b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php @@ -188,6 +188,7 @@ class PhpCoreStubsProvider 'phpdbg', 'rar', 'redis', + 'relay', 'rrd', 'SaxonC', 'snappy', From b10ae225b857cb1cab4bcda315383c87c3424a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Thu, 26 Jan 2023 11:42:31 -0800 Subject: [PATCH 277/419] generate stubs map --- PhpStormStubsMap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 1cac10e75..a29986456 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -839,6 +839,11 @@ final class PhpStormStubsMap 'ReflectionZendExtension' => 'Reflection/ReflectionZendExtension.php', 'Reflector' => 'Reflection/Reflector.php', 'RegexIterator' => 'SPL/SPL.php', + 'Relay\\Event' => 'relay/Event.php', + 'Relay\\Exception' => 'relay/Exception.php', + 'Relay\\KeyType' => 'relay/KeyType.php', + 'Relay\\Relay' => 'relay/Relay.php', + 'Relay\\Sentinel' => 'relay/Sentinel.php', 'ResourceBundle' => 'intl/intl.php', 'ReturnTypeWillChange' => 'Core/Core_c.php', 'RuntimeException' => 'SPL/SPL.php', From 7965c2201c3cc26d81cb0620ea7177e8dd0360e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Thu, 26 Jan 2023 13:30:20 -0800 Subject: [PATCH 278/419] remove space --- relay/Relay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/Relay.php b/relay/Relay.php index e19341e76..0a9349d59 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -593,7 +593,7 @@ public function getBytes(): array {} /** * Returns the number of bytes sent and received over the network during the Relay object's * lifetime, or since the last time {@link Relay::clearBytes()} was called. - * + * * @see Relay::getBytes() Alias. * * @return array{int, int} From 11699780dfef854d334e78f82e294cff66306487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Thu, 26 Jan 2023 13:41:50 -0800 Subject: [PATCH 279/419] fix version --- relay/Relay.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index 0a9349d59..b0d96cd8e 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -12,14 +12,14 @@ class Relay * * @var string */ - public const VERSION = "0.5.2"; + public const VERSION = "0.5.1"; /** * Relay's version. * * @var string */ - public const Version = "0.5.2"; + public const Version = "0.5.1"; /** * Integer representing no compression algorithm. From c1d72aec3a5fbdb3d4568076d03644c9439b78cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Mon, 30 Jan 2023 10:37:20 -0800 Subject: [PATCH 280/419] sync with v0.6.0 --- relay/Relay.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index b0d96cd8e..9cf3b23c3 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -12,14 +12,14 @@ class Relay * * @var string */ - public const VERSION = "0.5.1"; + public const VERSION = "0.6.0"; /** * Relay's version. * * @var string */ - public const Version = "0.5.1"; + public const Version = "0.6.0"; /** * Integer representing no compression algorithm. @@ -545,6 +545,24 @@ public function option(int $option, mixed $value = null): mixed {} #[\Relay\Attributes\Local] public function setOption(int $option, mixed $value): bool {} + /** + * Add a patterns to ignore. + * + * @param string $pattern,... + * @return int + */ + #[\Relay\Attributes\Local] + public function addIgnorePatterns(string ...$pattern): int {} + + /** + * Add a patterns to allow. + * + * @param string $pattern,... + * @return int + */ + #[\Relay\Attributes\Local] + public function addAllowPatterns(string ...$pattern): int {} + /** * Returns the connection timeout. * From 8c3360d1f2f21d7e315d8f5934816f0a52ffc1a4 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov <37301285+isfedorov@users.noreply.github.com> Date: Wed, 1 Feb 2023 22:11:29 +0100 Subject: [PATCH 281/419] Create LICENSE --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..ffbec714c --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2010-2023 JetBrains s.r.o. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From f738ac138b763e06f0a2658c9dc04977af629f14 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov <37301285+isfedorov@users.noreply.github.com> Date: Wed, 1 Feb 2023 22:24:18 +0100 Subject: [PATCH 282/419] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..8eca7ef80 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,34 @@ +### Code of Conduct + +This code of conduct outlines our expectations for all those who participate in our open source projects and communities (community programs), as well as the consequences for unacceptable behaviour. We invite all those who participate to help us create safe and positive experiences for everyone. Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society. + +#### How to behave +The following behaviours are expected and requested of all community members: + +* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community. +* Exercise consideration, respect and empathy in your speech and actions. Remember, we have all been through different stages of learning when adopting technologies. +* Refrain from demeaning, discriminatory, or harassing behaviour and speech. +* Disagreements on things are fine, argumentative behaviour or trolling are not. + +#### How not to behave + +* Do not perform threats of violence or use violent language directed against another person. +* Do not make jokes of sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory nature, or use language of this nature. +* Do not post or display sexually explicit or violent material. +* Do not post or threaten to post other people’s personally identifying information ("doxing"). +* Do not make personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. +* Do not engage in sexual attention. This includes, sexualised comments or jokes and sexual advances. +* Do not advocate for, or encourage, any of the above behaviour. + +Please take into account that online communities bring together people from many different cultures and backgrounds. It's important to understand that sometimes the combination of cultural differences and online interaction can lead to misunderstandings. That is why having empathy is very important. + +#### How to report issues + +If someone is acting inappropriately or violating this Code of Conduct in any shape or form, and they are not receptive to your feedback or you prefer not to confront them, please reach out to JetBrains via codeofconduct@jetbrains.com + +#### Consequences of Unacceptable Behaviour + +Unacceptable behaviour from any community member will not be tolerated. Anyone asked to stop unacceptable behaviour is expected to comply immediately. If a community member engages in unacceptable behaviour, JetBrains and/or community organisers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning. + +##### License and attribution +The license is based off of The Citizen Code of Conduct is distributed by Stumptown Syndicate under a Creative Commons Attribution-ShareAlike license. From 14e0a8cba1116694cc6f5084139adf9919906dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Fri, 3 Feb 2023 20:09:58 +0100 Subject: [PATCH 283/419] Update Redis.php --- redis/Redis.php | 1913 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 1535 insertions(+), 378 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index 2feee0ae0..588f54c5d 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -5,13 +5,14 @@ /** * Helper autocomplete for php redis extension * - * @author Max Kamashev - * @link https://github.com/ukko/phpredis-phpdoc + * @link https://github.com/phpredis/phpredis/blob/develop/redis.stub.php */ class Redis { public const AFTER = 'after'; public const BEFORE = 'before'; + public const LEFT = 'left'; + public const RIGHT = 'right'; /** * Options @@ -25,6 +26,7 @@ class Redis public const OPT_COMPRESSION = 7; public const OPT_REPLY_LITERAL = 8; public const OPT_COMPRESSION_LEVEL = 9; + public const OPT_NULL_MULTIBULK_AS_NULL = 10; public const OPT_MAX_RETRIES = 11; public const OPT_BACKOFF_ALGORITHM = 12; public const OPT_BACKOFF_BASE = 13; @@ -86,7 +88,7 @@ class Redis public const PIPELINE = 2; /** - * Type + * Types */ public const REDIS_NOT_FOUND = 0; public const REDIS_STRING = 1; @@ -120,13 +122,26 @@ class Redis * // Starting from version 6.0.0 it's possible to specify configuration options. * // This allows to connect to the server without explicitly invoking connect command. * $redis = new Redis([ + * // If you do wish to connect via the constructor, only 'host' is strictly required, + * // which will cause PhpRedis to connect to that host on Redis' default port (6379). * 'host' => '127.0.0.1', * 'port' => 6379, + * 'readTimeout' => 2.5, * 'connectTimeout' => 2.5, + * 'persistent' => true, + * // Valid formats: NULL, ['user', 'pass'], 'pass', or ['pass'] * 'auth' => ['phpredis', 'phpredis'], + * // See PHP stream options for valid SSL configuration settings. * 'ssl' => ['verify_peer' => false], + * // How quickly to retry a connection after we time out or it closes. + * // Note that this setting is overridden by 'backoff' strategies. + * 'retryInterval' => 100, + * // Which backoff algorithm to use. 'decorrelated jitter' is likely the + * // bestone for most solution, but there are many to choose from * 'backoff' => [ * 'algorithm' => Redis::BACKOFF_ALGORITHM_DECORRELATED_JITTER, + * // 'base', and 'cap' are in milliseconds and represent the first delay redis will + * // use when reconnecting, and the maximum delay we will reach while retrying. * 'base' => 500, * 'cap' => 750, * ], @@ -140,10 +155,10 @@ public function __construct($options = null) {} * @param string $host can be a host, or the path to a unix domain socket * @param int $port optional * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) - * @param string $persistent_id identity for the requested persistent connection + * @param string|null $persistent_id identity for the requested persistent connection * @param int $retry_interval retry interval in milliseconds. * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) - * @param array $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect + * @param array|null $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on error * @@ -216,6 +231,8 @@ public function getHost() {} /** * Get the port we're connected to * + * This number will be zero if we are connected to a unix socket. + * * @return int|false Returns the port we're connected to or FALSE if we're not connected * * @throws RedisException @@ -264,11 +281,9 @@ public function getReadTimeout() {} public function getPersistentID() {} /** - * Get the password used to authenticate the phpredis connection + * Get the authentication information on the connection, if any. * - * @return string|array|null Returns NULL if no username/password are set, - * the password string if a password is set, - * and a [username, password] array if authenticated with a username and password. + * @return mixed The authentication information used to authenticate the connection. * * @throws RedisException */ @@ -290,10 +305,10 @@ public function getAuth() {} * @param string $host can be a host, or the path to a unix domain socket * @param int $port optional * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) - * @param string $persistent_id identity for the requested persistent connection + * @param string|null $persistent_id identity for the requested persistent connection * @param int $retry_interval retry interval in milliseconds. * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) - * @param array $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect + * @param array|null $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on ertcnror. * @@ -330,10 +345,10 @@ public function pconnect( * @param string $host * @param int $port * @param float $timeout - * @param string $persistent_id + * @param string|null $persistent_id * @param int $retry_interval * @param float $read_timeout - * @param array $context + * @param array|null $context * * @return bool * @@ -386,10 +401,10 @@ public function close() {} public function swapdb(int $db1, int $db2) {} /** - * Set client option + * Set a configurable option on the Redis object. * - * @param int $option option name - * @param mixed $value option value + * @param int $option The option constant. + * @param mixed $value The option value. * * @return bool TRUE on success, FALSE on error * @@ -417,11 +432,11 @@ public function swapdb(int $db1, int $db2) {} public function setOption($option, $value) {} /** - * Get client option + * Retrieve the value of a configuration setting as set by Redis::setOption() * * @param int $option parameter name * - * @return mixed|null Parameter value + * @return mixed|null The setting itself or false on failure. * * @throws RedisException * @@ -435,7 +450,7 @@ public function getOption($option) {} /** * Check the current connection status * - * @param string $message [optional] + * @param string $message An optional string message that Redis will reply with, if passed. * * @return bool|string TRUE if the command is successful or returns message * Throws a RedisException object on connectivity error, as described above. @@ -456,11 +471,13 @@ public function ping($message = null) {} * * @param string $message * - * @return string|Redis Returns message or Redis if in multimode + * @return string|Redis The string sent to Redis or false on failure or Redis if in multimode * * @throws RedisException * * @link https://redis.io/commands/echo + * + * @example $redis->echo('Hello, World'); */ public function echo($message) {} @@ -500,14 +517,22 @@ public function get($key) {} * * @since If you're using Redis >= 2.6.12, you can pass extended options as explained in example * - * @param string $key - * @param string|mixed $value string if not used serializer - * @param int|array|mixed $timeout [optional] Calling setex() is preferred if you want a timeout.
    - * Since 2.6.12 it also supports different flags inside an array. Example ['NX', 'EX' => 60]
    - * - EX seconds -- Set the specified expire time, in seconds.
    - * - PX milliseconds -- Set the specified expire time, in milliseconds.
    - * - NX -- Only set the key if it does not already exist.
    - * - XX -- Only set the key if it already exist.
    + * @param string $key The key name to set. + * @param mixed $value The value to set the key to. + * @param mixed $options Either an array with options for how to perform the set or an integer with an expiration. + * If an expiration is set PhpRedis will actually send the `SETEX` command. + * Since 2.6.12 it also supports different flags inside an array. + * OPTION DESCRIPTION + * ------------ -------------------------------------------------------------- + * ['EX' => 60] expire 60 seconds. + * ['PX' => 6000] expire in 6000 milliseconds. + * ['EXAT' => time() + 10] expire in 10 seconds. + * ['PXAT' => time()*1000 + 1000] expire in 1 second. + * ['KEEPTTL' => true] Redis will not update the key's current TTL. + * ['XX'] Only set the key if it already exists. + * ['NX'] Only set the key if it doesn't exist. + * ['GET'] Instead of returning `+OK` return the previous value of the + * key or NULL if the key didn't exist. * * @example *

    @@ -530,14 +555,14 @@ public function get($key) {}
          *
          * @link     https://redis.io/commands/set
          */
    -    public function set($key, string $value, mixed $timeout = null) {}
    +    public function set($key, $value, $options = null) {}
     
         /**
          * Set the string value in argument as value of the key, with a time to live.
          *
    -     * @param string       $key
    -     * @param int          $expire
    -     * @param string|mixed $value
    +     * @param string $key    The name of the key to set.
    +     * @param int    $expire The key's expiration in seconds.
    +     * @param mixed  $value  The value to set the key.
          *
          * @return bool|Redis returns Redis if in multimode
          *
    @@ -546,15 +571,15 @@ public function set($key, string $value, mixed $timeout = null) {}
          * @link    https://redis.io/commands/setex
          * @example $redis->setex('key', 3600, 'value'); // sets key → value, with 1h TTL.
          */
    -    public function setex($key, $expire, string $value) {}
    +    public function setex($key, $expire, $value) {}
     
         /**
          * Set the value and expiration in milliseconds of a key.
          *
          * @see     setex()
    -     * @param   string       $key
    -     * @param   int          $expire in milliseconds.
    -     * @param   string|mixed $value
    +     * @param string $key    The key to set
    +     * @param int    $expire The TTL to set, in milliseconds.
    +     * @param mixed  $value  The value to set the key to.
          *
          * @return bool|Redis returns Redis if in multimode
          *
    @@ -563,7 +588,7 @@ public function setex($key, $expire, string $value) {}
          * @link    https://redis.io/commands/psetex
          * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL.
          */
    -    public function psetex($key, $expire, string $value) {}
    +    public function psetex($key, $expire, $value) {}
     
         /**
          * Set the string value in argument as value of the key if the key doesn't already exist in the database.
    @@ -582,13 +607,13 @@ public function psetex($key, $expire, string $value) {}
          * $redis->setnx('key', 'value');   // return FALSE
          * 
    */ - public function setnx(string $key, string $value) {} + public function setnx(string $key, $value) {} /** * Remove specified keys. * - * @param int|string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN - * @param int|string ...$otherKeys + * @param string|array $key1 Either an array with one or more key names or a string with the name of a key. + * @param string ...$otherKeys One or more additional keys passed in a variadic fashion. * * @return false|int|Redis Number of keys deleted or Redis if in multimode * @@ -710,24 +735,41 @@ public function multi($mode = Redis::MULTI) {} public function pipeline() {} /** - * @return void|array|Redis returns Redis if in multimode + * Execute either a MULTI or PIPELINE block and return the array of replies. + * + * @return array|false|Redis The array of pipeline'd or multi replies or false on failure or Redis if in multimode * * @throws RedisException * * @see multi() * @link https://redis.io/commands/exec + * @link https://redis.io/commands/multi + * + * @example + * $res = $redis->multi() + * ->set('foo', 'bar') + * ->get('foo') + * ->del('list') + * ->rpush('list', 'one', 'two', 'three') + * ->exec(); */ public function exec() {} /** * Flushes all previously queued commands in a transaction and restores the connection state to normal. * - * @return bool + * @return bool|Redis True if we could discard the transaction or Redis if in multimode * * @throws RedisException * * @see multi() * @link https://redis.io/commands/discard + * + * @example + * $redis->getMode(); + * $redis->set('foo', 'bar'); + * $redis->discard(); + * $redis->getMode(); */ public function discard() {} @@ -735,8 +777,9 @@ public function discard() {} * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, * the MULTI/EXEC transaction will fail (return FALSE). unwatch cancels all the watching of all keys by this client. * - * @param string|array $key An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN - * @param string ...$other_keys + * @param string|array $key Either an array with one or more key names, or a string key name + * @param string ...$other_keys If the first argument was passed as a string, any number of + * additional string key names may be passed variadically. * * @return bool|Redis returns Redis if in multimode * @@ -756,6 +799,8 @@ public function discard() {} public function watch($key, ...$other_keys) {} /** + * Remove any previously WATCH'ed keys in a transaction. + * * @throws RedisException * * @see watch() @@ -769,17 +814,31 @@ public function unwatch() {} * * Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, SSUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, SUNSUBSCRIBE, PUNSUBSCRIBE, PING, RESET and QUIT commands. * - * @param string $channel - * @param string ...$other_channels + * @param array|string $channels One or more channel names. + * @param callable $callback The callback PhpRedis will invoke when we receive a message from one of the subscribed channels. * - * @return false|array|Redis + * @return false|array|Redis False on faiilure. Note that this command will block the client in a subscribe loop, waiting for messages to arrive * * @throws RedisException * * @link https://redis.io/commands/subscribe * @since 2.0 + * + * @example + * $redis->subscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) { + * echo "[$channel]: $message\n"; + * + * // Unsubscribe from the message channel when we read 'quit' + * if ($message == 'quit') { + * echo "Unsubscribing from '$channel'\n"; + * $redis->unsubscribe([$channel]); + * } + * }); + * + * // Once we read 'quit' from both channel-1 and channel-2 the subscribe loop will be broken and this command will execute. + * echo "Subscribe loop ended\n"; */ - public function subscribe(string $channel, string ...$other_channels) {} + public function subscribe($channels, $callback) {} /** * Subscribe to channels by pattern @@ -810,8 +869,8 @@ public function psubscribe($patterns, $callback) {} * * Warning: this function will probably change in the future. * - * @param string $channel a channel to publish to - * @param string $message string + * @param string $channel The channel to publish to. + * @param string $message The message itself. * * @return false|int|Redis Number of clients that received the message or Redis if in multimode * @@ -826,11 +885,11 @@ public function publish($channel, $message) {} * A command allowing you to get information on the Redis pub/sub system * * @param string $keyword String, which can be: "channels", "numsub", or "numpat" - * @param string|array $argument Optional, variant. + * @param mixed $argument Optional, variant. * For the "channels" subcommand, you can pass a string pattern. * For "numsub" an array of channel names * - * @return array|int|Redis Either an integer or an array or Redis if in multimode + * @return mixed|Redis Either an integer or an array or Redis if in multimode * - channels Returns an array where the members are the matching channels. * - numsub Returns a key/value array where the keys are channel names and * values are their counts. @@ -852,16 +911,25 @@ public function pubsub($keyword, $argument = null) {} /** * Stop listening for messages posted to the given channels. * - * @param string $channel - * @param string ...$other_channels + * @param array $channels One or more channels to unsubscribe from. * - * @return bool|array + * @return bool|array|Redis The array of unsubscribed channels. * * @throws RedisException * * @link https://redis.io/commands/unsubscribe + * + * @example + * $redis->subscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) { + * if ($message == 'quit') { + * echo "$channel => 'quit' detected, unsubscribing!\n"; + * $redis->unsubscribe([$channel]); + * } else { + * echo "$channel => $message\n"; + * } + * }); */ - public function unsubscribe(string $channel, string ...$other_channels) {} + public function unsubscribe(array $channels) {} /** * Stop listening for messages posted to the given channels. @@ -883,7 +951,8 @@ public function punsubscribe(array $patterns) {} * * @since >= 4.0 Returned int, if < 4.0 returned bool * - * @param string|string[] $key + * @param mixed $key Either an array of keys or a string key + * @param mixed ...$other_keys If the previous argument was a string, you may send any number of additional keys to test. * * @return int|bool|Redis The number of keys tested that do exist or Redis if in multimode * @@ -901,12 +970,13 @@ public function punsubscribe(array $patterns) {} * $redis->exists('foo', 'bar', 'baz'); // 3 * */ - public function exists($key) {} + public function exists($key, ...$other_keys) {} /** * Increment the number stored at key by one. * - * @param string $key + * @param string $key The key to increment + * @param int $by An optional amount to increment by. * * @return false|int|Redis the new value or Redis if in multimode * @@ -919,9 +989,10 @@ public function exists($key) {} * $redis->incr('key1'); // 2 * $redis->incr('key1'); // 3 * $redis->incr('key1'); // 4 + * $redis->incr('key1', 2); // 6 * */ - public function incr($key) {} + public function incr($key, $by = 1) {} /** * Increment the float value of a key by the given amount @@ -929,7 +1000,7 @@ public function incr($key) {} * @param string $key * @param float $increment * - * @return float|Redis returns Redis if in multimode + * @return float|false|Redis returns Redis if in multimode * * @throws RedisException * @@ -939,16 +1010,16 @@ public function incr($key) {} * $redis->set('x', 3); * $redis->incrByFloat('x', 1.5); // float(4.5) * $redis->get('x'); // float(4.5) + * $redis->incrByFloat('x', 3.1415926); * */ public function incrByFloat($key, $increment) {} /** * Increment the number stored at key by one. - * If the second argument is filled, it will be used as the integer value of the increment. * - * @param string $key key - * @param int $value value that will be added to key (only for incrBy) + * @param string $key The key to increment. + * @param int $value The amount to increment. * * @return false|int|Redis the new value or Redis if in multimode * @@ -969,9 +1040,10 @@ public function incrBy($key, $value) {} /** * Decrement the number stored at key by one. * - * @param string $key + * @param string $key The key to decrement + * @param int $by How much to decrement the key. Note that if this value is not sent or is set to `1` * - * @return false|int|Redis the new value or Redis if in multimode + * @return false|int|Redis The new value of the key or false on failure or Redis if in multimode * * @throws RedisException * @@ -981,18 +1053,18 @@ public function incrBy($key, $value) {} * $redis->decr('key1'); // key1 didn't exists, set to 0 before the increment and now has the value -1 * $redis->decr('key1'); // -2 * $redis->decr('key1'); // -3 + * $redis->decr('key1', 2); // -5 * */ - public function decr($key) {} + public function decr($key, $by = 1) {} /** * Decrement the number stored at key by one. - * If the second argument is filled, it will be used as the integer value of the decrement. * - * @param string $key - * @param int $value that will be subtracted to key (only for decrBy) + * @param string $key The integer key to decrement. + * @param int $value How much to decrement the key. * - * @return false|int|Redis the new value or Redis if in multimode + * @return false|int|Redis The new value of the key or false on failure or Redis if in multimode * * @throws RedisException * @@ -1012,8 +1084,8 @@ public function decrBy($key, $value) {} * Creates the list if the key didn't exist. * If the key exists and is not a list, FALSE is returned. * - * @param string $key - * @param string|mixed ...$value1 Variadic list of values to push in key, if dont used serialized, used string + * @param string $key The list to prepend. + * @param mixed ...$value1 One or more elements to prepend. * * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * @@ -1040,8 +1112,8 @@ public function lPush($key, ...$value1) {} * Creates the list if the key didn't exist. * If the key exists and is not a list, FALSE is returned. * - * @param string $key - * @param string|mixed ...$value1 Variadic list of values to push in key, if dont used serialized, used string + * @param string $key The list to append to. + * @param mixed ...$value1 one or more elements to append. * * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * @@ -1066,8 +1138,8 @@ public function rPush($key, ...$value1) {} /** * Adds the string value to the head (left) of the list if the list exists. * - * @param string $key - * @param string|mixed $value String, value to push in key + * @param string $key The key to prepend to. + * @param mixed $value The value to prepend. * * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * @@ -1084,13 +1156,13 @@ public function rPush($key, ...$value1) {} * // key1 now points to the following list: [ 'A', 'B', 'C' ] * */ - public function lPushx($key, string $value) {} + public function lPushx($key, $value) {} /** * Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure. * - * @param string $key - * @param string|mixed $value String, value to push in key + * @param string $key The key to prepend to. + * @param mixed $value The value to prepend. * * @return int|false|Redis The new length of the list in case of success, FALSE in case of Failure or Redis if in multimode * @@ -1107,13 +1179,13 @@ public function lPushx($key, string $value) {} * // key1 now points to the following list: [ 'A', 'B', 'C' ] * */ - public function rPushx($key, string $value) {} + public function rPushx($key, $value) {} /** * Returns and removes the first element of the list. * - * @param string $key - * @param int $count + * @param string $key The list to pop from. + * @param int $count Optional number of elements to remove. By default one element is popped. * * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multimode * @@ -1133,10 +1205,10 @@ public function lPop($key, $count = 0) {} /** * Returns and removes the last element of the list. * - * @param string $key - * @param int $count + * @param string $key A redis LIST key name. + * @param int $count The maximum number of elements to pop at once. NOTE: The `count` argument requires Redis >= 6.2.0 * - * @return mixed|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multimode + * @return mixed|array|string|bool|Redis if command executed successfully BOOL FALSE in case of failure (empty list) or Redis if in multimode * * @throws RedisException * @@ -1157,11 +1229,11 @@ public function rPop($key, $count = 0) {} * Il all the list identified by the keys passed in arguments are empty, blPop will block * during the specified timeout until an element is pushed to one of those lists. This element will be popped. * - * @param string|string[] $key String array containing the keys of the lists OR variadic list of strings - * @param int $timeout_or_key Timeout is always the required final parameter + * @param string|string[] $key_or_keys String array containing the keys of the lists OR variadic list of strings + * @param string|float|int $timeout_or_key Timeout is always the required final parameter * @param mixed ...$extra_args * - * @return array|Redis ['listName', 'element'] or Redis if in multimode + * @return array|null|false|Redis Can return various things depending on command and data or Redis if in multimode * * @throws RedisException * @@ -1176,9 +1248,9 @@ public function rPop($key, $count = 0) {} * // OR * $redis->blPop(['key1', 'key2'], 10); // array('key1', 'A') * - * $redis->brPop('key1', 'key2', 10); // array('key1', 'A') + * $redis->blPop('key1', 'key2', 10); // array('key1', 'A') * // OR - * $redis->brPop(['key1', 'key2'], 10); // array('key1', 'A') + * $redis->blPop(['key1', 'key2'], 10); // array('key1', 'A') * * // Blocking feature * @@ -1194,7 +1266,7 @@ public function rPop($key, $count = 0) {} * // array('key1', 'A') is returned * */ - public function blPop($key, $timeout_or_key, ...$extra_args) {} + public function blPop($key_or_keys, $timeout_or_key, ...$extra_args) {} /** * Is a blocking rPop primitive. If at least one of the lists contains at least one element, @@ -1203,11 +1275,11 @@ public function blPop($key, $timeout_or_key, ...$extra_args) {} * block during the specified timeout until an element is pushed to one of those lists. * This element will be popped. * - * @param string|string[] $key String array containing the keys of the lists OR variadic list of strings - * @param int $timeout_or_key Timeout is always the required final parameter + * @param string|string[] $key_or_keys String array containing the keys of the lists OR variadic list of strings + * @param string|float|int $timeout_or_key Timeout is always the required final parameter * @param mixed ...$extra_args * - * @return array|Redis ['listName', 'element'] or Redis if in multimode + * @return array|null|true|Redis Can return various things depending on command and data or Redis if in multimode * * @throws RedisException * @@ -1215,12 +1287,12 @@ public function blPop($key, $timeout_or_key, ...$extra_args) {} * @example *
          * // Non blocking feature
    -     * $redis->lPush('key1', 'A');
    +     * $redis->rPush('key1', 'A');
          * $redis->del('key2');
          *
    -     * $redis->blPop('key1', 'key2', 10); // array('key1', 'A')
    +     * $redis->brPop('key1', 'key2', 10); // array('key1', 'A')
          * // OR
    -     * $redis->blPop(array('key1', 'key2'), 10); // array('key1', 'A')
    +     * $redis->brPop(array('key1', 'key2'), 10); // array('key1', 'A')
          *
          * $redis->brPop('key1', 'key2', 10); // array('key1', 'A')
          * // OR
    @@ -1230,7 +1302,7 @@ public function blPop($key, $timeout_or_key, ...$extra_args) {}
          *
          * // process 1
          * $redis->del('key1');
    -     * $redis->blPop('key1', 10);
    +     * $redis->brPop('key1', 10);
          * // blocking for 10 seconds
          *
          * // process 2
    @@ -1240,7 +1312,7 @@ public function blPop($key, $timeout_or_key, ...$extra_args) {}
          * // array('key1', 'A') is returned
          * 
    */ - public function brPop($key, $timeout_or_key, ...$extra_args) {} + public function brPop($key_or_keys, $timeout_or_key, ...$extra_args) {} /** * Returns the size of a list identified by Key. If the list didn't exist or is empty, @@ -1320,9 +1392,9 @@ public function lGet($key, $index) {} /** * Set the list at index with the new value. * - * @param string $key - * @param int $index - * @param string $value + * @param string $key The list to modify. + * @param int $index The position of the element to change. + * @param mixed $value The new value. * * @return bool|Redis TRUE if the new value is setted or Redis if in multimode * FALSE if the index is out of range, or data type identified by key is not a list. @@ -1340,16 +1412,16 @@ public function lGet($key, $index) {} * $redis->lIndex('key1', 0); // 'X' * */ - public function lSet($key, $index, string $value) {} + public function lSet($key, $index, $value) {} /** * Returns the specified elements of the list stored at the specified key in * the range [start, end]. start and stop are interpretated as indices: 0 the first element, * 1 the second ... -1 the last element, -2 the penultimate ... * - * @param string $key - * @param int $start - * @param int $end + * @param string $key The list to query. + * @param int $start The beginning index to retrieve. This number can be negative meaning start from the end of the list. + * @param int $end The end index to retrieve. This can also be negative to start from the end of the list. * * @return array|Redis containing the values in specified range or Redis if in multimode * @@ -1382,9 +1454,9 @@ public function lGetRange($key, $start, $end) {} /** * Trims an existing list so that it will contain only a specified range of elements. * - * @param string $key - * @param int $start - * @param int $stop + * @param string $key The list to trim + * @param int $start The starting index to keep + * @param int $end The ending index to keep. * * @return array|false|Redis Bool return FALSE if the key identify a non-list value or Redis if in multimode * @@ -1401,7 +1473,7 @@ public function lGetRange($key, $start, $end) {} * $redis->lRange('key1', 0, -1); // array('A', 'B') * */ - public function lTrim($key, $start, $stop) {} + public function lTrim($key, $start, $end) {} /** * @link https://redis.io/commands/ltrim @@ -1420,9 +1492,9 @@ public function listTrim($key, $start, $stop) {} * If count is zero, all the matching elements are removed. If count is negative, * elements are removed from tail to head. * - * @param string $key - * @param string $value - * @param int $count + * @param string $key The list to truncate. + * @param mixed $value The value to remove. + * @param int $count How many elements matching the value to remove. * * @return int|bool|Redis the number of elements to remove or Redis if in multimode * bool FALSE if the value identified by key is not a list. @@ -1443,7 +1515,7 @@ public function listTrim($key, $start, $stop) {} * $redis->lRange('key1', 0, -1); // array('C', 'B', 'A') * */ - public function lRem($key, $value, $count) {} + public function lRem($key, $value, $count = 0) {} /** * @link https://redis.io/commands/lremove @@ -1465,7 +1537,7 @@ public function lRemove($key, $value, $count) {} * @param string $key * @param string $position Redis::BEFORE | Redis::AFTER * @param mixed $pivot - * @param string|mixed $value + * @param mixed $value * * @return false|int|Redis The number of the elements in the list, -1 if the pivot didn't exists or Redis if in multimode * @@ -1496,7 +1568,7 @@ public function lInsert($key, $position, $pivot, $value) {} * Adds a values to the set value stored at key. * * @param string $key Required key - * @param string $value + * @param mixed $value * @param mixed ...$other_values Variadic list of values * * @return int|bool|Redis The number of elements added to the set or Redis if in multimode @@ -1509,14 +1581,14 @@ public function lInsert($key, $position, $pivot, $value) {} * $redis->sAdd('k', 'v1', 'v2', 'v3'); // int(2) * */ - public function sAdd(string $key, string $value, mixed ...$other_values) {} + public function sAdd(string $key, $value, ...$other_values) {} /** * Removes the specified members from the set value stored at key. * * @param string $key - * @param string $value - * @param string|mixed ...$other_values Variadic list of members + * @param mixed $value + * @param mixed ...$other_values Variadic list of members * * @return false|int|Redis The number of elements removed from the set or Redis if in multimode * @@ -1532,7 +1604,7 @@ public function sAdd(string $key, string $value, mixed ...$other_values) {} * // } * */ - public function sRem(string $key, string $value, ...$other_values) {} + public function sRem(string $key, $value, ...$other_values) {} /** * @link https://redis.io/commands/srem @@ -1550,7 +1622,7 @@ public function sRemove($key, ...$member1) {} * * @param string $srcKey * @param string $dstKey - * @param string $member + * @param mixed $member * * @return bool|Redis If the operation is successful, return TRUE or Redis if in multimode * If the srcKey and/or dstKey didn't exist, and/or the member didn't exist in srcKey, FALSE is returned. @@ -1569,13 +1641,13 @@ public function sRemove($key, ...$member1) {} * // 'key2' => {'set21', 'set22', 'set13'} * */ - public function sMove($srcKey, $dstKey, string $member) {} + public function sMove($srcKey, $dstKey, $member) {} /** * Checks if value is a member of the set stored at the key key. * * @param string $key - * @param string|mixed $value + * @param mixed $value * * @return bool|Redis TRUE if value is a member of the set at key key, FALSE otherwise or Redis if in multimode * @@ -1592,7 +1664,7 @@ public function sMove($srcKey, $dstKey, string $member) {} * $redis->sIsMember('key1', 'setX'); // FALSE * */ - public function sIsMember(string $key, string $value) {} + public function sIsMember(string $key, $value) {} /** * @link https://redis.io/commands/sismember @@ -1629,8 +1701,8 @@ public function sCard($key) {} /** * Removes and returns a random element from the set value at Key. * - * @param string $key - * @param int $count [optional] + * @param string $key The set in question. + * @param int $count An optional number of members to pop. This defaults to removing one element. * * @return string|mixed|array|bool|Redis "popped" values or Redis if in multimode * bool FALSE if set identified by key is empty or doesn't exist. @@ -1662,8 +1734,15 @@ public function sPop($key, $count = 0) {} /** * Returns a random element(s) from the set value at Key, without removing it. * - * @param string $key - * @param int $count [optional] + * @param string $key The set to query. + * @param int $count An optional count of members to return. + * + * If this value is positive, Redis will return *up to* the requested + * number but with unique elements that will never repeat. This means + * you may recieve fewer then `$count` replies. + * + * If the number is negative, Redis will return the exact number requested + * but the result may contain duplicate elements. * * @return string|mixed|array|bool|Redis value(s) from the set or Redis if in multimode * bool FALSE if set identified by key is empty or doesn't exist and count argument isn't passed. @@ -1733,9 +1812,9 @@ public function sInter($key1, ...$otherKeys) {} /** * Performs a sInter command and stores the result in a new set. * - * @param string $dstKey the key to store the diff into. - * @param string $key1 keys identifying the different sets on which we will apply the intersection. - * @param string ...$otherKeys variadic list of keys + * @param array|string $key Either a string key, or an array of keys (with at least two elements, + * consisting of the destination key name and one or more source keys names. + * @param string ...$otherKeys If the first argument was a string, subsequent arguments should be source key names. * * @return int|false|Redis The cardinality of the resulting set, or FALSE in case of a missing key or Redis if in multimode * @@ -1768,7 +1847,7 @@ public function sInter($key1, ...$otherKeys) {} * //} * */ - public function sInterStore($dstKey, $key1, ...$otherKeys) {} + public function sInterStore(string $key, ...$otherKeys) {} /** * Performs the union between N sets and returns it. @@ -1776,7 +1855,7 @@ public function sInterStore($dstKey, $key1, ...$otherKeys) {} * @param string $key1 first key for union * @param string ...$otherKeys variadic list of keys corresponding to sets in redis * - * @return array|Redis string[] The union of all these sets or Redis if in multimode + * @return array|false|Redis The union of all these sets or Redis if in multimode * * @throws RedisException * @@ -1809,9 +1888,9 @@ public function sUnion($key1, ...$otherKeys) {} /** * Performs the same action as sUnion, but stores the result in the first key * - * @param string $dstKey the key to store the diff into. - * @param string $key1 first key for union - * @param string ...$otherKeys variadic list of keys corresponding to sets in redis + * @param string $dstKey The destination key + * @param string $key1 The first source key + * @param string ...$otherKeys One or more additional source keys * * @return false|int|Redis Any number of keys corresponding to sets in redis or Redis if in multimode * @@ -1853,7 +1932,7 @@ public function sUnionStore($dstKey, $key1, ...$otherKeys) {} * @param string $key1 first key for diff * @param string ...$otherKeys variadic list of keys corresponding to sets in redis * - * @return array|Redis string[] The difference of the first set will all the others or Redis if in multimode + * @return array|false|Redis string[] The difference of the first set will all the others or Redis if in multimode * * @throws RedisException * @@ -1925,7 +2004,7 @@ public function sDiffStore($dstKey, $key1, ...$otherKeys) {} * * @param string $key * - * @return array|Redis An array of elements, the contents of the set or Redis if in multimode + * @return array|false|Redis An array of elements, the contents of the set or Redis if in multimode * * @throws RedisException * @@ -1952,6 +2031,22 @@ public function sDiffStore($dstKey, $key1, ...$otherKeys) {} */ public function sMembers($key) {} + /** + * Check if one or more values are members of a set. + * + * @link https://redis.io/commands/smismember + * @see smember() + * + * @param string $key The set to query. + * @param string $member The first value to test if exists in the set. + * @param string ...$other_members Any number of additional values to check. + * + * @return Redis|array|false An array of integers representing whether each passed value was a member of the set. + * + * @example + * $redis->sAdd('ds9-crew', ...["Sisko", "Kira", "Dax", "Worf", "Bashir", "O'Brien"]); + * $members = $redis->sMIsMember('ds9-crew', ...['Sisko', 'Picard', 'Data', 'Worf']); + */ public function sMisMember(string $key, string $member, string ...$other_members): array|false {} /** @@ -1968,10 +2063,15 @@ public function sGetMembers($key) {} /** * Scan a set for members * - * @param string $key The set to search. - * @param int &$iterator LONG (reference) to the iterator as we go. - * @param string $pattern String, optional pattern to match against. - * @param int $count How many members to return at a time (Redis might return a different amount) + * @param string $key The Redis SET key in question. + * @param int|null &$iterator A reference to an iterator which should be initialized to NULL that + * PhpRedis will update with the value returned from Redis after each + * subsequent call to SSCAN. Once this cursor is zero you know all + * members have been traversed. + * @param string $pattern An optional glob style pattern to match against, so Redis only + * returns the subset of members matching this pattern. + * @param int $count A hint to Redis as to how many members it should scan in one command + * before returning members for that iteration. * * @return array|false|Redis PHPRedis will return an array of keys or FALSE when we're done iterating or Redis if in multimode * @@ -1980,10 +2080,40 @@ public function sGetMembers($key) {} * @link https://redis.io/commands/sscan * @example *
    -     * $iterator = null;
    -     * while ($members = $redis->sScan('set', $iterator)) {
    +     * $redis->del('myset');
    +     * for ($i = 0; $i < 10000; $i++) {
    +     *     $redis->sAdd('myset', "member:$i");
    +     * }
    +     * $redis->sadd('myset', 'foofoo');
    +     *
    +     * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_NORETRY);
    +     *
    +     * $scanned = 0;
    +     * $it = null;
    +     *
    +     * // Without Redis::SCAN_RETRY we may receive empty results and
    +     * // a nonzero iterator.
    +     * do {
    +     *     // Scan members containing '5'
    +     *     $members = $redis->sscan('myset', $it, '*5*');
    +     *     foreach ($members as $member) {
    +     *          echo "NORETRY: $member\n";
    +     *          $scanned++;
    +     *     }
    +     * } while ($it != 0);
    +     * echo "TOTAL: $scanned\n";
    +     *
    +     * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
    +     *
    +     * $scanned = 0;
    +     * $it = null;
    +     *
    +     * // With Redis::SCAN_RETRY PhpRedis will never return an empty array
    +     * // when the cursor is non-zero
    +     * while (($members = $redis->sScan('set', $it, '*5*'))) {
          *     foreach ($members as $member) {
    -     *         echo $member . PHP_EOL;
    +     *         echo "RETRY: $member\n";
    +     *         $scanned++;
          *     }
          * }
          * 
    @@ -1994,9 +2124,9 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) {} * Sets a value and returns the previous entry at that key. * * @param string $key - * @param string|mixed $value + * @param mixed $value * - * @return string|mixed|Redis A string (mixed, if used serializer), the previous value located at this key or Redis if in multimode + * @return string|mixed||false|Redis A string (mixed, if used serializer), the previous value located at this key or false if it didn't exist or Redis if in multimode * * @throws RedisException * @@ -2008,12 +2138,12 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) {} * $newValue = $redis->get('x')' // return 'lol' * */ - public function getSet($key, string $value) {} + public function getSet($key, $value) {} /** * Returns a random key * - * @return string|Redis an existing key in redis or Redis if in multimode + * @return string|false|Redis an existing key in redis or Redis if in multimode * * @throws RedisException * @@ -2126,10 +2256,17 @@ public function renameKey($srcKey, $dstKey) {} public function renameNx($srcKey, $dstKey) {} /** - * Sets an expiration date (a timeout) on an item + * Sets an expiration in seconds on the key in question. If connected to + * redis-server >= 7.0.0 you may send an additional "mode" argument which + * modifies how the command will execute. * - * @param string $key The key that will disappear + * @param string $key The key to set an expiration on. * @param int $ttl The key's remaining Time To Live, in seconds + * @param string|null $mode A two character modifier that changes how the command works. + * NX - Set expiry only if key has no expiry + * XX - Set expiry only if key has an expiry + * LT - Set expiry only when new expiry is < current expiry + * GT - Set expiry only when new expiry is > current expiry * * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * @@ -2144,13 +2281,16 @@ public function renameNx($srcKey, $dstKey) {} * $redis->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expire($key, $ttl) {} + public function expire($key, $ttl, $mode = null) {} /** * Sets an expiration date (a timeout in milliseconds) on an item * - * @param string $key The key that will disappear. - * @param int $ttl The key's remaining Time To Live, in milliseconds + * If connected to Redis >= 7.0.0 you can pass an optional mode argument that modifies how the command will execute. + * + * @param string $key The key to set an expiration on. + * @param int $ttl The key's remaining Time To Live, in milliseconds + * @param string|null $mode A two character modifier that changes how the command works. * * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * @@ -2165,7 +2305,7 @@ public function expire($key, $ttl) {} * $redis->pttl('x'); // 11500 * */ - public function pExpire($key, $ttl) {} + public function pExpire($key, $ttl, $mode = null) {} /** * @link https://redis.io/commands/expire @@ -2182,8 +2322,12 @@ public function setTimeout($key, $ttl) {} /** * Sets an expiration date (a timestamp) on an item. * - * @param string $key The key that will disappear. - * @param int $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time. + * If connected to Redis >= 7.0.0 you can pass an optional 'mode' argument. + * @see expire() For a description of the mode argument. + * + * @param string $key The key to set an expiration on. + * @param int $timestamp The unix timestamp to expire at. + * @param string|null $mode An option 'mode' that modifies how the command acts * * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * @@ -2199,13 +2343,16 @@ public function setTimeout($key, $ttl) {} * $redis->get('x'); // will return `FALSE`, as 'x' has expired. * */ - public function expireAt($key, $timestamp) {} + public function expireAt($key, $timestamp, $mode = null) {} /** * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds * - * @param string $key The key that will disappear + * If connected to Redis >= 7.0.0 you can pass an optional 'mode' argument. + * + * @param string $key The key to set an expiration on. * @param int $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time + * @param string|null $mode A two character modifier that changes how the command works. * * @return bool|Redis TRUE in case of success, FALSE in case of failure or Redis if in multimode * @@ -2220,14 +2367,14 @@ public function expireAt($key, $timestamp) {} * echo $redis->pttl('x'); // 218270120575 * */ - public function pExpireAt($key, $timestamp) {} + public function pExpireAt($key, $timestamp, $mode = null) {} /** * Returns the keys that match a certain pattern. * * @param string $pattern pattern, using '*' as a wildcard * - * @return array|Redis string[] The keys that match a certain pattern or Redis if in multimode + * @return array|false|Redis The keys that match a certain pattern or Redis if in multimode * * @throws RedisException * @@ -2266,17 +2413,21 @@ public function getKeys($pattern) {} public function dbSize() {} /** - * Authenticate the connection using a password. + * Authenticate a Redis connection after its been established. * Warning: The password is sent in plain-text over the network. * - * @param mixed $credentials + * @param mixed $credentials A string password, or an array with one or two string elements. * * @return bool|Redis TRUE if the connection is authenticated, FALSE otherwise or Redis if in multimode * * @throws RedisException * * @link https://redis.io/commands/auth - * @example $redis->auth('foobared'); + * + * @example + * $redis->auth('password'); + * $redis->auth(['password']); + * $redis->auth(['username', 'password']); */ public function auth($credentials) {} @@ -2296,6 +2447,9 @@ public function bgrewriteaof() {} * Changes the slave status * Either host and port, or no parameter to stop being a slave. * + * This method and the corresponding command in Redis has been marked deprecated + * and users should instead use replicaof() if connecting to redis-server >= 5.0.0. + * * @param string $host [optional] * @param int $port [optional] * @@ -2311,13 +2465,22 @@ public function bgrewriteaof() {} * $redis->slaveof(); * */ + #[Deprecated(replacement: '%class%->replicaof(%parametersList%)')] public function slaveof($host = '127.0.0.1', $port = 6379) {} /** * Access the Redis slowLog * - * @param string $operation This can be either GET, LEN, or RESET - * @param int|null $length If executing a SLOWLOG GET command, you can pass an optional length. + * @param string $operation The operation you wish to perform. This can be one of the following values: + * 'GET' - Retrieve the Redis slowlog as an array. + * 'LEN' - Retrieve the length of the slowlog. + * 'RESET' - Remove all slowlog entries. + * @param int $length This optional argument can be passed when operation + * is 'get' and will specify how many elements to retrieve. + * If omitted Redis will send up to a default number of + * entries, which is configurable. + * + * Note: With Redis >= 7.0.0 you can send -1 to mean "all". * * @return mixed|Redis The return value of SLOWLOG will depend on which operation was performed or Redis if in multimode * - SLOWLOG GET: Array of slowLog entries, as provided by Redis @@ -2342,7 +2505,7 @@ public function slaveof($host = '127.0.0.1', $port = 6379) {} * * @link https://redis.io/commands/slowlog */ - public function slowLog(string $operation, int $length = null) {} + public function slowLog(string $operation, int $length = 0) {} /** * Describes the object pointed to by a key. @@ -2394,7 +2557,7 @@ public function save() {} * @link https://redis.io/commands/bgsave * @example $redis->bgSave(); */ - public function bgsave() {} + public function bgSave() {} /** * Returns the timestamp of the last disk save. @@ -2412,10 +2575,10 @@ public function lastSave() {} * Blocks the current client until all the previous write commands are successfully transferred and * acknowledged by at least the specified number of slaves. * - * @param int $numSlaves Number of slaves that need to acknowledge previous write commands. - * @param int $timeout Timeout in milliseconds. + * @param int $numreplicas The number of replicas we want to confirm write operaions + * @param int $timeout How long to wait (zero meaning forever). * - * @return int|Redis The command returns the number of slaves reached by all the writes performed in the or Redis if in multimode + * @return int|false|Redis The command returns the number of slaves reached by all the writes performed in the or Redis if in multimode * context of the current connection * * @throws RedisException @@ -2423,7 +2586,7 @@ public function lastSave() {} * @link https://redis.io/commands/wait * @example $redis->wait(2, 1000); */ - public function wait($numSlaves, $timeout) {} + public function wait($numreplicas, $timeout) {} /** * Returns the type of data pointed by a given key. @@ -2452,7 +2615,7 @@ public function type(string $key) {} * Append specified string to the string stored in specified key. * * @param string $key - * @param string|mixed $value + * @param mixed $value * * @return false|int|Redis Size of the value after the append or Redis if in multimode * @@ -2466,7 +2629,7 @@ public function type(string $key) {} * $redis->get('key'); // 'value1value2' * */ - public function append($key, string $value) {} + public function append($key, $value) {} /** * Return a substring of a larger string @@ -2526,7 +2689,7 @@ public function setRange($key, $offset, $value) {} * Get the length of a string value. * * @param string $key - * @return false|int|Redis returns Redis if in multimode + * @return false|int|Redis The length of the string key if it exists, zero if it does not, and false on failure. * * @throws RedisException * @@ -2544,10 +2707,11 @@ public function strlen($key) {} * string as an array of bits from left to right, where the first byte's most significant bit is at position 0, * the second byte's most significant bit is at position 8, and so forth. * - * @param string $key - * @param int $bit - * @param int $start - * @param int $end + * @param string $key The key to check (must be a string) + * @param bool $bit Whether to look for an unset (0) or set (1) bit. + * @param int $start Where in the string to start looking. + * @param int $end Where in the string to stop looking. + * @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start was 0 and end was 2, Redis would only search the first two bits. * * @return false|int|Redis The command returns the position of the first bit set to 1 or 0 according to the request or Redis if in multimode * If we look for set bits (the bit argument is 1) and the string is empty or composed of just @@ -2574,7 +2738,7 @@ public function strlen($key) {} * $redis->bitpos('key', 0, 1, 5); // int(-1) * */ - public function bitpos($key, $bit, $start = 0, $end = -1) {} + public function bitpos($key, $bit, $start = 0, $end = -1, $bybit = false) {} /** * Return a single bit out of a larger string @@ -2621,9 +2785,10 @@ public function setBit($key, $offset, $value) {} /** * Count bits in a string * - * @param string $key - * @param int $start - * @param int $end + * @param string $key The key in question (must be a string key) + * @param int $start The index where Redis should start counting. If omitted it defaults to zero, which means the start of the string. + * @param int $end The index where Redis should stop counting. If omitted it defaults to -1, meaning the very end of the string. + * @param bool $bybit Whether or not Redis should treat $start and $end as bit positions, rather than bytes. * * @return false|int|Redis The number of bits set to 1 in the value behind the input key or Redis if in multimode * @@ -2639,7 +2804,7 @@ public function setBit($key, $offset, $value) {} * var_dump( $redis->bitCount('bit', 0, 2) ); // int(11) * */ - public function bitCount($key, $start = 0, $end = -1) {} + public function bitCount($key, $start = 0, $end = -1, $bybit = false) {} /** * Bitwise operation on multiple keys. @@ -2670,7 +2835,7 @@ public function bitOp($operation, $retKey, $key1, ...$otherKeys) {} /** * Removes all entries from the current database. * - * @param bool $async requires server version 4.0.0 or greater + * @param bool|null $async Whether to perform the task in a blocking or non-blocking way. Requires server version 4.0.0 or greater * * @return bool|Redis Always TRUE or Redis if in multimode * @throws RedisException @@ -2682,7 +2847,7 @@ public function flushDB($async = null) {} /** * Removes all entries from all databases. * - * @param bool $async requires server version 4.0.0 or greater + * @param bool|null $async Whether to perform the task in a blocking or non-blocking way. Requires server version 4.0.0 or greater * * @return bool|Redis Always TRUE or Redis if in multimode * @@ -2694,19 +2859,23 @@ public function flushDB($async = null) {} public function flushAll($async = null) {} /** - * Sort + * Sort the contents of a Redis key in various ways. * - * @param string $key - * @param array $option array(key => value, ...) - optional, with the following keys and values: - * - 'by' => 'some_pattern_*', - * - 'limit' => array(0, 1), - * - 'get' => 'some_other_pattern_*' or an array of patterns, - * - 'sort' => 'asc' or 'desc', - * - 'alpha' => TRUE, - * - 'store' => 'external-key' + * @param string $key The key you wish to sort + * @param array|null $options Various options controlling how you would like the data sorted. + * See blow for a detailed description of this options array. + * 'SORT' => 'ASC'|| 'DESC' // Sort in descending or descending order. + * 'ALPHA' => true || false // Whether to sort alphanumerically. + * 'LIMIT' => [0, 10] // Return a subset of the data at offset, count + * 'BY' => 'weight_*' // For each element in the key, read data from the + * external key weight_* and sort based on that value. + * 'GET' => 'weight_*' // For each element in the source key, retrieve the + * data from key weight_* and return that in the result + * rather than the source keys' element. This can + * be used in combination with 'BY' * - * @return array|Redis returns Redis if in multimode - * An array of values, or a number corresponding to the number of elements stored if that was used + * @return mixed This command can either return an array with the sorted data or the + * number of elements placed in a destination set when using the STORE option. * * @throws RedisException * @@ -2725,12 +2894,14 @@ public function flushAll($async = null) {} * var_dump($redis->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5 * */ - public function sort($key, $option = null) {} + public function sort($key, $options = null) {} /** * Returns an associative array of strings and integers * - * @param string $option Optional. The option to provide redis. + * If connected to Redis server >= 7.0.0 you may pass multiple optional sections. + * + * @param string ...$sections Optional section(s) you wish Redis server to return. * SERVER | CLIENTS | MEMORY | PERSISTENCE | STATS | REPLICATION | CPU | CLUSTER | KEYSPACE | COMMANDSTATS * * Returns an associative array of strings and integers, with the following keys: @@ -2777,7 +2948,7 @@ public function sort($key, $option = null) {} * - vm_enabled * - role * - * @return array|Redis returns Redis if in multimode + * @return array|false|Redis returns Redis if in multimode * * @throws RedisException * @@ -2792,12 +2963,12 @@ public function sort($key, $option = null) {} * $redis->info("CPU"); // just CPU information from Redis INFO * */ - public function info($option = null) {} + public function info(...$sections) {} /** * Returns an indexed array whose first element is the role * - * @return array|Redis returns Redis if in multimode + * @return mixed|Redis Will return an array with the role of the connected instance unless there is an error. returns Redis if in multimode * * @throws RedisException * @@ -2956,13 +3127,17 @@ public function getMultiple(array $keys) {} public function mGet(array $array) {} /** - * @see mset() + * Set one ore more string keys but only if none of the key exist. + * + * @see mSet() + * * @param array $array * @return false|int|Redis 1 (if the keys were set) or 0 (no key was set) or Redis if in multimode * * @throws RedisException * * @link https://redis.io/commands/msetnx + * @example $redis->msetnx(['foo' => 'bar', 'baz' => 'bop']); */ public function msetnx(array $array) {} @@ -3018,7 +3193,7 @@ public function rPopLPush($srcKey, $dstKey) {} * * @param string $srcKey * @param string $dstKey - * @param int $timeout + * @param int|float $timeout The number of seconds to wait. Note that you must be connected to Redis >= 6.0.0 to send a floating point timeout. * * @return string|mixed|bool|Redis The element that was moved in case of success, FALSE in case of timeout or Redis if in multimode * @@ -3031,14 +3206,26 @@ public function bRPopLPush($srcKey, $dstKey, $timeout) {} /** * Adds the specified member with a given score to the sorted set stored at key * - * @param string $key Required key - * @param array|float $options Options if needed or score if omitted - * @param float|string|mixed $score1 Required score or value if options omitted - * @param string|float|mixed $value1 Required value or optional score if options omitted - * @param float|string|mixed $score2 Optional score or value if options omitted - * @param string|float|mixed $value2 Optional value or score if options omitted - * @param float|string|mixed $scoreN Optional score or value if options omitted - * @param string|float|mixed $valueN Optional value or score if options omitted + * @param string $key The sorted set in question. + * @param array|float $score_or_options Either the score for the first element, or an array of options. + * 'NX', # Only update elements that already exist + * 'NX', # Only add new elements but don't update existing ones. + * 'LT' # Only update existing elements if the new score is + * # less than the existing one. + * 'GT' # Only update existing elements if the new score is + * # greater than the existing one. + * 'CH' # Instead of returning the number of elements added, + * # Redis will return the number Of elements that were + * # changed in the operation. + * 'INCR' # Instead of setting each element to the provide score, + * # increment the element by the + * # provided score, much like ZINCRBY. When this option + * # is passed, you may only send a single score and member. + * + * Note: 'GX', 'LT', and 'NX' cannot be passed together, and PhpRedis + * will send whichever one is last in the options array. + * + * @param mixed $more_scores_and_mems A variadic number of additional scores and members. * * @return false|int|Redis Number of values added or Redis if in multimode * @@ -3072,7 +3259,7 @@ public function bRPopLPush($srcKey, $dstKey, $timeout) {} * // ["v6"]=> float(8) * */ - public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) {} + public function zAdd($key, $score_or_options, ...$more_scores_and_mems) {} /** * Returns a range of elements from the ordered set stored at the specified key, @@ -3082,10 +3269,20 @@ public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $v * -1 the last element, * -2 the penultimate ... * - * @param string $key - * @param int $start - * @param int $end - * @param mixed $withscores + * @param string $key The sorted set in question. + * @param string|int $start The starting index we want to return. + * @param string|int $end The final index we want to return. + * + * @param array|bool|null $options This value may either be an array of options to pass to + * the command, or for historical purposes a boolean which + * controls just the 'WITHSCORES' option. + * 'WITHSCORES' => true, # Return both scores and members. + * 'LIMIT' => [10, 10], # Start at offset 10 and return 10 elements. + * 'REV' # Return the elements in reverse order + * 'BYSCORE', # Treat `start` and `end` as scores instead + * 'BYLEX' # Treat `start` and `end` as lexicographical values. + + * Note: 'BYLEX' and 'BYSCORE' are mutually exclusive. * * @return array|Redis Array containing the values in specified range or Redis if in multimode * @@ -3102,7 +3299,7 @@ public function zAdd($key, $options, $score1, $value1 = null, $score2 = null, $v * $redis->zRange('key1', 0, -1, true); // array('val0' => 0, 'val2' => 2, 'val10' => 10) * */ - public function zRange($key, $start, $end, $withscores = null) {} + public function zRange($key, $start, $end, $options = null) {} /** * Deletes a specified member from the ordered set. @@ -3152,10 +3349,10 @@ public function zDelete($key, $member1, ...$otherMembers) {} * -1 the last element, * -2 the penultimate ... * - * @param string $key - * @param int $start - * @param int $end - * @param mixed $withscore + * @param string $key The sorted set in question. + * @param int $start The index to start listing elements + * @param int $end The index to stop listing elements. + * @param mixed $scores Whether or not Redis should also return each members score. * * @return array|Redis Array containing the values in specified range or Redis if in multimode * @@ -3171,9 +3368,10 @@ public function zDelete($key, $member1, ...$otherMembers) {} * * // with scores * $redis->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0) + * $redis->zRevRange('key', 0, -1, ['withscores' => true]); * */ - public function zRevRange($key, $start, $end, $withscore = null) {} + public function zRevRange($key, $start, $end, $scores = null) {} /** * Returns the elements of the sorted set stored at the specified key which have scores in the @@ -3182,14 +3380,16 @@ public function zRevRange($key, $start, $end, $withscore = null) {} * * zRevRangeByScore returns the same items in reverse order, when the start and end parameters are swapped. * - * @param string $key - * @param int $start - * @param int $end - * @param array $options Two options are available: - * - withscores => TRUE, - * - and limit => array($offset, $count) + * @param string $key The sorted set to query. + * @param string $start The minimum score of elements that Redis should return. + * @param string $end The maximum score of elements that Redis should return. + * @param array $options Options that change how Redis will execute the command. * - * @return array|Redis Array containing the values in specified range or Redis if in multimode + * OPTION TYPE MEANING + * 'WITHSCORES' bool Whether to also return scores. + * 'LIMIT' [offset, count] Limit the reply to a subset of elements. + * + * @return array|false|Redis Array containing the values in specified range or Redis if in multimode * * @throws RedisException * @@ -3208,15 +3408,37 @@ public function zRevRange($key, $start, $end, $withscore = null) {} public function zRangeByScore($key, $start, $end, array $options = []) {} /** - * @param string $key - * @param string $start - * @param string $end - * @param array $options + * List elements from a Redis sorted set by score, highest to lowest * - * @return array|Redis returns Redis if in multimode + * @param string $key The sorted set to query. + * @param string $start The highest score to include in the results. + * @param string $end The lowest score to include in the results. + * @param array $options An options array that modifies how the command executes. + * + * $options = [ + * 'WITHSCORES' => true|false # Whether or not to return scores + * 'LIMIT' => [offset, count] # Return a subset of the matching members + * ]; + * + * + * NOTE: For legacy reason, you may also simply pass `true` for the + * options argument, to mean `WITHSCORES`. + * + * @return array|false|Redis returns Redis if in multimode * * @throws RedisException * @see zRangeByScore() + * + * @example + * $redis->zadd('oldest-people', 122.4493, 'Jeanne Calment', 119.2932, 'Kane Tanaka', + * 119.2658, 'Sarah Knauss', 118.7205, 'Lucile Randon', + * 117.7123, 'Nabi Tajima', 117.6301, 'Marie-Louise Meilleur', + * 117.5178, 'Violet Brown', 117.3753, 'Emma Morano', + * 117.2219, 'Chiyo Miyako', 117.0740, 'Misao Okawa'); + * + * $redis->zRevRangeByScore('oldest-people', 122, 119); + * $redis->zRevRangeByScore('oldest-people', 'inf', 118); + * $redis->zRevRangeByScore('oldest-people', '117.5', '-inf', ['LIMIT' => [0, 1]]); */ public function zRevRangeByScore(string $key, string $start, string $end, array $options = []) {} @@ -3230,7 +3452,7 @@ public function zRevRangeByScore(string $key, string $start, string $end, array * @param string $min The minimum alphanumeric value you wish to get. * @param string $max The maximum alphanumeric value you wish to get. * @param int $offset Optional argument if you wish to start somewhere other than the first element. - * @param int $limit Optional argument if you wish to limit the number of elements returned. + * @param int $count An optional count to limit the replies to (used in conjunction with offset) * * @return array|false|Redis Array containing the values in the specified range or Redis if in multimode * @@ -3250,20 +3472,87 @@ public function zRevRangeByScore(string $key, string $start, string $end, array */ public function zRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) {} + /** + * Retrieve the score of one or more members in a sorted set. + * + * @link https://redis.io/commands/zmscore + * + * @param string $key The sorted set + * @param mixed $member The first member to return the score from + * @param mixed $other_members One or more additional members to return the scores of. + * + * @return Redis|array|false An array of the scores of the requested elements. + * + * @example + * $redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three'); + * + * $redis->zMScore('zs', 'zero', 'two'); + * $redis->zMScore('zs', 'one', 'not-a-member'); + */ public function zMscore(string $key, string $member, string ...$other_members): array|false {} - public function zPopMax(string $key, int $value = null): array|false {} + /** + * Pop one or more of the highest scoring elements from a sorted set. + * + * @param string $key The sorted set to pop elements from. + * @param int|null $count An optional count of elements to pop. + * + * @return Redis|array|false All of the popped elements with scores or false on fialure. + * + * @link https://redis.io/commands/zpopmax + * + * @example + * $redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three'); + * + * $redis->zPopMax('zs'); + * $redis->zPopMax('zs', 2);. + */ + public function zPopMax(string $key, int $count = null): array|false {} - public function zPopMin(string $key, int $value = null): array|false {} + /** + * Pop one or more of the lowest scoring elements from a sorted set. + * + * @param string $key The sorted set to pop elements from. + * @param int|null $count An optional count of elements to pop. + * + * @return Redis|array|false The popped elements with their scores or false on failure. + * + * @link https://redis.io/commands/zpopmin + * + * @example + * $redis->zAdd('zs', 0, 'zero', 1, 'one', 2, 'two', 3, 'three'); + * + * $redis->zPopMin('zs'); + * $redis->zPopMin('zs', 2); + */ + public function zPopMin(string $key, int $count = null): array|false {} + /** + * Retrieve one or more random members from a Redis sorted set. + * + * @param string $key The sorted set to pull random members from. + * @param array|null $options One or more options that determine exactly how the command operates. + * + * OPTION TYPE MEANING + * 'COUNT' int The number of random members to return. + * 'WITHSCORES' bool Whether to return scores and members instead of + * + * @return Redis|string|array One ore more random elements. + * + * @see https://redis.io/commands/zrandmember + * + * @example $redis->zRandMember('zs', ['COUNT' => 2, 'WITHSCORES' => true]); + */ public function zRandMember(string $key, array $options = null): string|array|false {} /** - * @param string $key - * @param string $min - * @param string $max - * @param int $offset - * @param int $limit + * List members of a Redis sorted set within a legographical range, in reverse order. + * + * @param string $key The sorted set to list + * @param string $min The maximum legographical element to include in the result. + * @param string $min The minimum lexographical element to include in the result. + * @param int $offset An option offset within the matching elements to start at. + * @param int $count An optional count to limit the replies to. * * @return false|array|Redis returns Redis if in multimode * @@ -3271,6 +3560,10 @@ public function zRandMember(string $key, array $options = null): string|array|fa * * @see zRangeByLex() * @link https://redis.io/commands/zrevrangebylex + * + * @example + * $redis->zRevRangeByLex('captains', '[Q', '[J'); + * $redis->zRevRangeByLex('captains', '[Q', '[J', 1, 2); */ public function zRevRangeByLex(string $key, string $min, string $max, int $offset = -1, int $count = -1) {} @@ -3278,12 +3571,17 @@ public function zRevRangeByLex(string $key, string $min, string $max, int $offse * Removes all elements in the sorted set stored at key between the lexicographical range specified by min and max. * Applies when all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering. * - * @param string $key The ZSET you wish to run against. - * @param string $min The minimum alphanumeric value you wish to get. - * @param string $max The maximum alphanumeric value you wish to get. + * @param string $key The sorted set to remove elements from. + * @param string $min The start of the lexographical range to remove. + * @param string $max The end of the lexographical range to remove + * + * @return int|false|Redis The number of elements removed * - * @return int|false the number of elements removed. * @link https://redis.io/commands/zremrangebylex + * + * @example + * $redis->zRemRangeByLex('zs', '[a', '(b'); + * $redis->zRemRangeByLex('zs', '(banana', '(eggplant'); */ public function zRemRangeByLex(string $key, string $min, string $max) {} @@ -3398,6 +3696,24 @@ public function zDeleteRangeByRank($key, $start, $end) {} */ public function zCard($key) {} + /** + * Given one or more sorted set key names, return every element that is in the first + * set but not any of the others. + * + * @param array $keys One ore more sorted sets. + * @param array|null $options An array which can contain ['WITHSCORES' => true] if you want Redis to return members and scores. + * + * @return Redis|array|false An array of members or false on failure. + * + * @link https://redis.io/commands/zdiff + * + * @example + * $redis->zAdd('primes', 1, 'one', 3, 'three', 5, 'five'); + * $redis->zAdd('evens', 2, 'two', 4, 'four'); + * $redis->zAdd('mod3', 3, 'three', 6, 'six'); + * + * $redis->zDiff(['primes', 'evens', 'mod3']); + */ public function zdiff(array $keys, array $options = null): array|false {} /** @@ -3412,8 +3728,8 @@ public function zSize($key) {} /** * Returns the score of a given member in the specified sorted set. * - * @param string $key - * @param string|mixed $member + * @param string $key The sorted set to query. + * @param mixed $member The member we wish to query. * * @return float|bool|Redis false if member or key not exists or Redis if in multimode * @@ -3433,7 +3749,7 @@ public function zScore($key, $member) {} * with the smallest score. zRevRank starts at 0 for the item with the largest score. * * @param string $key - * @param string|mixed $member + * @param mixed $member * * @return int|false|Redis the item's score, or false if key or member is not exists or Redis if in multimode * @@ -3471,7 +3787,7 @@ public function zRevRank($key, $member) {} * * @param string $key * @param float $value (double) value that will be added to the member's score - * @param string|mixed $member + * @param mixed $member * * @return float|Redis the new value or Redis if in multimode * @@ -3499,7 +3815,7 @@ public function zIncrBy($key, $value, $member) {} * @param string $output * @param array $zSetKeys * @param null|array $weights - * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": defines the behaviour to use on + * @param string|null $aggregateFunction Either "SUM", "MIN", or "MAX": defines the behaviour to use on * duplicate entries during the zUnionStore * * @return false|int|Redis The number of values in the new sorted set or Redis if in multimode @@ -3553,7 +3869,7 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * @param string $output * @param array $zSetKeys * @param null|array $weights - * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": + * @param string|null $aggregateFunction Either "SUM", "MIN", or "MAX": * defines the behaviour to use on duplicate entries during the zInterStore. * * @return false|int|Redis The number of values in the new sorted set or Redis if in multimode @@ -3603,7 +3919,7 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * Scan a sorted set for members, with optional pattern and count * * @param string $key String, the set to scan. - * @param int &$iterator Long (reference), initialized to NULL. + * @param int|null &$iterator Long (reference), initialized to NULL. * @param string $pattern String (optional), the pattern to match. * @param int $count How many keys to return per iteration (Redis might return a different number). * @@ -3628,9 +3944,9 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * Block until Redis can pop the highest or lowest scoring members from one or more ZSETs. * There are two commands (BZPOPMIN and BZPOPMAX for popping the lowest and highest scoring elements respectively.) * - * @param string|array $key - * @param string|int|array $timeout_or_key ... - * @param mixed ...$extra_args + * @param string|array $key_or_keys Either a string key or an array of one or more keys. + * @param string|int|array $timeout_or_key If the previous argument was an array, this argument must be a timeout value. Otherwise it could also be another key. + * @param mixed ...$extra_args Can consist of additional keys, until the last argument which needs to be a timeout. * * @return false|array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode * if the timeout was reached without an element to pop. @@ -3641,21 +3957,19 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) {} * @link https://redis.io/commands/bzpopmax * @example *
    -     * // Wait up to 5 seconds to pop the *lowest* scoring member from sets `zs1` and `zs2`.
    -     * $redis->bzPopMin(['zs1', 'zs2'], 5);
    -     * $redis->bzPopMin('zs1', 'zs2', 5);
    -     *
          * // Wait up to 5 seconds to pop the *highest* scoring member from sets `zs1` and `zs2`
          * $redis->bzPopMax(['zs1', 'zs2'], 5);
          * $redis->bzPopMax('zs1', 'zs2', 5);
          * 
    */ - public function bzPopMax($key, $timeout_or_key, ...$extra_args) {} + public function bzPopMax($key_or_keys, $timeout_or_key, ...$extra_args) {} /** - * @param string|array $key - * @param string|int|array $timeout_or_key ... - * @param mixed ...$extra_args + * POP the minimum scoring element off of one or more sorted sets, blocking up to a specified timeout if no elements are available. + * + * @param string|array $key_or_keys Either a string key or an array of one or more keys. + * @param string|int|array $timeout_or_key If the previous argument was an array, this argument must be a timeout value. Otherwise it could also be another key. + * @param mixed ...$extra_args Can consist of additional keys, until the last argument which needs to be a timeout. * * @return false|array|Redis Either an array with the key member and score of the highest or lowest element or an empty array or Redis if in multimode * if the timeout was reached without an element to pop. @@ -3665,14 +3979,21 @@ public function bzPopMax($key, $timeout_or_key, ...$extra_args) {} * @see bzPopMax * @since >= 5.0 * @link https://redis.io/commands/bzpopmin + * + * @example + *
    +     * // Wait up to 5 seconds to pop the *lowest* scoring member from sets `zs1` and `zs2`.
    +     * $redis->bzPopMin(['zs1', 'zs2'], 5);
    +     * $redis->bzPopMin('zs1', 'zs2', 5);
    +     * 
    */ - public function bzPopMin($key, $timeout_or_key, ...$extra_args) {} + public function bzPopMin($key_or_keys, $timeout_or_key, ...$extra_args) {} /** * Can pop the highest scoring members from one ZSET. * * @param string $key - * @param int $count + * @param int|null $count * * @return array|Redis Either an array with the key member and score of the highest element or an empty array or Redis if in multimode * if there is no element to pop. @@ -3695,7 +4016,7 @@ public function zPopMax($key, $count = null) {} * Can pop the lowest scoring members from one ZSET. * * @param string $key - * @param int $count + * @param int|null $count * * @return array|Redis Either an array with the key member and score of the lowest element or an empty array or Redis if in multimode * if there is no element to pop. @@ -3719,7 +4040,7 @@ public function zPopMin($key, $count = null) {} * * @param string $key * @param string $hashKey - * @param string $value + * @param mixed $value * * @return int|bool|Redis returns Redis if in multimode * - 1 if value didn't exist and was added successfully, @@ -3738,7 +4059,7 @@ public function zPopMin($key, $count = null) {} * $redis->hGet('h', 'key1'); // returns "plop" * */ - public function hSet($key, $hashKey, string $value) {} + public function hSet($key, $hashKey, $value) {} /** * Adds a value to the hash stored at key only if this field isn't already in the hash. @@ -3837,7 +4158,7 @@ public function hDel($key, $hashKey1, ...$otherHashKeys) {} * * @param string $key * - * @return array|Redis An array of elements, the keys of the hash. This works like PHP's array_keys() or Redis if in multimode + * @return array|false|Redis An array of elements, the keys of the hash. This works like PHP's array_keys() or Redis if in multimode * * @throws RedisException * @@ -3872,7 +4193,7 @@ public function hKeys($key) {} * * @param string $key * - * @return array|Redis An array of elements, the values of the hash. This works like PHP's array_values() or Redis if in multimode + * @return array|false|Redis An array of elements, the values of the hash. This works like PHP's array_values() or Redis if in multimode * * @throws RedisException * @@ -3907,7 +4228,7 @@ public function hVals($key) {} * * @param string $key * - * @return array|Redis An array of elements, the contents of the hash or Redis if in multimode + * @return array|false|Redis An array of elements, the contents of the hash or Redis if in multimode * * @throws RedisException * @@ -3985,7 +4306,7 @@ public function hIncrBy($key, $hashKey, $value) {} * @param string $field * @param float $increment * - * @return float|Redis returns Redis if in multimode + * @return float|false|Redis returns Redis if in multimode * * @throws RedisException * @@ -4038,7 +4359,7 @@ public function hMSet($key, $hashKeys) {} * @param string $key * @param array $hashKeys * - * @return array|Redis Array An array of elements, the values of the specified fields in the hash, or Redis if in multimode + * @return array|false|Redis Array An array of elements, the values of the specified fields in the hash, or Redis if in multimode * with the hash keys as array keys. * * @throws RedisException @@ -4058,7 +4379,7 @@ public function hMGet($key, $hashKeys) {} * Scan a HASH value for members, with an optional pattern and count. * * @param string $key - * @param int &$iterator + * @param int|null ?$iterator The scan iterator, which should be initialized to NULL before the first call. * @param string $pattern Optional pattern to match against. * @param int $count How many keys to return in a go (only a sugestion to Redis). * @@ -4069,12 +4390,24 @@ public function hMGet($key, $hashKeys) {} * @link https://redis.io/commands/hscan * @example *
    -     * // $iterator = null;
    -     * // while($elements = $redis->hscan('hash', $iterator)) {
    -     * //     foreach($elements as $key => $value) {
    -     * //         echo $key . ' => ' . $value . PHP_EOL;
    -     * //     }
    -     * // }
    +     * $redis->del('big-hash');
    +     *
    +     * for ($i = 0; $i < 1000; $i++) {
    +     *     $fields["field:$i"] = "value:$i";
    +     * }
    +     *
    +     * $redis->hMSet('big-hash', $fields);
    +     *
    +     * $it = NULL;
    +     *
    +     * do {
    +     *     // Scan the hash but limit it to fields that match '*:1?3'
    +     *     $fields = $redis->hScan('big-hash', $it, '*:1?3');
    +     *
    +     *     foreach ($fields as $field => $value) {
    +     *         echo "[$field] => $value\n";
    +     *     }
    +     * } while ($it != 0);
          * 
    */ public function hScan($key, &$iterator, $pattern = null, $count = 0) {} @@ -4092,6 +4425,11 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) {} * * @link https://redis.io/commands/hstrlen * @since >= 3.2 + * + * @example + * $redis->del('hash'); + * $redis->hMSet('hash', ['50bytes' => str_repeat('a', 50)]); + * $redis->hStrLen('hash', '50bytes'); */ public function hStrLen(string $key, string $field) {} @@ -4103,7 +4441,8 @@ public function hStrLen(string $key, string $field) {} * @param float $longitude * @param float $latitude * @param string $member - * @param mixed ...$other_triples + * @param mixed $other_triples_and_options You can continue to pass longitude, lattitude, and member arguments to add as many members + * as you wish. Optionally, the final argument may be a string with options for the command * * @return false|int|Redis The number of elements added to the geospatial key or Redis if in multimode * @@ -4122,13 +4461,16 @@ public function hStrLen(string $key, string $field) {} * -122.431, 37.773, "San Francisco", * -157.858, 21.315, "Honolulu" * ); // 2 + * + * $redis->geoAdd('cities', -121.837478, 39.728494, 'Chico', ['XX', 'CH']); + * $redis->geoAdd('cities', -121.8374, 39.7284, 'Chico', -122.03218, 37.322, 'Cupertino'); * */ - public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples) {} + public function geoAdd($key, $longitude, $latitude, $member, ...$other_triples_and_options) {} /** * Retrieve Geohash strings for one or more elements of a geospatial index. - + * * @param string $key * @param string ...$member variadic list of members * @@ -4187,8 +4529,43 @@ public function geoHash($key, ...$member) {} */ public function geoPos(string $key, string ...$member) {} + /** + * Search a geospacial sorted set for members in various ways. + * + * @param string $key The set to query. + * @param array|string $position Either a two element array with longitude and lattitude, or a string representing a member of the set. + * @param array|int|float $shape Either a number representine the radius of a circle to search, or + * a two element array representing the width and height of a box to search. + * @param string $unit The unit of our shape. See geodist() for possible units. + * @param array $options See georadius() for options. Note that the `STORE` options are not allowed for this command. + * + * @return mixed[] + */ public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false {} + /** + * Search a geospacial sorted set for members within a given area or range, storing the results into + * a new set. + * + * @param string $dst The destination where results will be stored. + * @param string $src The key to query. + * @param array|string $position Either a two element array with longitude and lattitude, or a string representing a member of the set. + * @param array|int|float $shape Either a number representine the radius of a circle to search, or + * a two element array representing the width and height of a box to search. + * @param string $unit The unit of our shape. See geoDist for possible units. + * @param array $options + * + * $options = [ + * 'ASC' | 'DESC', # The sort order of returned members + * 'WITHDIST' # Also store distances. + * # Limit to N returned members. Optionally a two element array may be + * # passed as the `LIMIT` argument, and the `ANY` argument. + * 'COUNT' => [], or [, ] + * ]; + * + * + * @return mixed[]|int|true|Redis + */ public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array|false {} /** @@ -4203,7 +4580,7 @@ public function geosearchstore(string $dst, string $src, array|string $position, * @param string $key * @param string $member1 * @param string $member2 - * @param string|null $unit + * @param string|null $unit Which unit to use when computing distance, defaulting to meters. M - meters, KM - kilometers, FT - feet, MI - miles * * @return float|Redis The distance between the two passed members in the units requested (meters by default) or Redis if in multimode * @@ -4356,7 +4733,7 @@ public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $op * @param $units * @param array|null $options see georadius * - * @return array|Redis The zero or more entries that are close enough to the member given the distance and radius specified or Redis if in multimode + * @return mixed|Redis The zero or more entries that are close enough to the member given the distance and radius specified or Redis if in multimode * * @throws RedisException * @@ -4389,24 +4766,26 @@ public function geoRadius($key, $longitude, $latitude, $radius, $unit, array $op public function geoRadiusByMember($key, $member, $radius, $units, array $options = []) {} /** - * Get or Set the redis config keys. + * Execute the Redis CONFIG command in a variety of ways. * - * @param string $operation either `GET` or `SET` - * @param string $key for `SET`, glob-pattern for `GET` - * @param string|mixed $value optional string (only for `SET`) + * @param string $operation Operations that PhpRedis supports: RESETSTAT, REWRITE, GET, and SET. + * @param array|string|null $key_or_settings One or more keys or values. + * @param string|null $value The value if this is a `CONFIG SET` operation. * - * @return array|Redis Associative array for `GET`, key -> value or Redis if in multimode + * @return mixed|Redis Associative array for `GET`, key -> value or Redis if in multimode * * @throws RedisException * * @link https://redis.io/commands/config-get * @example *
    -     * $redis->config("GET", "*max-*-entries*");
    -     * $redis->config("SET", "dir", "/var/run/redis/dumps/");
    +     * $redis->config('GET', 'timeout');
    +     * $redis->config('GET', ['timeout', 'databases']);
    +     * $redis->config('SET', 'timeout', 30);
    +     * $redis->config('SET', ['timeout' => 30, 'loglevel' => 'warning']);
          * 
    */ - public function config($operation, $key, $value = null) {} + public function config($operation, $key_or_settings = null, $value = null) {} /** * Evaluate a LUA script serverside @@ -4487,7 +4866,7 @@ public function evaluateSha($scriptSha, $args = [], $numKeys = 0) {} * @param string $command load | flush | kill | exists * @param mixed ...$script * - * @return mixed|Redis returns Redis if in multimode + * @return mixed|Redis This command returns various things depending on the specific operation executed. Redis if in multimode * * @throws RedisException * @@ -4529,7 +4908,7 @@ public function getLastError() {} /** * Clear the last error message * - * @return bool true + * @return bool This should always return true or throw an exception if we're not connected. * * @throws RedisException * @@ -4555,7 +4934,7 @@ public function clearLastError() {} * - CLIENT KILL [ip:port] * * @param string $command - * @param string $value + * @param mixed ...$args * @return mixed This will vary depending on which client command was executed: * - CLIENT LIST will return an array of arrays with client information. * - CLIENT GETNAME will return the client name or false if none has been set @@ -4579,7 +4958,7 @@ public function clearLastError() {} * $redis->client('kill', ); // Kill the process at ip:port * */ - public function client($command, $value = null) {} + public function client($command, ...$args) {} /** * A utility method to prefix the value with the prefix setting for phpredis. @@ -4624,7 +5003,7 @@ public function _unserialize($value) {} * * @param mixed $value The value to be serialized. * - * @return mixed + * @return string * @example *
          * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);
    @@ -4643,7 +5022,7 @@ public function _serialize($value) {}
          * The data that comes out of DUMP is a binary representation of the key as Redis stores it.
          * @param string $key
          *
    -     * @return string|false The Redis encoded value of the key, or FALSE if the key doesn't exist
    +     * @return string|false|Redis A binary string representing the key's value or FALSE if the key doesn't exist or Redis if in multimode
          *
          * @throws RedisException
          *
    @@ -4659,11 +5038,25 @@ public function dump($key) {}
         /**
          * Restore a key from the result of a DUMP operation.
          *
    -     * @param string $key   The key name
    -     * @param int    $ttl   How long the key should live (if zero, no expire will be set on the key)
    -     * @param string $value (binary).  The Redis encoded key value (from DUMP)
    +     * @param string $key     The name of the key you wish to create.
    +     * @param int    $ttl     What Redis should set the key's TTL (in milliseconds) to once it is created.Zero means no TTL at all.
    +     * @param string $value   The serialized binary value of the string (generated by DUMP).
    +     * @param array|null $options An array of additional options that modifies how the command operates.
    +     *                        
    +     *                        $options = [
    +     *                            'ABSTTL'          # If this is present, the `$ttl` provided by the user should
    +     *                                              # be an absolute timestamp, in milliseconds()
          *
    -     * @return bool
    +     *                            'REPLACE'         # This flag instructs Redis to store the key even if a key with
    +     *                                              # that name already exists.
    +     *
    +     *                            'IDLETIME' => int # Tells Redis to set the keys internal 'idletime' value to a
    +     *                                              # specific number (see the Redis command OBJECT for more info).
    +     *                            'FREQ'     => int # Tells Redis to set the keys internal 'FREQ' value to a specific
    +     *                                              # number (this relates to Redis' LFU eviction algorithm).
    +     *                        ];
    +     *                        
    +     * @return bool|Redis True if the key was stored, false if not.
          *
          * @throws RedisException
          *
    @@ -4675,20 +5068,21 @@ public function dump($key) {}
          * $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo'
          * 
    */ - public function restore($key, $ttl, $value) {} + public function restore($key, $ttl, $value, $options = null) {} /** * Migrates a key to a different Redis instance. * * @param string $host The destination host * @param int $port The TCP port to connect to. - * @param string $key The key to migrate. + * @param string|array $key The key to migrate. * @param int $db The target DB. * @param int $timeout The maximum amount of time given to this transfer. * @param bool $copy Should we send the COPY flag to redis. * @param bool $replace Should we send the REPLACE flag to redis. + * @param mixed $credentials * - * @return bool + * @return bool|Redis * * @throws RedisException * @@ -4698,10 +5092,10 @@ public function restore($key, $ttl, $value) {} * $redis->migrate('backup', 6379, 'foo', 0, 3600); * */ - public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) {} + public function migrate($host, $port, $key, $dstdb, $timeout, $copy = false, $replace = false, $credentials = null) {} /** - * Return the current Redis server time. + * Retrieve the server time from the connected Redis instance. * * @return false|array If successful, the time will come back as an associative array with element zero being the * unix timestamp, and element one being microseconds. @@ -4723,9 +5117,20 @@ public function time() {} /** * Scan the keyspace for keys * - * @param int|null &$iterator Iterator, initialized to NULL. - * @param string $pattern Pattern to match. - * @param int $count Count of keys per iteration (only a suggestion to Redis). + * @param int|null ?$iterator The cursor returned by Redis for every subsequent call to SCAN. On + * the initial invocation of the call, it should be initialized by the + * caller to NULL. Each time SCAN is invoked, the iterator will be + * updated to a new number, until finally Redis will set the value to + * zero, indicating that the scan is complete. + * + * @param string $pattern An optional glob-style pattern for matching key names. If passed as + * NULL, it is the equivalent of sending '*' (match every key). + * + * @param int $count A hint to redis that tells it how many keys to return in a single + * call to SCAN. The larger the number, the longer Redis may block + * clients while iterating the key space. + * + * @param string|null $type An optional argument to specify which key types to scan (e.g. 'STRING', 'LIST', 'SET') * * @return array|false|Redis This function will return an array of keys or FALSE if there are no more keys or Redis if in multimode * @@ -4734,15 +5139,31 @@ public function time() {} * @link https://redis.io/commands/scan * @example *
    -     * $iterator = null;
    -     * while(false !== ($keys = $redis->scan($iterator))) {
    -     *     foreach($keys as $key) {
    -     *         echo $key . PHP_EOL;
    +     * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_NORETRY);
    +     *
    +     * $it = null;
    +     *
    +     * do {
    +     *     $keys = $redis->scan($it, '*zorg*');
    +     *     foreach ($keys as $key) {
    +     *         echo "KEY: $key\n";
    +     *     }
    +     * } while ($it != 0);
    +     *
    +     * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
    +     *
    +     * $it = null;
    +     *
    +     * // When Redis::SCAN_RETRY is enabled, we can use simpler logic, as we will never receive an
    +     * // empty array of keys when the iterator is nonzero.
    +     * while ($keys = $redis->scan($it, '*zorg*')) {
    +     *     foreach ($keys as $key) {
    +     *         echo "KEY: $key\n";
          *     }
          * }
          * 
    */ - public function scan(&$iterator, $pattern = null, $count = 0) {} + public function scan(&$iterator, $pattern = null, $count = 0, $type = null) {} /** * Adds all the element arguments to the HyperLogLog data structure stored at the key. @@ -4750,7 +5171,7 @@ public function scan(&$iterator, $pattern = null, $count = 0) {} * @param string $key * @param array $elements * - * @return bool|Redis returns Redis if in multimode + * @return bool|int|Redis Returns 1 if the set was altered, and zero if not. Redis if in multimode * * @throws RedisException * @@ -4763,7 +5184,7 @@ public function pfAdd($key, array $elements) {} * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data * structure stored at the specified variable, which is 0 if the variable does not exist. * - * @param string|array $key + * @param string|array $key_or_keys Either one key or an array of keys * * @return false|int|Redis returns Redis if in multimode * @@ -4778,7 +5199,7 @@ public function pfAdd($key, array $elements) {} * $redis->pfCount(array('key1', 'key2')); // int(3) * */ - public function pfCount($key) {} + public function pfCount($key_or_keys) {} /** * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality @@ -4851,16 +5272,21 @@ public function getMode() {} public function xAck($stream, $group, $messages) {} /** - * Add a message to a stream + * Append a message to a stream. * * @param string $key - * @param string $id - * @param array $messages - * @param int $maxLen - * @param bool $isApproximate - * @param bool $nomkstream + * @param string $id The ID for the message we want to add. This can be the special value '*' + * which means Redis will generate the ID that appends the message to the + * end of the stream. It can also be a value in the form -* which will + * generate an ID that appends to the end ot entries with the same value (if any exist). + * @param array $messages + * @param int $maxlen If specified Redis will append the new message but trim any number of the + * oldest messages in the stream until the length is <= $maxlen. + * @param bool $isApproximate Used in conjunction with `$maxlen`, this flag tells Redis to trim the stream + * but in a more efficient way, meaning the trimming may not be exactly to `$maxlen` values. + * @param bool $nomkstream If passed as `TRUE`, the stream must exist for Redis to append the message. * - * @return string|Redis The added message ID or Redis if in multimode + * @return string|true|Redis The added message ID or Redis if in multimode * * @throws RedisException * @@ -4872,17 +5298,36 @@ public function xAck($stream, $group, $messages) {} * $redis->xAdd('mystream', "*", ['field' => 'value'], 10, true); * */ - public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) {} - - /** - * Claim ownership of one or more pending messages - * - * @param string $key - * @param string $group - * @param string $consumer - * @param int $min_iddle - * @param array $ids - * @param array $options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID'] + public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) {} + + /** + * This method allows a consumer to take ownership of pending stream entries, by ID. Another + * command that does much the same thing but does not require passing specific IDs is `Redis::xAutoClaim`. + * + * @param string $key The stream we wish to claim messages for. + * @param string $group Our consumer group. + * @param string $consumer Our consumer. + * @param int $min_idle The minimum idle-time in milliseconds a message must have for ownership to be transferred. + * @param array $ids + * @param array $options An options array that modifies how the command operates. + * + * + * # Following is an options array describing every option you can pass. Note that + * # 'IDLE', and 'TIME' are mutually exclusive. + * $options = [ + * 'IDLE' => 3 # Set the idle time of the message to a 3. By default + * # the idle time is set to zero. + * 'TIME' => 1000*time() # Same as IDLE except it takes a unix timestamp in + * # milliseconds. + * 'RETRYCOUNT' => 0 # Set the retry counter to zero. By default XCLAIM + * # doesn't modify the counter. + * 'FORCE' # Creates the pending message entry even if IDs are + * # not already + * # in the PEL with another client. + * 'JUSTID' # Return only an array of IDs rather than the messages + * # themselves. + * ]; + * * * @return false|array|Redis Either an array of message IDs along with corresponding data, or just an array of IDs or Redis if in multimode * (if the 'JUSTID' option was passed). @@ -4930,11 +5375,34 @@ public function xClaim(string $key, string $group, string $consumer, int $min_id public function xDel($key, $ids) {} /** - * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER' - * @param string $key - * @param string $group - * @param string $msgId - * @param bool $mkStream + * Perform various operation on consumer groups for a particular Redis STREAM. What the command does + * is primarily based on which operation is passed. + * + * @param string $operation The subcommand you intend to execute. Valid options are as follows + * 'HELP' - Redis will return information about the command + * Requires: none + * 'CREATE' - Create a consumer group. + * Requires: Key, group, consumer. + * 'SETID' - Set the ID of an existing consumer group for the stream. + * Requires: Key, group, id. + * 'CREATECONSUMER' - Create a new consumer group for the stream. You must + * also pass key, group, and the consumer name you wish to + * create. + * Requires: Key, group, consumer. + * 'DELCONSUMER' - Delete a consumer from group attached to the stream. + * Requires: Key, group, consumer. + * 'DESTROY' - Delete a consumer group from a stream. + * Requires: Key, group. + * @param string|null $key The STREAM we're operating on. + * @param string|null $group The consumer group we want to create/modify/delete. + * @param string|null $id_or_consumer The STREAM id (e.g. '$') or consumer group. See the operation section + * for information about which to send. + * @param bool $mkstream This flag may be sent in combination with the 'CREATE' operation, and + * cause Redis to also create the STREAM if it doesn't currently exist. + * + * @param int $entries_read Allows you to set Redis' 'entries-read' STREAM value. This argument is + * only relevant to the 'CREATE' and 'SETID' operations. + * Note: Requires Redis >= 7.0.0. * * @return mixed|Redis This command returns different types depending on the specific XGROUP command executed or Redis if in multimode * @@ -4948,14 +5416,15 @@ public function xDel($key, $ids) {} * $redis->xGroup('DESTROY', 'mystream', 'mygroup'); * */ - public function xGroup($operation, $key = null, $group = null, $msgId = null, $mkStream = false) {} + public function xGroup($operation, $key = null, $group = null, $id_or_consumer = null, $mkstream = false, $entries_read = -2) {} /** * Get information about a stream or consumer groups * - * @param string $operation e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP' - * @param string $stream - * @param string $group + * @param string $operation The specific info operation to perform. e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP' + * @param string|null $arg1 The first argument (depends on operation) + * @param string|null $arg2 The second argument + * @param int $count The COUNT argument to `XINFO STREAM` * * @return mixed|Redis This command returns different types depending on which subcommand is used or Redis if in multimode * @@ -4967,7 +5436,7 @@ public function xGroup($operation, $key = null, $group = null, $msgId = null, $m * $redis->xInfo('STREAM', 'mystream'); * */ - public function xInfo($operation, $stream = null, $group = null) {} + public function xInfo($operation, $arg1 = null, $arg2 = null, $count = -1) {} /** * Get the length of a given stream. @@ -4989,14 +5458,14 @@ public function xLen($stream) {} /** * Get information about pending messages in a given stream * - * @param string $stream - * @param string $group - * @param string $start - * @param string $end - * @param int $count - * @param string $consumer + * @param string $stream The stream to inspect. + * @param string $group The user group we want to see pending messages from. + * @param string|null $start The minimum ID to consider. + * @param string|null $end The maximum ID to consider. + * @param int $count Optional maximum number of messages to return. + * @param string|null $consumer If provided, limit the returned messages to a specific consumer. * - * @return array|string|Redis Information about the pending messages, in various forms depending on or Redis if in multimode + * @return array|string|false|Redis Information about the pending messages, in various forms depending on or Redis if in multimode * the specific invocation of XPENDING. * * @throws RedisException @@ -5013,10 +5482,10 @@ public function xPending($stream, $group, $start = null, $end = null, $count = - /** * Get a range of messages from a given stream * - * @param string $stream - * @param string $start - * @param string $end - * @param int $count + * @param string $stream The stream key name to list. + * @param string $start The minimum ID to return. + * @param string $end The maximum ID to return. + * @param int $count An optional maximum number of entries to return. * * @return array|bool|Redis The messages in the stream within the requested range or Redis if in multimode * @@ -5036,9 +5505,9 @@ public function xRange($stream, $start, $end, $count = -1) {} /** * Read data from one or more streams and only return IDs greater than sent in the command. * - * @param array $streams - * @param int|string $count - * @param int|string $block + * @param array $streams An associative array with stream name keys and minimum id values. + * @param int $count An optional limit to how many entries are returnd *per stream* + * @param int $block An optional maximum number of milliseconds to block the caller if no data is available on any of the provided streams. * * @return array|bool|Redis The messages in the stream newer than the IDs passed to Redis (if any) or Redis if in multimode * @@ -5055,13 +5524,13 @@ public function xRead($streams, $count = -1, $block = -1) {} /** * This method is similar to xRead except that it supports reading messages for a specific consumer group. * - * @param string $group - * @param string $consumer - * @param array $streams - * @param int|null $count - * @param int|null $block + * @param string $group The consumer group to use. + * @param string $consumer The consumer to use. + * @param array $streams An array of stream names and message IDs + * @param int|null $count Optional maximum number of messages to return + * @param int|null $block How long to block if there are no messages available. * - * @return array|Redis The messages delivered to this consumer group (if any) or Redis if in multimode + * @return array|bool|Redis The messages delivered to this consumer group (if any) or Redis if in multimode * * @throws RedisException * @@ -5080,10 +5549,10 @@ public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) * This is identical to xRange except the results come back in reverse order. * Also note that Redis reverses the order of "start" and "end". * - * @param string $stream - * @param string $end - * @param string $start - * @param int $count + * @param string $stream The stream key to query. + * @param string $end The maximum message ID to include. + * @param string $start The minimum message ID to include. + * @param int $count An optional maximum number of messages to include. * * @return array|bool|Redis The messages in the range specified or Redis if in multimode * @@ -5093,6 +5562,7 @@ public function xReadGroup($group, $consumer, $streams, $count = 1, $block = 1) * @example *
          * $redis->xRevRange('mystream', '+', '-');
    +     * $redis->xRevRange('mystream', '0-2', '0-1');
          * 
    */ public function xRevRange($stream, $end, $start, $count = -1) {} @@ -5102,9 +5572,15 @@ public function xRevRange($stream, $end, $start, $count = -1) {} * If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes * (this is more efficient) * - * @param string $stream - * @param int $maxLen - * @param bool $isApproximate + * @param string $stream The STREAM key to trim. + * @param string $threshold This can either be a maximum length, or a minimum id. + * MAXLEN - An integer describing the maximum desired length of the stream after the command. + * MINID - An ID that will become the new minimum ID in the stream, as Redis will trim all + * messages older than this ID. + * @param bool $approx Whether redis is allowed to do an approximate trimming of the stream. This is + * more efficient for Redis given how streams are stored internally. + * @param bool $minid When set to `true`, users should pass a minimum ID to the `$threshold` argument. + * @param int $limit An optional upper bound on how many entries to trim during the command. * * @return false|int|Redis The number of messages trimed from the stream or Redis if in multimode * @@ -5119,7 +5595,7 @@ public function xRevRange($stream, $end, $start, $count = -1) {} * $redis->xTrim('mystream', 100, true); * */ - public function xTrim($stream, $maxLen, $isApproximate) {} + public function xTrim($stream, $threshold, $approx = false, $minid = false, $limit = -1) {} /** * Adds a values to the set value stored at key. @@ -5142,6 +5618,687 @@ public function xTrim($stream, $maxLen, $isApproximate) {} * */ public function sAddArray($key, array $values) {} + + public function __destruct() {} + + /** + * Compress a value with the currently configured compressor as set with Redis::setOption(). + * + * @param string $value The value to be compressed + * + * @return string The compressed result + */ + public function _compress($value) {} + + /** + * Uncompress the provided argument that has been compressed with the + * currently configured compressor as set with Redis::setOption(). + * + * @param string $value The compressed value to uncompress. + * + * @return string The uncompressed result. + */ + public function _uncompress($value) {} + + /** + * Pack the provided value with the configured serializer and compressor as set with Redis::setOption(). + * + * @param mixed $value The value to pack + * + * @return string The packed result having been serialized and compressed. + */ + public function _pack($value) {} + + /** + * Unpack the provided value with the configured compressor and serializer as set with Redis::setOption(). + * + * @param string $value The value which has been serialized and compressed. + * + * @return mixed The uncompressed and eserialized value. + */ + public function _unpack($value) {} + + /** + * Execute the Redis ACL command. + * + * @param string $subcmd Minumum of one argument for Redis and two for RedisCluster. + * @param string ...$args + * + * @return mixed + * + * @example + * + * $redis->acl('USERS'); // Get a list of users + * $redis->acl('LOG'); // See log of Redis' ACL subsystem + */ + public function acl($subcmd, ...$args) {} + + /** + * POP one or more elements from one or more sorted sets, blocking up to a specified amount of time when no elements are available. + * + * @param float $timeout How long to block if there are no element available + * @param array $keys The sorted sets to pop from + * @param string $from The string 'MIN' or 'MAX' (case insensitive) telling Redis whether you wish to pop the lowest or highest scoring members from the set(s). + * @param int $count Pop up to how many elements. + * + * @return array|null|false|Redis This function will return an array of popped elements, or false + * depending on whether any elements could be popped within the specified timeout. + * + * NOTE: If Redis::OPT_NULL_MULTIBULK_AS_NULL is set to true via Redis::setOption(), this method will instead return NULL when Redis doesn't pop any elements. + */ + public function bzmpop($timeout, $keys, $from, $count = 1) {} + + /** + * POP one or more of the highest or lowest scoring elements from one or more sorted sets. + * + * @link https://redis.io/commands/zmpop + * + * @param array $keys One or more sorted sets + * @param string $from The string 'MIN' or 'MAX' (case insensitive) telling Redis whether you want to pop the lowest or highest scoring elements. + * @param int $count Pop up to how many elements at once. + * + * @return array|null|false|Redis An array of popped elements or false if none could be popped. + */ + public function zmpop($keys, $from, $count = 1) {} + + /** + * Pop one or more elements from one or more Redis LISTs, blocking up to a specified timeout when no elements are available. + * + * @link https://redis.io/commands/blmpop + * + * @param float $timeout The number of seconds Redis will block when no elements are available. + * @param array $keys One or more Redis LISTs to pop from. + * @param string $from The string 'LEFT' or 'RIGHT' (case insensitive), telling Redis whether to pop elements from the beginning or end of the LISTs. + * @param int $count Pop up to how many elements at once. + * + * @return array|null|false|Redis One or more elements popped from the list(s) or false if all LISTs were empty. + */ + public function blmpop($timeout, $keys, $from, $count = 1) {} + + /** + * Pop one or more elements off of one or more Redis LISTs. + * + * @link https://redis.io/commands/lmpop + * + * @param array $keys An array with one or more Redis LIST key names. + * @param string $from The string 'LEFT' or 'RIGHT' (case insensitive), telling Redis whether to pop elements from the beginning or end of the LISTs. + * @param int $count The maximum number of elements to pop at once. + * + * @return array|null|false|Redis One or more elements popped from the LIST(s) or false if all the LISTs were empty. + */ + public function lmpop($keys, $from, $count = 1) {} + + /** + * @param string|null $opt + * @param mixed ...$args + * + * @return mixed + */ + public function command($opt = null, ...$args) {} + + /** + * Make a copy of a key. + * + * $redis = new Redis(['host' => 'localhost']); + * + * @param string $src The key to copy + * @param string $dst The name of the new key created from the source key. + * @param array|null $options An array with modifiers on how COPY should operate. + * 'REPLACE' => true|false # Whether to replace an existing key. + * 'DB' => int # Copy key to specific db. + * + * @return bool|Redis True if the copy was completed and false if not. + * + * @link https://redis.io/commands/copy + * + * @example + * $redis->pipeline() + * ->select(1) + * ->del('newkey') + * ->select(0) + * ->del('newkey') + * ->mset(['source1' => 'value1', 'exists' => 'old_value']) + * ->exec(); + * + * var_dump($redis->copy('source1', 'newkey')); + * var_dump($redis->copy('source1', 'newkey', ['db' => 1])); + * var_dump($redis->copy('source1', 'exists')); + * var_dump($redis->copy('source1', 'exists', ['REPLACE' => true])); + */ + public function copy($src, $dst, $options = null) {} + + /** + * @param string $key + * + * @return string|Redis + */ + public function debug($key) {} + + /** + * This is simply the read-only variant of eval, meaning the underlying script may not modify data in redis. + * + * @param string $script_sha + * @param mixed[] $args + * @param int $num_keys + * + * @return mixed + * + * @see eval() + */ + public function eval_ro($script_sha, $args = [], $num_keys = 0) {} + + /** + * This is simply the read-only variant of evalsha, meaning the underlying script may not modify data in redis. + * + * @param string $sha1 + * @param mixed[] $args + * @param int $num_keys + * + * @return mixed + * @see evalsha() + */ + public function evalsha_ro($sha1, $args = [], $num_keys = 0) {} + + /** + * @param array|null $to + * @param bool $abort + * @param int $timeout + * + * @return bool|Redis + */ + public function failover($to = null, $abort = false, $timeout = 0) {} + + /** + * Get the expiration of a given key as a unix timestamp + * + * @param string $key The key to check. + * + * @return int|false|Redis The timestamp when the key expires, or -1 if the key has no expiry and -2 if the key doesn't exist. + * + * @link https://redis.io/commands/expiretime + * + * @example + * $redis->setEx('mykey', 60, 'myval'); + * $redis->expiretime('mykey'); + */ + public function expiretime($key) {} + + /** + * Get the expriation timestamp of a given Redis key but in milliseconds. + * + * @param string $key The key to check + * + * @link https://redis.io/commands/pexpiretime + * @see expiretime() + * + * @return int|false|Redis The expiration timestamp of this key (in milliseconds) or -1 if the key has no expiration, and -2 if it does not exist. + */ + public function pexpiretime($key) {} + + /** + * Invoke a function. + * + * @param string $fn The name of the function + * @param array $keys Optional list of keys + * @param array $args Optional list of args + * + * @return mixed Function may return arbitrary data so this method can return strings, arrays, nested arrays, etc. + * + * @link https://redis.io/commands/fcall + */ + public function fcall($fn, $keys = [], $args = []) {} + + /** + * This is a read-only variant of the FCALL command that cannot execute commands that modify data. + * + * @param string $fn The name of the function + * @param array $keys Optional list of keys + * @param array $args Optional list of args + * + * @return mixed Function may return arbitrary data so this method can return strings, arrays, nested arrays, etc. + * + * @link https://redis.io/commands/fcall_ro + */ + public function fcall_ro($fn, $keys = [], $args = []) {} + + /** + * Functions is an API for managing code to be executed on the server. + * + * @param string $operation The subcommand you intend to execute. Valid options are as follows + * 'LOAD' - Create a new library with the given library name and code. + * 'DELETE' - Delete the given library. + * 'LIST' - Return general information on all the libraries + * 'STATS' - Return information about the current function running + * 'KILL' - Kill the current running function + * 'FLUSH' - Delete all the libraries + * 'DUMP' - Return a serialized payload representing the current libraries + * 'RESTORE' - Restore the libraries represented by the given payload + * @param mixed $args Additional arguments + * + * @return Redis|bool|string|array Depends on subcommand. + * + * @link https://redis.io/commands/function + */ + public function function($operation, ...$args) {} + + /** + * A readonly variant of `GEORADIUS` that may be executed on replicas. + * + * @param string $key + * @param float $lng + * @param float $lat + * @param float $radius + * @param string $unit + * @param mixed[] $options + * + * @return mixed + * @see georadius() + */ + public function georadius_ro($key, $lng, $lat, $radius, $unit, $options = []) {} + + /** + * This is the read-only variant of `GEORADIUSBYMEMBER` that can be run on replicas. + * + * @param string $key + * @param string $member + * @param float $radius + * @param string $unit + * @param mixed[] $options + * + * @return mixed + * + * @see georadiusbymember() + */ + public function georadiusbymember_ro($key, $member, $radius, $unit, $options = []) {} + + /** + * Get the value of a key and optionally set it's expiration. + * + * @param string $key The key to query + * @param array $options Options to modify how the command works. + * 'EX' => # Expire in N seconds + * 'PX' => # Expire in N milliseconds + * 'EXAT' => # Expire at a unix timestamp (in seconds) + * 'PXAT' => # Expire at a unix timestamp (in milliseconds); + * 'PERSIST' # Remove any configured expiration on the key. + * + * @return string|bool|Redis The key's value or false if it didn't exist. + * + * @see https://redis.io/comands/getex + * + * @example $redis->getEx('mykey', ['EX' => 60]); + */ + public function getEx($key, $options = []) {} + + /** + * Get a key from Redis and delete it in an atomic operation. + * + * @param string $key The key to get/delete. + * + * @return Redis|string|bool The value of the key or false if it didn't exist. + * + * @see https://redis.io/commands/getdel + * + * @example $redis->getDel('token:123'); + */ + public function getDel($key) {} + + /** + * Get the longest common subsequence between two string keys. + * + * @param string $key1 The first key to check + * @param string $key2 The second key to check + * @param array|null $options An optional array of modifiers for the comand. + * 'MINMATCHLEN' => int # Exclude matching substrings that are less than this value + * 'WITHMATCHLEN' => bool # Whether each match should also include its length. + * 'LEN' # Return the length of the longest subsequence + * 'IDX' # Each returned match will include the indexes where the + * # match occurs in each string. + * NOTE: 'LEN' cannot be used with 'IDX'. + * + * @return Redis|string|array|int|false Various reply types depending on options. + * + * @link https://redis.io/commands/lcs + * + * @example + * $redis->set('seq1', 'gtaggcccgcacggtctttaatgtatccctgtttaccatgccatacctgagcgcatacgc'); + * $redis->set('seq2', 'aactcggcgcgagtaccaggccaaggtcgttccagagcaaagactcgtgccccgctgagc'); + * echo $redis->lcs('seq1', 'seq2') . "\n"; + */ + public function lcs($key1, $key2, $options = null) {} + + /** + * Get the number of bytes sent and received on the socket. + * + * @return array An array in the form [$sent_bytes, $received_bytes] + */ + public function getTransferredBytes() {} + + /** + * Reset the number of bytes sent and received on the socket. + * + * @return void + */ + public function clearTransferredBytes() {} + + /** + * Get one or more random field from a hash. + * + * @param string $key The hash to query. + * @param array|null $options An array of options to modify how the command behaves. + * 'COUNT' => int # An optional number of fields to return. + * 'WITHVALUES' => bool # Also return the field values. + * + * @return Redis|array|string One or more random fields (and possibly values). + * + * @see https://redis.io/commands/hrandfield + * + * @example + * $redis->hRandField('settings'); + * $redis->hRandField('settings', ['count' => 2, 'withvalues' => true]); + */ + public function hRandField($key, $options = null) {} + + /** + * Move an element from one list into another. + * + * @param string $src The source list. + * @param string $dst The destination list + * @param string $wherefrom Where in the source list to retrieve the element. This can be either + * - `Redis::LEFT`, or `Redis::RIGHT`. + * @param string $whereto Where in the destination list to put the element. This can be either + * - `Redis::LEFT`, or `Redis::RIGHT`. + * + * @return Redis|string|false The element removed from the source list. + * + * @example + * $redis->rPush('numbers', 'one', 'two', 'three'); + * $redis->lMove('numbers', 'odds', Redis::LEFT, Redis::LEFT); + */ + public function lMove($src, $dst, $wherefrom, $whereto) {} + + /** + * Move an element from one list to another, blocking up to a timeout until an element is available. + * + * @param string $src The source list + * @param string $dst The destination list + * @param string $wherefrom Where in the source list to extract the element. - `Redis::LEFT`, or `Redis::RIGHT`. + * @param string $whereto Where in the destination list to put the element.- `Redis::LEFT`, or `Redis::RIGHT`. + * @param float $timeout How long to block for an element. + * + * @return Redis|string|false; + * + * @example + * @redis->lPush('numbers', 'one'); + * @redis->blmove('numbers', 'odds', Redis::LEFT, Redis::LEFT 1.0); + * // This call will block, if no additional elements are in 'numbers' + * @redis->blmove('numbers', 'odds', Redis::LEFT, Redis::LEFT, 1.0); + */ + public function blmove($src, $dst, $wherefrom, $whereto, $timeout) {} + + /** + * Retrieve the index of an element in a list. + * + * @param string $key The list to query. + * @param mixed $value The value to search for. + * @param array|null $options Options to configure how the command operates + * # How many matches to return. By default a single match is returned. + * # If count is set to zero, it means unlimited. + * 'COUNT' => + * + * # Specify which match you want returned. `RANK` 1 means "the first match" + * # 2 means the second, and so on. If passed as a negative number the + * # RANK is computed right to left, so a `RANK` of -1 means "the last match". + * 'RANK' => + * + * # This argument allows you to limit how many elements Redis will search before + * # returning. This is useful to prevent Redis searching very long lists while + * # blocking the client. + * 'MAXLEN => + * + * @return Redis|null|bool|int|array Returns one or more of the matching indexes, or null/false if none were found. + */ + public function lPos($key, $value, $options = null) {} + + /** + * Reset the state of the connection. + * + * @return Redis|bool Should always return true unless there is an error. + */ + public function reset() {} + + /** + * Compute the intersection of one or more sets and return the cardinality of the result. + * + * @param array $keys One or more set key names. + * @param int $limit A maximum cardinality to return. This is useful to put an upper bound on the amount of work Redis will do. + * + * @return Redis|int|false + * + * @link https://redis.io/commands/sintercard + * + * @example + * $redis->sAdd('set1', 'apple', 'pear', 'banana', 'carrot'); + * $redis->sAdd('set2', 'apple', 'banana'); + * $redis->sAdd('set3', 'pear', 'banana'); + * + * $redis->sInterCard(['set1', 'set2', 'set3']); + */ + public function sInterCard($keys, $limit = -1) {} + + /** + * Used to turn a Redis instance into a replica of another, or to remove + * replica status promoting the instance to a primary. + * + * @link https://redis.io/commands/replicaof + * @link https://redis.io/commands/slaveof + * @see slaveof() + * + * @param string|null $host The host of the primary to start replicating. + * @param int $port The port of the primary to start replicating. + * + * @return Redis|bool Success if we were successfully able to start replicating a primary or + * were able to promote teh replicat to a primary. + * + * @example + * $redis = new Redis(['host' => 'localhost']); + * + * // Attempt to become a replica of a Redis instance at 127.0.0.1:9999 + * $redis->replicaof('127.0.0.1', 9999); + * + * // When passed no arguments, PhpRedis will deliver the command `REPLICAOF NO ONE` + * // attempting to promote the instance to a primary. + * $redis->replicaof(); + */ + public function replicaof($host = null, $port = 6379) {} + + /** + * Update one or more keys last modified metadata. + * + * @link https://redis.io/commands/touch/ + * + * @param array|string $key_or_array Either the first key or if passed as the only argument an array of keys. + * @param string ...$more_keys One or more keys to send to the command. + * + * @return Redis|int|false This command returns the number of keys that exist and had their last modified time reset + */ + public function touch($key_or_array, ...$more_keys) {} + + /** + * This is simply a read-only variant of the sort command + * + * @param string $key + * @param mixed[]|null $options + * + * @return mixed + * @see sort() + */ + public function sort_ro($key, $options = null) {} + + /** + * Subscribes the client to the specified shard channels. + * + * @param array $channels One or more channel names. + * @param callable $cb The callback PhpRedis will invoke when we receive a message from one of the subscribed channels. + * + * @return bool True on success, false on faiilure. Note that this command will block the + * client in a subscribe loop, waiting for messages to arrive. + * + * @link https://redis.io/commands/ssubscribe + * + * @example + * $redis = new Redis(['host' => 'localhost']); + * + * $redis->ssubscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) { + * echo "[$channel]: $message\n"; + * + * // Unsubscribe from the message channel when we read 'quit' + * if ($message == 'quit') { + * echo "Unsubscribing from '$channel'\n"; + * $redis->sunsubscribe([$channel]); + * } + * }); + * + * // Once we read 'quit' from both channel-1 and channel-2 the subscribe loop will be + * // broken and this command will execute. + * echo "Subscribe loop ended\n"; + */ + public function ssubscribe($channels, $cb) {} + + /** + * Unsubscribes the client from the given shard channels, + * or from all of them if none is given. + * + * @param array $channels One or more channels to unsubscribe from. + * + * @return Redis|array|bool The array of unsubscribed channels. + * + * @link https://redis.io/commands/sunsubscribe + * @see ssubscribe() + * + * @example + * $redis->ssubscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) { + * if ($message == 'quit') { + * echo "$channel => 'quit' detected, unsubscribing!\n"; + * $redis->sunsubscribe([$channel]); + * } else { + * echo "$channel => $message\n"; + * } + * }); + * + * echo "We've unsubscribed from both channels, exiting\n"; + */ + public function sunsubscribe($channels) {} + + /** + * This command allows a consumer to claim pending messages that have been idle for a specified period of time. + * Its purpose is to provide a mechanism for picking up messages that may have had a failed consumer. + * + * @link https://redis.io/commands/xautoclaim + * @link https://redis.io/commands/xclaim + * @link https://redis.io/docs/data-types/streams-tutorial/ + * + * @param string $key The stream to check. + * @param string $group The consumer group to query. + * @param string $consumer Which consumer to check. + * @param int $min_idle The minimum time in milliseconds for the message to have been pending. + * @param string $start The minimum message id to check. + * @param int $count An optional limit on how many messages are returned. + * @param bool $justid If the client only wants message IDs and not all of their data. + * + * @return Redis|array|bool An array of pending IDs or false if there are none, or on failure. + * + * @example + * $redis->xGroup('CREATE', 'ships', 'combatants', '0-0', true); + * + * $redis->xAdd('ships', '1424-74205', ['name' => 'Defiant']); + * + * // Consume the ['name' => 'Defiant'] message + * $msgs = $redis->xReadGroup('combatants', "Jem'Hadar", ['ships' => '>'], 1); + * + * // The "Jem'Hadar" consumer has the message presently + * $pending = $redis->xPending('ships', 'combatants'); + * var_dump($pending); + * + * // Asssume control of the pending message with a different consumer. + * $res = $redis->xAutoClaim('ships', 'combatants', 'Sisko', 0, '0-0'); + * + * // Now the 'Sisko' consumer owns the message + * $pending = $redis->xPending('ships', 'combatants'); + * var_dump($pending); + */ + public function xAutoClaim($key, $group, $consumer, $min_idle, $start, $count = -1, $justid = false) {} + + /** + * Count the number of elements in a sorted set whos members fall within the provided + * lexographical range. + * + * @param string $key The sorted set to check. + * @param string $min The minimum matching lexographical string + * @param string $max The maximum matching lexographical string + * + * @return Redis|int|false The number of members that fall within the range or false on failure. + * + * @link https://redis.io/commands/zlexcount + * + * @example + * $redis->zAdd('captains', 0, 'Janeway', 0, 'Kirk', 0, 'Picard', 0, 'Sisko', 0, 'Archer'); + * $redis->zLexCount('captains', '[A', '[S'); + */ + public function zLexCount($key, $min, $max) {} + + /** + * This command is similar to ZRANGE except that instead of returning the values directly + * it will store them in a destination key provided by the user + * + * @param string $dstkey The key to store the resulting element(s) + * @param string $srckey The source key with element(s) to retrieve + * @param string $start The starting index to store + * @param string $end The ending index to store + * @param array|bool|null $options Our options array that controls how the command will function. + * + * @return Redis|int|false The number of elements stored in $dstkey or false on failure. + * + * @see https://redis.io/commands/zrange/ + * @see Redis::zRange for a full description of the possible options. + */ + public function zrangestore($dstkey, $srckey, $start, $end, $options = null) {} + + /** + * Store the difference of one or more sorted sets in a destination sorted set. + * + * @param string $dst The destination set name. + * @param array $keys One or more source key names + * + * @return Redis|int|false The number of elements stored in the destination set or false on failure. + * + * @see zDiff() + * @link https://redis.io/commands/zdiff + */ + public function zDiffStore($dst, $keys) {} + + /** + * Similar to ZINTER but instead of returning the intersected values, this command returns the + * cardinality of the intersected set. + * + * @link https://redis.io/commands/zintercard + * @link https://redis.io/commands/zinter + * @see zInter() + * + * @param array $keys One ore more sorted set key names. + * @param int $limit An optional upper bound on the returned cardinality. If set to a value + * greater than zero, Redis will stop processing the intersection once the + * resulting cardinality reaches this limit. + * + * @return Redis|int|false The cardinality of the intersection or false on failure. + * + * @example + * $redis->zAdd('zs1', 1, 'one', 2, 'two', 3, 'three', 4, 'four'); + * $redis->zAdd('zs2', 2, 'two', 4, 'four'); + * + * $redis->zInterCard(['zs1', 'zs2']); + */ + public function zInterCard($keys, $limit = -1) {} } class RedisException extends Exception {} From 10b26e186e30d57aca9013bdc2b94426b0a655d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Fri, 3 Feb 2023 20:32:44 +0100 Subject: [PATCH 284/419] cs --- redis/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.php b/redis/Redis.php index 588f54c5d..a2b0d09d2 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -5298,7 +5298,7 @@ public function xAck($stream, $group, $messages) {} * $redis->xAdd('mystream', "*", ['field' => 'value'], 10, true); * */ - public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) {} + public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false, $nomkstream = false) {} /** * This method allows a consumer to take ownership of pending stream entries, by ID. Another From c8efa5bf6f1ab12ad3e9875e8b888f025b8c4648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Fri, 3 Feb 2023 20:54:29 +0100 Subject: [PATCH 285/419] Fix resetStat() replacement --- redis/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.php b/redis/Redis.php index a2b0d09d2..5f593c8d2 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -2996,7 +2996,7 @@ public function role() {} * @example $redis->resetStat(); * @link https://redis.io/commands/config-resetstat */ - #[Deprecated(replacement: '%class%->rawCommand(\'CONFIG\', \'RESETSTAT\');')] + #[Deprecated(replacement: "%class%->rawCommand('CONFIG', 'RESETSTAT');")] public function resetStat() {} /** From fc6d28c3aaf97f0e42a2f211f4c1c543c95cb2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Fri, 3 Feb 2023 20:55:31 +0100 Subject: [PATCH 286/419] Update Redis.php --- redis/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.php b/redis/Redis.php index 5f593c8d2..a2b4a1104 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -2996,7 +2996,7 @@ public function role() {} * @example $redis->resetStat(); * @link https://redis.io/commands/config-resetstat */ - #[Deprecated(replacement: "%class%->rawCommand('CONFIG', 'RESETSTAT');")] + #[Deprecated(replacement: "%class%->rawCommand('CONFIG', 'RESETSTAT')")] public function resetStat() {} /** From 9b6d4b19e949696d766a3b605c6076e076af01ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Sat, 4 Feb 2023 00:31:40 +0100 Subject: [PATCH 287/419] Fix docblock --- redis/Redis.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index a2b4a1104..8fa164575 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -6029,12 +6029,12 @@ public function lMove($src, $dst, $wherefrom, $whereto) {} * @return Redis|string|false; * * @example - * @redis->lPush('numbers', 'one'); - * @redis->blmove('numbers', 'odds', Redis::LEFT, Redis::LEFT 1.0); + * $redis->lPush('numbers', 'one'); + * $redis->bLmove('numbers', 'odds', Redis::LEFT, Redis::LEFT 1.0); * // This call will block, if no additional elements are in 'numbers' - * @redis->blmove('numbers', 'odds', Redis::LEFT, Redis::LEFT, 1.0); + * $redis->bLmove('numbers', 'odds', Redis::LEFT, Redis::LEFT, 1.0); */ - public function blmove($src, $dst, $wherefrom, $whereto, $timeout) {} + public function bLmove($src, $dst, $wherefrom, $whereto, $timeout) {} /** * Retrieve the index of an element in a list. @@ -6262,7 +6262,7 @@ public function zLexCount($key, $min, $max) {} * @see https://redis.io/commands/zrange/ * @see Redis::zRange for a full description of the possible options. */ - public function zrangestore($dstkey, $srckey, $start, $end, $options = null) {} + public function zRangeStore($dstkey, $srckey, $start, $end, $options = null) {} /** * Store the difference of one or more sorted sets in a destination sorted set. From b7d6fdbb03d62cc688d9f88752b9f807f79b139a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Sat, 4 Feb 2023 00:34:41 +0100 Subject: [PATCH 288/419] Update Redis.php --- redis/Redis.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index 8fa164575..4d992f6bb 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -6030,11 +6030,11 @@ public function lMove($src, $dst, $wherefrom, $whereto) {} * * @example * $redis->lPush('numbers', 'one'); - * $redis->bLmove('numbers', 'odds', Redis::LEFT, Redis::LEFT 1.0); + * $redis->blmove('numbers', 'odds', Redis::LEFT, Redis::LEFT 1.0); * // This call will block, if no additional elements are in 'numbers' - * $redis->bLmove('numbers', 'odds', Redis::LEFT, Redis::LEFT, 1.0); + * $redis->blmove('numbers', 'odds', Redis::LEFT, Redis::LEFT, 1.0); */ - public function bLmove($src, $dst, $wherefrom, $whereto, $timeout) {} + public function blmove($src, $dst, $wherefrom, $whereto, $timeout) {} /** * Retrieve the index of an element in a list. From af7ceae9bcbaebbd0a0b2fd9ebef5b8bc0154df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Sat, 4 Feb 2023 13:19:19 +0100 Subject: [PATCH 289/419] Downgrade phpunit to 9 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0dad9a11b..bf747709d 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "php": "^8.0", "nikic/php-parser": "@stable", "phpdocumentor/reflection-docblock": "@stable", - "phpunit/phpunit": "@stable", + "phpunit/phpunit": "^9.6", "friendsofphp/php-cs-fixer": "@stable" }, "autoload": { From ac94ef6480031d3713f904d31dedda111ab7a006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Kel=C4=8D=C3=A1k?= Date: Sat, 4 Feb 2023 13:33:10 +0100 Subject: [PATCH 290/419] Add @since for new methods --- redis/Redis.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/redis/Redis.php b/redis/Redis.php index 4d992f6bb..9fecfcaa5 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -5685,6 +5685,7 @@ public function acl($subcmd, ...$args) {} * depending on whether any elements could be popped within the specified timeout. * * NOTE: If Redis::OPT_NULL_MULTIBULK_AS_NULL is set to true via Redis::setOption(), this method will instead return NULL when Redis doesn't pop any elements. + * @since phpredis 6.0 */ public function bzmpop($timeout, $keys, $from, $count = 1) {} @@ -5698,6 +5699,7 @@ public function bzmpop($timeout, $keys, $from, $count = 1) {} * @param int $count Pop up to how many elements at once. * * @return array|null|false|Redis An array of popped elements or false if none could be popped. + * @since phpredis 6.0 */ public function zmpop($keys, $from, $count = 1) {} @@ -5712,6 +5714,7 @@ public function zmpop($keys, $from, $count = 1) {} * @param int $count Pop up to how many elements at once. * * @return array|null|false|Redis One or more elements popped from the list(s) or false if all LISTs were empty. + * @since phpredis 6.0 */ public function blmpop($timeout, $keys, $from, $count = 1) {} @@ -5725,6 +5728,8 @@ public function blmpop($timeout, $keys, $from, $count = 1) {} * @param int $count The maximum number of elements to pop at once. * * @return array|null|false|Redis One or more elements popped from the LIST(s) or false if all the LISTs were empty. + * + * @since phpredis 6.0 */ public function lmpop($keys, $from, $count = 1) {} @@ -5750,6 +5755,7 @@ public function command($opt = null, ...$args) {} * @return bool|Redis True if the copy was completed and false if not. * * @link https://redis.io/commands/copy + * @since phpredis 6.0 * * @example * $redis->pipeline() @@ -5784,6 +5790,7 @@ public function debug($key) {} * @return mixed * * @see eval() + * @since phpredis 6.0 */ public function eval_ro($script_sha, $args = [], $num_keys = 0) {} @@ -5796,6 +5803,7 @@ public function eval_ro($script_sha, $args = [], $num_keys = 0) {} * * @return mixed * @see evalsha() + * @since phpredis 6.0 */ public function evalsha_ro($sha1, $args = [], $num_keys = 0) {} @@ -5805,6 +5813,7 @@ public function evalsha_ro($sha1, $args = [], $num_keys = 0) {} * @param int $timeout * * @return bool|Redis + * @since phpredis 6.0 */ public function failover($to = null, $abort = false, $timeout = 0) {} @@ -5816,6 +5825,7 @@ public function failover($to = null, $abort = false, $timeout = 0) {} * @return int|false|Redis The timestamp when the key expires, or -1 if the key has no expiry and -2 if the key doesn't exist. * * @link https://redis.io/commands/expiretime + * @since phpredis 6.0 * * @example * $redis->setEx('mykey', 60, 'myval'); @@ -5830,6 +5840,7 @@ public function expiretime($key) {} * * @link https://redis.io/commands/pexpiretime * @see expiretime() + * @since phpredis 6.0 * * @return int|false|Redis The expiration timestamp of this key (in milliseconds) or -1 if the key has no expiration, and -2 if it does not exist. */ @@ -5845,6 +5856,7 @@ public function pexpiretime($key) {} * @return mixed Function may return arbitrary data so this method can return strings, arrays, nested arrays, etc. * * @link https://redis.io/commands/fcall + * @since phpredis 6.0 */ public function fcall($fn, $keys = [], $args = []) {} @@ -5858,6 +5870,7 @@ public function fcall($fn, $keys = [], $args = []) {} * @return mixed Function may return arbitrary data so this method can return strings, arrays, nested arrays, etc. * * @link https://redis.io/commands/fcall_ro + * @since phpredis 6.0 */ public function fcall_ro($fn, $keys = [], $args = []) {} @@ -5878,6 +5891,7 @@ public function fcall_ro($fn, $keys = [], $args = []) {} * @return Redis|bool|string|array Depends on subcommand. * * @link https://redis.io/commands/function + * @since phpredis 6.0 */ public function function($operation, ...$args) {} @@ -5925,6 +5939,7 @@ public function georadiusbymember_ro($key, $member, $radius, $unit, $options = [ * @return string|bool|Redis The key's value or false if it didn't exist. * * @see https://redis.io/comands/getex + * @since phpredis 6.0 * * @example $redis->getEx('mykey', ['EX' => 60]); */ @@ -5938,6 +5953,7 @@ public function getEx($key, $options = []) {} * @return Redis|string|bool The value of the key or false if it didn't exist. * * @see https://redis.io/commands/getdel + * @since phpredis 6.0 * * @example $redis->getDel('token:123'); */ @@ -5959,6 +5975,7 @@ public function getDel($key) {} * @return Redis|string|array|int|false Various reply types depending on options. * * @link https://redis.io/commands/lcs + * @since phpredis 6.0 * * @example * $redis->set('seq1', 'gtaggcccgcacggtctttaatgtatccctgtttaccatgccatacctgagcgcatacgc'); @@ -5971,11 +5988,13 @@ public function lcs($key1, $key2, $options = null) {} * Get the number of bytes sent and received on the socket. * * @return array An array in the form [$sent_bytes, $received_bytes] + * @since phpredis 6.0 */ public function getTransferredBytes() {} /** * Reset the number of bytes sent and received on the socket. + * @since phpredis 6.0 * * @return void */ @@ -5992,6 +6011,7 @@ public function clearTransferredBytes() {} * @return Redis|array|string One or more random fields (and possibly values). * * @see https://redis.io/commands/hrandfield + * @since phpredis 6.0 * * @example * $redis->hRandField('settings'); @@ -6010,6 +6030,7 @@ public function hRandField($key, $options = null) {} * - `Redis::LEFT`, or `Redis::RIGHT`. * * @return Redis|string|false The element removed from the source list. + * @since phpredis 6.0 * * @example * $redis->rPush('numbers', 'one', 'two', 'three'); @@ -6027,6 +6048,7 @@ public function lMove($src, $dst, $wherefrom, $whereto) {} * @param float $timeout How long to block for an element. * * @return Redis|string|false; + * @since phpredis 6.0 * * @example * $redis->lPush('numbers', 'one'); @@ -6057,6 +6079,7 @@ public function blmove($src, $dst, $wherefrom, $whereto, $timeout) {} * 'MAXLEN => * * @return Redis|null|bool|int|array Returns one or more of the matching indexes, or null/false if none were found. + * @since phpredis 6.0 */ public function lPos($key, $value, $options = null) {} @@ -6064,6 +6087,7 @@ public function lPos($key, $value, $options = null) {} * Reset the state of the connection. * * @return Redis|bool Should always return true unless there is an error. + * @since phpredis 6.0 */ public function reset() {} @@ -6076,6 +6100,7 @@ public function reset() {} * @return Redis|int|false * * @link https://redis.io/commands/sintercard + * @since phpredis 6.0 * * @example * $redis->sAdd('set1', 'apple', 'pear', 'banana', 'carrot'); @@ -6093,6 +6118,7 @@ public function sInterCard($keys, $limit = -1) {} * @link https://redis.io/commands/replicaof * @link https://redis.io/commands/slaveof * @see slaveof() + * @since phpredis 6.0 * * @param string|null $host The host of the primary to start replicating. * @param int $port The port of the primary to start replicating. @@ -6121,6 +6147,7 @@ public function replicaof($host = null, $port = 6379) {} * @param string ...$more_keys One or more keys to send to the command. * * @return Redis|int|false This command returns the number of keys that exist and had their last modified time reset + * @since phpredis 6.0 */ public function touch($key_or_array, ...$more_keys) {} @@ -6132,6 +6159,7 @@ public function touch($key_or_array, ...$more_keys) {} * * @return mixed * @see sort() + * @since phpredis 6.0 */ public function sort_ro($key, $options = null) {} @@ -6145,6 +6173,7 @@ public function sort_ro($key, $options = null) {} * client in a subscribe loop, waiting for messages to arrive. * * @link https://redis.io/commands/ssubscribe + * @since phpredis 6.0 * * @example * $redis = new Redis(['host' => 'localhost']); @@ -6175,6 +6204,7 @@ public function ssubscribe($channels, $cb) {} * * @link https://redis.io/commands/sunsubscribe * @see ssubscribe() + * @since phpredis 6.0 * * @example * $redis->ssubscribe(['channel-1', 'channel-2'], function ($redis, $channel, $message) { @@ -6197,6 +6227,7 @@ public function sunsubscribe($channels) {} * @link https://redis.io/commands/xautoclaim * @link https://redis.io/commands/xclaim * @link https://redis.io/docs/data-types/streams-tutorial/ + * @since phpredis 6.0 * * @param string $key The stream to check. * @param string $group The consumer group to query. @@ -6261,6 +6292,7 @@ public function zLexCount($key, $min, $max) {} * * @see https://redis.io/commands/zrange/ * @see Redis::zRange for a full description of the possible options. + * @since phpredis 6.0 */ public function zRangeStore($dstkey, $srckey, $start, $end, $options = null) {} @@ -6274,6 +6306,7 @@ public function zRangeStore($dstkey, $srckey, $start, $end, $options = null) {} * * @see zDiff() * @link https://redis.io/commands/zdiff + * @since phpredis 6.0 */ public function zDiffStore($dst, $keys) {} @@ -6291,6 +6324,7 @@ public function zDiffStore($dst, $keys) {} * resulting cardinality reaches this limit. * * @return Redis|int|false The cardinality of the intersection or false on failure. + * @since phpredis 6.0 * * @example * $redis->zAdd('zs1', 1, 'one', 2, 'two', 3, 'three', 4, 'four'); From 7580d0161866ae5a4d289fabc1f982a23bc727e4 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 2 Feb 2023 10:23:07 +0100 Subject: [PATCH 291/419] Split MongoDB stubs into separate files --- PhpStormStubsMap.php | 142 +- mongodb/BSON/Binary.php | 87 + mongodb/BSON/BinaryInterface.php | 29 + mongodb/BSON/DBPointer.php | 58 + mongodb/BSON/Decimal128.php | 59 + mongodb/BSON/Decimal128Interface.php | 17 + mongodb/BSON/Int64.php | 56 + mongodb/BSON/Javascript.php | 74 + mongodb/BSON/JavascriptInterface.php | 36 + mongodb/BSON/MaxKey.php | 45 + mongodb/BSON/MaxKeyInterface.php | 9 + mongodb/BSON/MinKey.php | 45 + mongodb/BSON/MinKeyInterface.php | 9 + mongodb/BSON/ObjectId.php | 62 + mongodb/BSON/ObjectIdInterface.php | 23 + mongodb/BSON/Persistable.php | 9 + mongodb/BSON/Regex.php | 73 + mongodb/BSON/RegexInterface.php | 29 + mongodb/BSON/Serializable.php | 20 + mongodb/BSON/Symbol.php | 54 + mongodb/BSON/Timestamp.php | 76 + mongodb/BSON/TimestampInterface.php | 36 + mongodb/BSON/Type.php | 9 + mongodb/BSON/UTCDateTime.php | 66 + mongodb/BSON/UTCDateTimeInterface.php | 25 + mongodb/BSON/Undefined.php | 54 + mongodb/BSON/Unserializable.php | 19 + mongodb/BSON/functions.php | 73 + mongodb/BulkWrite.php | 66 + mongodb/ClientEncryption.php | 53 + mongodb/Command.php | 27 + mongodb/Cursor.php | 107 + mongodb/CursorId.php | 53 + mongodb/CursorInterface.php | 56 + mongodb/Exception/AuthenticationException.php | 10 + mongodb/Exception/BulkWriteException.php | 10 + mongodb/Exception/CommandException.php | 22 + mongodb/Exception/ConnectionException.php | 10 + .../Exception/ConnectionTimeoutException.php | 9 + mongodb/Exception/EncryptionException.php | 10 + mongodb/Exception/Exception.php | 11 + .../Exception/ExecutionTimeoutException.php | 9 + .../Exception/InvalidArgumentException.php | 10 + mongodb/Exception/LogicException.php | 9 + mongodb/Exception/RuntimeException.php | 26 + mongodb/Exception/SSLConnectionException.php | 9 + mongodb/Exception/ServerException.php | 12 + .../Exception/UnexpectedValueException.php | 10 + mongodb/Exception/WriteConcernException.php | 5 + mongodb/Exception/WriteException.php | 25 + mongodb/Manager.php | 199 ++ mongodb/Monitoring/CommandFailedEvent.php | 82 + mongodb/Monitoring/CommandStartedEvent.php | 72 + mongodb/Monitoring/CommandSubscriber.php | 45 + mongodb/Monitoring/CommandSucceededEvent.php | 73 + mongodb/Monitoring/Subscriber.php | 12 + mongodb/Monitoring/functions.php | 26 + mongodb/Query.php | 24 + mongodb/ReadConcern.php | 82 + mongodb/ReadPreference.php | 130 + mongodb/Server.php | 247 ++ mongodb/Session.php | 177 + mongodb/WriteConcern.php | 83 + mongodb/WriteConcernError.php | 35 + mongodb/WriteError.php | 41 + mongodb/WriteResult.php | 84 + mongodb/mongodb.php | 2860 +---------------- 67 files changed, 3195 insertions(+), 2930 deletions(-) create mode 100644 mongodb/BSON/Binary.php create mode 100644 mongodb/BSON/BinaryInterface.php create mode 100644 mongodb/BSON/DBPointer.php create mode 100644 mongodb/BSON/Decimal128.php create mode 100644 mongodb/BSON/Decimal128Interface.php create mode 100644 mongodb/BSON/Int64.php create mode 100644 mongodb/BSON/Javascript.php create mode 100644 mongodb/BSON/JavascriptInterface.php create mode 100644 mongodb/BSON/MaxKey.php create mode 100644 mongodb/BSON/MaxKeyInterface.php create mode 100644 mongodb/BSON/MinKey.php create mode 100644 mongodb/BSON/MinKeyInterface.php create mode 100644 mongodb/BSON/ObjectId.php create mode 100644 mongodb/BSON/ObjectIdInterface.php create mode 100644 mongodb/BSON/Persistable.php create mode 100644 mongodb/BSON/Regex.php create mode 100644 mongodb/BSON/RegexInterface.php create mode 100644 mongodb/BSON/Serializable.php create mode 100644 mongodb/BSON/Symbol.php create mode 100644 mongodb/BSON/Timestamp.php create mode 100644 mongodb/BSON/TimestampInterface.php create mode 100644 mongodb/BSON/Type.php create mode 100644 mongodb/BSON/UTCDateTime.php create mode 100644 mongodb/BSON/UTCDateTimeInterface.php create mode 100644 mongodb/BSON/Undefined.php create mode 100644 mongodb/BSON/Unserializable.php create mode 100644 mongodb/BSON/functions.php create mode 100644 mongodb/BulkWrite.php create mode 100644 mongodb/ClientEncryption.php create mode 100644 mongodb/Command.php create mode 100644 mongodb/Cursor.php create mode 100644 mongodb/CursorId.php create mode 100644 mongodb/CursorInterface.php create mode 100644 mongodb/Exception/AuthenticationException.php create mode 100644 mongodb/Exception/BulkWriteException.php create mode 100644 mongodb/Exception/CommandException.php create mode 100644 mongodb/Exception/ConnectionException.php create mode 100644 mongodb/Exception/ConnectionTimeoutException.php create mode 100644 mongodb/Exception/EncryptionException.php create mode 100644 mongodb/Exception/Exception.php create mode 100644 mongodb/Exception/ExecutionTimeoutException.php create mode 100644 mongodb/Exception/InvalidArgumentException.php create mode 100644 mongodb/Exception/LogicException.php create mode 100644 mongodb/Exception/RuntimeException.php create mode 100644 mongodb/Exception/SSLConnectionException.php create mode 100644 mongodb/Exception/ServerException.php create mode 100644 mongodb/Exception/UnexpectedValueException.php create mode 100644 mongodb/Exception/WriteConcernException.php create mode 100644 mongodb/Exception/WriteException.php create mode 100644 mongodb/Manager.php create mode 100644 mongodb/Monitoring/CommandFailedEvent.php create mode 100644 mongodb/Monitoring/CommandStartedEvent.php create mode 100644 mongodb/Monitoring/CommandSubscriber.php create mode 100644 mongodb/Monitoring/CommandSucceededEvent.php create mode 100644 mongodb/Monitoring/Subscriber.php create mode 100644 mongodb/Monitoring/functions.php create mode 100644 mongodb/Query.php create mode 100644 mongodb/ReadConcern.php create mode 100644 mongodb/ReadPreference.php create mode 100644 mongodb/Server.php create mode 100644 mongodb/Session.php create mode 100644 mongodb/WriteConcern.php create mode 100644 mongodb/WriteConcernError.php create mode 100644 mongodb/WriteError.php create mode 100644 mongodb/WriteResult.php diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index a29986456..a88f2399c 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -626,70 +626,70 @@ final class PhpStormStubsMap 'MongoCursorTimeoutException' => 'mongo/mongo.php', 'MongoDB' => 'mongo/mongo.php', 'MongoDBRef' => 'mongo/mongo.php', - 'MongoDB\\BSON\\Binary' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\BinaryInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\DBPointer' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Decimal128' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Decimal128Interface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Int64' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Javascript' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\JavascriptInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\MaxKey' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\MaxKeyInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\MinKey' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\MinKeyInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\ObjectId' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\ObjectIdInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Persistable' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Regex' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\RegexInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Serializable' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Symbol' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Timestamp' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\TimestampInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Type' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\UTCDateTime' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\UTCDateTimeInterface' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Undefined' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\Unserializable' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\BulkWrite' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\ClientEncryption' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Command' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Cursor' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\CursorId' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\CursorInterface' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\AuthenticationException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\BulkWriteException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\CommandException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\ConnectionException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\ConnectionTimeoutException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\EncryptionException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\Exception' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\ExecutionTimeoutException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\InvalidArgumentException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\LogicException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\RuntimeException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\SSLConnectionException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\ServerException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\UnexpectedValueException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\WriteConcernException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Exception\\WriteException' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Manager' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Monitoring\\CommandFailedEvent' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Monitoring\\CommandStartedEvent' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Monitoring\\CommandSubscriber' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Monitoring\\CommandSucceededEvent' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Monitoring\\Subscriber' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Query' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\ReadConcern' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\ReadPreference' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Server' => 'mongodb/mongodb.php', + 'MongoDB\\BSON\\Binary' => 'mongodb/BSON/Binary.php', + 'MongoDB\\BSON\\BinaryInterface' => 'mongodb/BSON/BinaryInterface.php', + 'MongoDB\\BSON\\DBPointer' => 'mongodb/BSON/DBPointer.php', + 'MongoDB\\BSON\\Decimal128' => 'mongodb/BSON/Decimal128.php', + 'MongoDB\\BSON\\Decimal128Interface' => 'mongodb/BSON/Decimal128Interface.php', + 'MongoDB\\BSON\\Int64' => 'mongodb/BSON/Int64.php', + 'MongoDB\\BSON\\Javascript' => 'mongodb/BSON/Javascript.php', + 'MongoDB\\BSON\\JavascriptInterface' => 'mongodb/BSON/JavascriptInterface.php', + 'MongoDB\\BSON\\MaxKey' => 'mongodb/BSON/MaxKey.php', + 'MongoDB\\BSON\\MaxKeyInterface' => 'mongodb/BSON/MaxKeyInterface.php', + 'MongoDB\\BSON\\MinKey' => 'mongodb/BSON/MinKey.php', + 'MongoDB\\BSON\\MinKeyInterface' => 'mongodb/BSON/MinKeyInterface.php', + 'MongoDB\\BSON\\ObjectId' => 'mongodb/BSON/ObjectId.php', + 'MongoDB\\BSON\\ObjectIdInterface' => 'mongodb/BSON/ObjectIdInterface.php', + 'MongoDB\\BSON\\Persistable' => 'mongodb/BSON/Persistable.php', + 'MongoDB\\BSON\\Regex' => 'mongodb/BSON/Regex.php', + 'MongoDB\\BSON\\RegexInterface' => 'mongodb/BSON/RegexInterface.php', + 'MongoDB\\BSON\\Serializable' => 'mongodb/BSON/Serializable.php', + 'MongoDB\\BSON\\Symbol' => 'mongodb/BSON/Symbol.php', + 'MongoDB\\BSON\\Timestamp' => 'mongodb/BSON/Timestamp.php', + 'MongoDB\\BSON\\TimestampInterface' => 'mongodb/BSON/TimestampInterface.php', + 'MongoDB\\BSON\\Type' => 'mongodb/BSON/Type.php', + 'MongoDB\\BSON\\UTCDateTime' => 'mongodb/BSON/UTCDateTime.php', + 'MongoDB\\BSON\\UTCDateTimeInterface' => 'mongodb/BSON/UTCDateTimeInterface.php', + 'MongoDB\\BSON\\Undefined' => 'mongodb/BSON/Undefined.php', + 'MongoDB\\BSON\\Unserializable' => 'mongodb/BSON/Unserializable.php', + 'MongoDB\\Driver\\BulkWrite' => 'mongodb/BulkWrite.php', + 'MongoDB\\Driver\\ClientEncryption' => 'mongodb/ClientEncryption.php', + 'MongoDB\\Driver\\Command' => 'mongodb/Command.php', + 'MongoDB\\Driver\\Cursor' => 'mongodb/Cursor.php', + 'MongoDB\\Driver\\CursorId' => 'mongodb/CursorId.php', + 'MongoDB\\Driver\\CursorInterface' => 'mongodb/CursorInterface.php', + 'MongoDB\\Driver\\Exception\\AuthenticationException' => 'mongodb/Exception/AuthenticationException.php', + 'MongoDB\\Driver\\Exception\\BulkWriteException' => 'mongodb/Exception/BulkWriteException.php', + 'MongoDB\\Driver\\Exception\\CommandException' => 'mongodb/Exception/CommandException.php', + 'MongoDB\\Driver\\Exception\\ConnectionException' => 'mongodb/Exception/ConnectionException.php', + 'MongoDB\\Driver\\Exception\\ConnectionTimeoutException' => 'mongodb/Exception/ConnectionTimeoutException.php', + 'MongoDB\\Driver\\Exception\\EncryptionException' => 'mongodb/Exception/EncryptionException.php', + 'MongoDB\\Driver\\Exception\\Exception' => 'mongodb/Exception/Exception.php', + 'MongoDB\\Driver\\Exception\\ExecutionTimeoutException' => 'mongodb/Exception/ExecutionTimeoutException.php', + 'MongoDB\\Driver\\Exception\\InvalidArgumentException' => 'mongodb/Exception/InvalidArgumentException.php', + 'MongoDB\\Driver\\Exception\\LogicException' => 'mongodb/Exception/LogicException.php', + 'MongoDB\\Driver\\Exception\\RuntimeException' => 'mongodb/Exception/RuntimeException.php', + 'MongoDB\\Driver\\Exception\\SSLConnectionException' => 'mongodb/Exception/SSLConnectionException.php', + 'MongoDB\\Driver\\Exception\\ServerException' => 'mongodb/Exception/ServerException.php', + 'MongoDB\\Driver\\Exception\\UnexpectedValueException' => 'mongodb/Exception/UnexpectedValueException.php', + 'MongoDB\\Driver\\Exception\\WriteConcernException' => 'mongodb/Exception/WriteConcernException.php', + 'MongoDB\\Driver\\Exception\\WriteException' => 'mongodb/Exception/WriteException.php', + 'MongoDB\\Driver\\Manager' => 'mongodb/Manager.php', + 'MongoDB\\Driver\\Monitoring\\CommandFailedEvent' => 'mongodb/Monitoring/CommandFailedEvent.php', + 'MongoDB\\Driver\\Monitoring\\CommandStartedEvent' => 'mongodb/Monitoring/CommandStartedEvent.php', + 'MongoDB\\Driver\\Monitoring\\CommandSubscriber' => 'mongodb/Monitoring/CommandSubscriber.php', + 'MongoDB\\Driver\\Monitoring\\CommandSucceededEvent' => 'mongodb/Monitoring/CommandSucceededEvent.php', + 'MongoDB\\Driver\\Monitoring\\Subscriber' => 'mongodb/Monitoring/Subscriber.php', + 'MongoDB\\Driver\\Query' => 'mongodb/Query.php', + 'MongoDB\\Driver\\ReadConcern' => 'mongodb/ReadConcern.php', + 'MongoDB\\Driver\\ReadPreference' => 'mongodb/ReadPreference.php', + 'MongoDB\\Driver\\Server' => 'mongodb/Server.php', 'MongoDB\\Driver\\ServerApi' => 'mongodb/ServerApi.php', - 'MongoDB\\Driver\\Session' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\WriteConcern' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\WriteConcernError' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\WriteError' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\WriteResult' => 'mongodb/mongodb.php', + 'MongoDB\\Driver\\Session' => 'mongodb/Session.php', + 'MongoDB\\Driver\\WriteConcern' => 'mongodb/WriteConcern.php', + 'MongoDB\\Driver\\WriteConcernError' => 'mongodb/WriteConcernError.php', + 'MongoDB\\Driver\\WriteError' => 'mongodb/WriteError.php', + 'MongoDB\\Driver\\WriteResult' => 'mongodb/WriteResult.php', 'MongoDate' => 'mongo/mongo.php', 'MongoDuplicateKeyException' => 'mongo/mongo.php', 'MongoException' => 'mongo/mongo.php', @@ -1348,14 +1348,14 @@ final class PhpStormStubsMap 'GEOSRelateMatch' => 'geos/geos.php', 'GEOSSharedPaths' => 'geos/geos.php', 'GEOSVersion' => 'geos/geos.php', - 'MongoDB\\BSON\\fromJSON' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\fromPHP' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\toCanonicalExtendedJSON' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\toJSON' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\toPHP' => 'mongodb/mongodb.php', - 'MongoDB\\BSON\\toRelaxedExtendedJSON' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Monitoring\\addSubscriber' => 'mongodb/mongodb.php', - 'MongoDB\\Driver\\Monitoring\\removeSubscriber' => 'mongodb/mongodb.php', + 'MongoDB\\BSON\\fromJSON' => 'mongodb/BSON/functions.php', + 'MongoDB\\BSON\\fromPHP' => 'mongodb/BSON/functions.php', + 'MongoDB\\BSON\\toCanonicalExtendedJSON' => 'mongodb/BSON/functions.php', + 'MongoDB\\BSON\\toJSON' => 'mongodb/BSON/functions.php', + 'MongoDB\\BSON\\toPHP' => 'mongodb/BSON/functions.php', + 'MongoDB\\BSON\\toRelaxedExtendedJSON' => 'mongodb/BSON/functions.php', + 'MongoDB\\Driver\\Monitoring\\addSubscriber' => 'mongodb/Monitoring/functions.php', + 'MongoDB\\Driver\\Monitoring\\removeSubscriber' => 'mongodb/Monitoring/functions.php', 'PDF_activate_item' => 'pdflib/PDFlib.php', 'PDF_add_launchlink' => 'pdflib/PDFlib.php', 'PDF_add_locallink' => 'pdflib/PDFlib.php', diff --git a/mongodb/BSON/Binary.php b/mongodb/BSON/Binary.php new file mode 100644 index 000000000..3d4ab6137 --- /dev/null +++ b/mongodb/BSON/Binary.php @@ -0,0 +1,87 @@ + + *
    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    options
    OptionTypeDescription
    readPreferenceMongoDB\Driver\ReadPreference + *

    + * A read preference to use for selecting a server for the operation. + *

    + *
    sessionMongoDB\Driver\Session + *

    + * A session to associate with the operation. + *

    + *
    + * The third parameter is now an options array. For backwards compatibility, this parameter will still accept a MongoDB\Driver\ReadPreference object. + * @throws InvalidArgumentException on argument parsing errors. + * @throws ConnectionException if connection to the server fails (for reasons other than authentication). + * @throws AuthenticationException if authentication is needed and fails. + * @throws RuntimeException on other errors (e.g. invalid command, issuing a write command to a secondary). + * @return Cursor + */ + final public function executeQuery($namespace, Query $zquery, $options = []) {} + + /** + * Returns the hostname of this server + * @link https://php.net/manual/en/mongodb-driver-server.gethost.php + * @throws InvalidArgumentException on argument parsing errors. + * @return string + */ + final public function getHost() {} + + /** + * Returns an array of information about this server + * @link https://php.net/manual/en/mongodb-driver-server.getinfo.php + * @throws InvalidArgumentException on argument parsing errors. + * @return array + */ + final public function getInfo() {} + + /** + * Returns the latency of this server + * @link https://php.net/manual/en/mongodb-driver-server.getlatency.php + * @throws InvalidArgumentException on argument parsing errors. + * @return int + */ + final public function getLatency() {} + + /** + * Returns the port on which this server is listening + * @link https://php.net/manual/en/mongodb-driver-server.getport.php + * @throws InvalidArgumentException on argument parsing errors. + * @return int + */ + final public function getPort() {} + + /** + * Returns an array of tags describing this server in a replica set + * @link https://php.net/manual/en/mongodb-driver-server.gettags.php + * @throws InvalidArgumentException on argument parsing errors. + * @return array An array of tags used to describe this server in a replica set. The array will contain zero or more string key and value pairs. + */ + final public function getTags() {} + + /** + * Returns an integer denoting the type of this server + * @link https://php.net/manual/en/mongodb-driver-server.gettype.php + * @throws InvalidArgumentException on argument parsing errors. + * @return int denoting the type of this server + */ + final public function getType() {} + + /** + * Checks if this server is an arbiter member of a replica set + * @link https://php.net/manual/en/mongodb-driver-server.isarbiter.php + * @throws InvalidArgumentException on argument parsing errors. + * @return bool + */ + final public function isArbiter() {} + + /** + * Checks if this server is a hidden member of a replica set + * @link https://php.net/manual/en/mongodb-driver-server.ishidden.php + * @throws InvalidArgumentException on argument parsing errors. + * @return bool + */ + final public function isHidden() {} + + /** + * Checks if this server is a passive member of a replica set + * @link https://php.net/manual/en/mongodb-driver-server.ispassive.php + * @throws InvalidArgumentException on argument parsing errors. + * @return bool + */ + final public function isPassive() {} + + /** + * Checks if this server is a primary member of a replica set + * @link https://php.net/manual/en/mongodb-driver-server.isprimary.php + * @throws InvalidArgumentException on argument parsing errors. + * @return bool + */ + final public function isPrimary() {} + + /** + * Checks if this server is a secondary member of a replica set + * @link https://php.net/manual/en/mongodb-driver-server.issecondary.php + * @throws InvalidArgumentException on argument parsing errors. + * @return bool + */ + final public function isSecondary() {} +} diff --git a/mongodb/Session.php b/mongodb/Session.php new file mode 100644 index 000000000..5840ff2f7 --- /dev/null +++ b/mongodb/Session.php @@ -0,0 +1,177 @@ + - * options - * - * - * - * Option - * Type - * Description - * - * - * - * - * - * - * - * readPreference - * MongoDB\Driver\ReadPreference - * - *

    - * A read preference to use for selecting a server for the operation. - *

    - * - * - * - * session - * MongoDB\Driver\Session - * - *

    - * A session to associate with the operation. - *

    - * - * - * - * - * The third parameter is now an options array. For backwards compatibility, this parameter will still accept a MongoDB\Driver\ReadPreference object. - * @throws InvalidArgumentException on argument parsing errors. - * @throws ConnectionException if connection to the server fails (for reasons other than authentication). - * @throws AuthenticationException if authentication is needed and fails. - * @throws RuntimeException on other errors (e.g. invalid command, issuing a write command to a secondary). - * @return Cursor - */ - final public function executeQuery($namespace, Query $zquery, $options = []) {} - - /** - * Returns the hostname of this server - * @link https://php.net/manual/en/mongodb-driver-server.gethost.php - * @throws InvalidArgumentException on argument parsing errors. - * @return string - */ - final public function getHost() {} - - /** - * Returns an array of information about this server - * @link https://php.net/manual/en/mongodb-driver-server.getinfo.php - * @throws InvalidArgumentException on argument parsing errors. - * @return array - */ - final public function getInfo() {} - - /** - * Returns the latency of this server - * @link https://php.net/manual/en/mongodb-driver-server.getlatency.php - * @throws InvalidArgumentException on argument parsing errors. - * @return int - */ - final public function getLatency() {} - - /** - * Returns the port on which this server is listening - * @link https://php.net/manual/en/mongodb-driver-server.getport.php - * @throws InvalidArgumentException on argument parsing errors. - * @return int - */ - final public function getPort() {} - - /** - * Returns an array of tags describing this server in a replica set - * @link https://php.net/manual/en/mongodb-driver-server.gettags.php - * @throws InvalidArgumentException on argument parsing errors. - * @return array An array of tags used to describe this server in a replica set. The array will contain zero or more string key and value pairs. - */ - final public function getTags() {} - - /** - * Returns an integer denoting the type of this server - * @link https://php.net/manual/en/mongodb-driver-server.gettype.php - * @throws InvalidArgumentException on argument parsing errors. - * @return int denoting the type of this server - */ - final public function getType() {} - - /** - * Checks if this server is an arbiter member of a replica set - * @link https://php.net/manual/en/mongodb-driver-server.isarbiter.php - * @throws InvalidArgumentException on argument parsing errors. - * @return bool - */ - final public function isArbiter() {} - - /** - * Checks if this server is a hidden member of a replica set - * @link https://php.net/manual/en/mongodb-driver-server.ishidden.php - * @throws InvalidArgumentException on argument parsing errors. - * @return bool - */ - final public function isHidden() {} - - /** - * Checks if this server is a passive member of a replica set - * @link https://php.net/manual/en/mongodb-driver-server.ispassive.php - * @throws InvalidArgumentException on argument parsing errors. - * @return bool - */ - final public function isPassive() {} - - /** - * Checks if this server is a primary member of a replica set - * @link https://php.net/manual/en/mongodb-driver-server.isprimary.php - * @throws InvalidArgumentException on argument parsing errors. - * @return bool - */ - final public function isPrimary() {} - - /** - * Checks if this server is a secondary member of a replica set - * @link https://php.net/manual/en/mongodb-driver-server.issecondary.php - * @throws InvalidArgumentException on argument parsing errors. - * @return bool - */ - final public function isSecondary() {} - } - - /** - * The MongoDB\Driver\Query class is a value object that represents a database query. - * @link https://php.net/manual/en/class.mongodb-driver-query.php - */ - final class Query - { - /** - * Construct new Query - * @link https://php.net/manual/en/mongodb-driver-query.construct.php - * @param array|object $filter The search filter. - * @param array $options - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function __construct($filter, ?array $options = []) {} - - final public function __wakeup() {} - } - - /** - * The MongoDB\Driver\Command class is a value object that represents a database command. - * To provide "Command Helpers" the MongoDB\Driver\Command object should be composed. - * @link https://php.net/manual/en/class.mongodb-driver-command.php - * @since 1.0.0 - */ - final class Command - { - /** - * Construct new Command - * @param array|object $document The complete command to construct - * @param array $options Do not use this parameter to specify options described in the command's reference in the MongoDB manual. - * @throws InvalidArgumentException on argument parsing errors. - * @link https://secure.php.net/manual/en/mongodb-driver-command.construct.php - * @since 1.0.0 - */ - final public function __construct($document, ?array $options = []) {} - - final public function __wakeup() {} - } - - /** - * Class ReadPreference - * @link https://php.net/manual/en/class.mongodb-driver-readpreference.php - */ - final class ReadPreference implements Serializable, \Serializable - { - public const RP_PRIMARY = 1; - public const RP_PRIMARY_PREFERRED = 5; - public const RP_SECONDARY = 2; - public const RP_SECONDARY_PREFERRED = 6; - public const RP_NEAREST = 10; - - /** - * @since 1.7.0 - */ - public const PRIMARY = 'primary'; - - /** - * @since 1.7.0 - */ - public const PRIMARY_PREFERRED = 'primaryPreferred'; - - /** - * @since 1.7.0 - */ - public const SECONDARY = 'secondary'; - - /** - * @since 1.7.0 - */ - public const SECONDARY_PREFERRED = 'secondaryPreferred'; - - /** - * @since 1.7.0 - */ - public const NEAREST = 'nearest'; - - /** - * @since 1.2.0 - */ - public const NO_MAX_STALENESS = -1; - - /** - * @since 1.2.0 - */ - public const SMALLEST_MAX_STALENESS_SECONDS = 90; - - /** - * Construct immutable ReadPreference - * @link https://php.net/manual/en/mongodb-driver-readpreference.construct.php - * @param string|int $mode - * @param array|null $tagSets - * @param array $options - * @throws InvalidArgumentException if mode is invalid or if tagSets is provided for a primary read preference. - */ - final public function __construct($mode, ?array $tagSets = null, ?array $options = []) {} - - public static function __set_state(array $properties) {} - - /** - * Returns the ReadPreference's "hedge" option - * @since 1.8.0 - * @link https://www.php.net/manual/en/mongodb-driver-readpreference.gethedge.php - * @return object|null - */ - final public function getHedge() {} - - /** - * Returns the ReadPreference's "mode" option - * @link https://php.net/manual/en/mongodb-driver-readpreference.getmode.php - * @return int - */ - final public function getMode() {} - - /** - * Returns the ReadPreference's "mode" option as a string - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-readpreference.getmodestring.php - * @return string - * @throws InvalidArgumentException - */ - final public function getModeString() {} - - /** - * Returns the ReadPreference's "tagSets" option - * @link https://php.net/manual/en/mongodb-driver-readpreference.gettagsets.php - * @return array - */ - final public function getTagSets() {} - - /** - * Returns an object for BSON serialization - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-driver-readpreference.bsonserialize.php - * @return object Returns an object for serializing the WriteConcern as BSON. - * @throws InvalidArgumentException - */ - final public function bsonSerialize() {} - - /** - * Serialize a ReadPreference - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-readpreference.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a ReadPreference - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-readpreference.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - final public function getMaxStalenessSeconds() {} - } - - /** - * MongoDB\Driver\ReadConcern controls the level of isolation for read operations for replica sets and replica set shards. This option requires the WiredTiger storage engine and MongoDB 3.2 or later. - * @link https://php.net/manual/en/class.mongodb-driver-readconcern.php - * @since 1.1.0 - */ - final class ReadConcern implements Serializable, \Serializable - { - /** - * @since 1.2.0 - */ - public const LINEARIZABLE = 'linearizable'; - public const LOCAL = 'local'; - public const MAJORITY = 'majority'; - - /** - * @since 1.4.0 - */ - public const AVAILABLE = 'available'; - - /** - * Construct immutable ReadConcern - * @link https://php.net/manual/en/mongodb-driver-readconcern.construct.php - * @param string $level - */ - final public function __construct($level = null) {} - - public static function __set_state(array $properties) {} - - /** - * Returns the ReadConcern's "level" option - * @link https://php.net/manual/en/mongodb-driver-readconcern.getlevel.php - * @return string|null - * @since 1.0.0 - */ - final public function getLevel() {} - - /** - * Returns an object for BSON serialization - * @link https://php.net/manual/en/mongodb-driver-readconcern.bsonserialize.php - * @return object - * @since 1.2.0 - */ - final public function bsonSerialize() {} - - /** - * Checks if this is the default read concern - * @link https://secure.php.net/manual/en/mongodb-driver-readconcern.isdefault.php - * @return bool - * @since 1.3.0 - * @throws \MongoDB\Driver\Exception\InvalidArgumentException On argument parsing errors. - */ - final public function isDefault() {} - - /** - * Serialize a ReadConcern - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-readconcern.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a ReadConcern - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-readconcern.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - } - - /** - * The MongoDB\Driver\Cursor class encapsulates the results of a MongoDB command or query and may be returned by MongoDB\Driver\Manager::executeCommand() or MongoDB\Driver\Manager::executeQuery(), respectively. - * @link https://php.net/manual/en/class.mongodb-driver-cursor.php - */ - final class Cursor implements CursorInterface, \Iterator - { - /** - * Create a new Cursor - * MongoDB\Driver\Cursor objects are returned as the result of an executed command or query and cannot be constructed directly. - * @link https://php.net/manual/en/mongodb-driver-cursor.construct.php - */ - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Returns the current element. - * @link https://www.php.net/manual/en/mongodb-driver-cursor.current.php - * @return array|object - */ - public function current() {} - - /** - * Returns the MongoDB\Driver\CursorId associated with this cursor. A cursor ID cursor uniquely identifies the cursor on the server. - * @link https://php.net/manual/en/mongodb-driver-cursor.getid.php - * @return CursorId for this Cursor - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function getId() {} - - /** - * Returns the MongoDB\Driver\Server associated with this cursor. This is the server that executed the query or command. - * @link https://php.net/manual/en/mongodb-driver-cursor.getserver.php - * @return Server for this Cursor - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function getServer() {} - - /** - * Checks if a cursor is still alive - * @link https://php.net/manual/en/mongodb-driver-cursor.isdead.php - * @return bool - * @throws InvalidArgumentException On argument parsing errors - */ - final public function isDead() {} - - /** - * Returns the current result's index within the cursor. - * @link https://www.php.net/manual/en/mongodb-driver-cursor.key.php - * @return int - */ - public function key() {} - - /** - * Advances the cursor to the next result. - * @link https://www.php.net/manual/en/mongodb-driver-cursor.next.php - * @return void - * @throws \MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. - * @throws \MongoDB\Driver\Exception\ConnectionException if connection to the server fails (for reasons other than authentication). - * @throws \MongoDB\Driver\Exception\AuthenticationException if authentication is needed and fails. - */ - public function next() {} - - /** - * Rewind the cursor to the first result. - * @link https://www.php.net/manual/en/mongodb-driver-cursor.rewind.php - * @return void - * @throws \MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. - * @throws \MongoDB\Driver\Exception\ConnectionException if connection to the server fails (for reasons other than authentication). - * @throws \MongoDB\Driver\Exception\AuthenticationException if authentication is needed and fails. - * @throws \MongoDB\Driver\Exception\LogicException if this method is called after the cursor has advanced beyond its first position. - */ - public function rewind() {} - - /** - * Sets a type map to use for BSON unserialization - * - * @link https://php.net/manual/en/mongodb-driver-cursor.settypemap.php - * - * @param array $typemap - * @return void - * @throws InvalidArgumentException On argument parsing errors or if a class in the type map cannot - * be instantiated or does not implement MongoDB\BSON\Unserializable - */ - final public function setTypeMap(array $typemap) {} - - /** - * Returns an array of all result documents for this cursor - * @link https://php.net/manual/en/mongodb-driver-cursor.toarray.php - * @return array - * @throws InvalidArgumentException On argument parsing errors - */ - final public function toArray() {} - - /** - * Checks if the current position in the cursor is valid. - * @link https://www.php.net/manual/en/mongodb-driver-cursor.valid.php - * @return bool - */ - public function valid() {} - } - - /** - * Class CursorId - * @link https://php.net/manual/en/class.mongodb-driver-cursorid.php - */ - final class CursorId implements \Serializable - { - /** - * Create a new CursorId (not used) - * CursorId objects are returned from Cursor::getId() and cannot be constructed directly. - * @link https://php.net/manual/en/mongodb-driver-cursorid.construct.php - * @see Cursor::getId() - */ - final private function __construct() {} - - /** - * String representation of the cursor ID - * @link https://php.net/manual/en/mongodb-driver-cursorid.tostring.php - * @return string representation of the cursor ID. - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function __toString() {} - - final public function __wakeup() {} - - public static function __set_state(array $properties) {} - - /** - * Serialize a CursorId - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-cursorid.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a CursorId - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-cursorid.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - } - - /** - * The BulkWrite collects one or more write operations that should be sent to the server. - * After adding any number of insert, update, and delete operations, the collection may be executed via Manager::executeBulkWrite(). - * Write operations may either be ordered (default) or unordered. - * Ordered write operations are sent to the server, in the order provided, for serial execution. - * If a write fails, any remaining operations will be aborted. - * Unordered operations are sent to the server in an arbitrary order where they may be executed in parallel. - * Any errors that occur are reported after all operations have been attempted. - */ - final class BulkWrite implements \Countable - { - /** - * Create a new BulkWrite - * Constructs a new ordered (default) or unordered BulkWrite. - * @link https://php.net/manual/en/mongodb-driver-bulkwrite.construct.php - * @param array $options - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function __construct(?array $options = []) {} - - final public function __wakeup() {} - - /** - * Count expected roundtrips for executing the bulk - * Returns the expected number of client-to-server roundtrips required to execute all write operations in the BulkWrite. - * @link https://php.net/manual/en/mongodb-driver-bulkwrite.count.php - * @return int number of expected roundtrips to execute the BulkWrite. - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function count() {} - - /** - * Add a delete operation to the bulk - * @link https://php.net/manual/en/mongodb-driver-bulkwrite.delete.php - * @param array|object $query The search filter - * @param array $deleteOptions - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function delete($query, ?array $deleteOptions = []) {} - - /** - * Add an insert operation to the bulk - * If the document did not have an _id, a MongoDB\BSON\ObjectId will be generated and returned; otherwise, no value is returned. - * @link https://php.net/manual/en/mongodb-driver-bulkwrite.insert.php - * @param array|object $document - * @return mixed - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function insert($document) {} - - /** - * Add an update operation to the bulk - * @link https://php.net/manual/en/mongodb-driver-bulkwrite.update.php - * @param array|object $query The search filter - * @param array|object $newObj A document containing either update operators (e.g. $set) or a replacement document (i.e. only field:value expressions) - * @param array $updateOptions - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function update($query, $newObj, ?array $updateOptions = []) {} - } - - /** - * WriteConcern controls the acknowledgment of a write operation, specifies the level of write guarantee for Replica Sets. - */ - final class WriteConcern implements Serializable, \Serializable - { - /** - * Majority of all the members in the set; arbiters, non-voting members, passive members, hidden members and delayed members are all included in the definition of majority write concern. - */ - public const MAJORITY = 'majority'; - - /** - * Construct immutable WriteConcern - * @link https://php.net/manual/en/mongodb-driver-writeconcern.construct.php - * @param string|int $w - * @param int $wtimeout How long to wait (in milliseconds) for secondaries before failing. - * @param bool $journal Wait until mongod has applied the write to the journal. - * @throws InvalidArgumentException on argument parsing errors. - */ - final public function __construct($w, $wtimeout = 0, $journal = false) {} - - public static function __set_state(array $properties) {} - - /** - * Returns the WriteConcern's "journal" option - * @link https://php.net/manual/en/mongodb-driver-writeconcern.getjournal.php - * @return bool|null - */ - final public function getJournal() {} - - /** - * Returns the WriteConcern's "w" option - * @link https://php.net/manual/en/mongodb-driver-writeconcern.getw.php - * @return string|int|null - */ - final public function getW() {} - - /** - * Returns the WriteConcern's "wtimeout" option - * @link https://php.net/manual/en/mongodb-driver-writeconcern.getwtimeout.php - * @return int - */ - final public function getWtimeout() {} - - /** - * Returns an object for BSON serialization - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-driver-writeconcern.bsonserialize.php - * @return object Returns an object for serializing the WriteConcern as BSON. - * @throws InvalidArgumentException - */ - final public function bsonSerialize() {} - - /** - * Serialize a WriteConcern - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-writeconcern.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a WriteConcern - * @since 1.7.0 - * @link https://php.net/manual/en/mongodb-driver-writeconcern.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - final public function isDefault() {} - } - - /** - * The MongoDB\Driver\WriteResult class encapsulates information about an executed MongoDB\Driver\BulkWrite and may be returned by MongoDB\Driver\Manager::executeBulkWrite(). - * @link https://php.net/manual/en/class.mongodb-driver-writeresult.php - */ - final class WriteResult - { - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Returns the number of documents deleted - * @link https://php.net/manual/en/mongodb-driver-writeresult.getdeletedcount.php - * @return int|null - */ - final public function getDeletedCount() {} - - /** - * Returns the number of documents inserted (excluding upserts) - * @link https://php.net/manual/en/mongodb-driver-writeresult.getinsertedcount.php - * @return int|null - */ - final public function getInsertedCount() {} - - /** - * Returns the number of documents selected for update - * @link https://php.net/manual/en/mongodb-driver-writeresult.getmatchedcount.php - * @return int|null - */ - final public function getMatchedCount() {} - - /** - * Returns the number of existing documents updated - * @link https://php.net/manual/en/mongodb-driver-writeresult.getmodifiedcount.php - * @return int|null - */ - final public function getModifiedCount() {} - - /** - * Returns the server associated with this write result - * @link https://php.net/manual/en/mongodb-driver-writeresult.getserver.php - * @return Server - */ - final public function getServer() {} - - /** - * Returns the number of documents inserted by an upsert - * @link https://php.net/manual/en/mongodb-driver-writeresult.getupsertedcount.php - * @return int|null - */ - final public function getUpsertedCount() {} - - /** - * Returns an array of identifiers for upserted documents - * @link https://php.net/manual/en/mongodb-driver-writeresult.getupsertedids.php - * @return array - */ - final public function getUpsertedIds() {} - - /** - * Returns any write concern error that occurred - * @link https://php.net/manual/en/mongodb-driver-writeresult.getwriteconcernerror.php - * @return WriteConcernError|null - */ - final public function getWriteConcernError() {} - - /** - * Returns any write errors that occurred - * @link https://php.net/manual/en/mongodb-driver-writeresult.getwriteerrors.php - * @return WriteError[] - */ - final public function getWriteErrors() {} - - /** - * Returns whether the write was acknowledged - * @link https://php.net/manual/en/mongodb-driver-writeresult.isacknowledged.php - * @return bool - */ - final public function isAcknowledged() {} - } - - /** - * The MongoDB\Driver\WriteError class encapsulates information about a write error and may be returned as an array element from MongoDB\Driver\WriteResult::getWriteErrors(). - */ - final class WriteError - { - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Returns the WriteError's error code - * @link https://php.net/manual/en/mongodb-driver-writeerror.getcode.php - * @return int - */ - final public function getCode() {} - - /** - * Returns the index of the write operation corresponding to this WriteError - * @link https://php.net/manual/en/mongodb-driver-writeerror.getindex.php - * @return int - */ - final public function getIndex() {} - - /** - * Returns additional metadata for the WriteError - * @link https://php.net/manual/en/mongodb-driver-writeerror.getinfo.php - * @return mixed - */ - final public function getInfo() {} - - /** - * Returns the WriteError's error message - * @link https://php.net/manual/en/mongodb-driver-writeerror.getmessage.php - * @return string - */ - final public function getMessage() {} - } - - /** - * The MongoDB\Driver\WriteConcernError class encapsulates information about a write concern error and may be returned by MongoDB\Driver\WriteResult::getWriteConcernError(). - * @link https://php.net/manual/en/class.mongodb-driver-writeconcernerror.php - */ - final class WriteConcernError - { - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Returns the WriteConcernError's error code - * @link https://php.net/manual/en/mongodb-driver-writeconcernerror.getcode.php - * @return int - */ - final public function getCode() {} - - /** - * Returns additional metadata for the WriteConcernError - * @link https://php.net/manual/en/mongodb-driver-writeconcernerror.getinfo.php - * @return mixed - */ - final public function getInfo() {} - - /** - * Returns the WriteConcernError's error message - * @link https://php.net/manual/en/mongodb-driver-writeconcernerror.getmessage.php - * @return string - */ - final public function getMessage() {} - } - - /** - * Class Session - * - * @link https://secure.php.net/manual/en/class.mongodb-driver-session.php - * @since 1.4.0 - */ - final class Session - { - /** - * @since 1.7.0 - */ - public const TRANSACTION_NONE = 'none'; - - /** - * @since 1.7.0 - */ - public const TRANSACTION_STARTING = 'starting'; - - /** - * @since 1.7.0 - */ - public const TRANSACTION_IN_PROGRESS = 'in_progress'; - - /** - * @since 1.7.0 - */ - public const TRANSACTION_COMMITTED = 'committed'; - - /** - * @since 1.7.0 - */ - public const TRANSACTION_ABORTED = 'aborted'; - - /** - * Create a new Session (not used) - * @link https://secure.php.net/manual/en/mongodb-driver-session.construct.php - * @since 1.4.0 - */ - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Aborts a transaction - * @link https://secure.php.net/manual/en/mongodb-driver-session.aborttransaction.php - * @return void - * @since 1.5.0 - */ - final public function abortTransaction() {} - - /** - * Advances the cluster time for this session - * @link https://secure.php.net/manual/en/mongodb-driver-session.advanceclustertime.php - * @param array|object $clusterTime The cluster time is a document containing a logical timestamp and server signature - * @return void - * @throws \MongoDB\Driver\Exception\InvalidArgumentException On argument parsing errors - * @since 1.4.0 - */ - final public function advanceClusterTime($clusterTime) {} - - /** - * Advances the operation time for this session - * @link https://secure.php.net/manual/en/mongodb-driver-session.advanceoperationtime.php - * @param \MongoDB\BSON\TimestampInterface $timestamp - * @return void - * @throws \MongoDB\Driver\Exception\InvalidArgumentException On argument parsing errors - * @since 1.4.0 - */ - final public function advanceOperationTime($timestamp) {} - - /** - * @link https://secure.php.net/manual/en/mongodb-driver-session.committransaction.php - * @return void - * @throws InvalidArgumentException On argument parsing errors - * @throws CommandException If the server could not commit the transaction (e.g. due to conflicts, - * network issues). In case the exception's MongoDB\Driver\Exception\CommandException::getResultDocument() has a "errorLabels" - * element, and this array contains a "TransientTransactionError" or "UnUnknownTransactionCommitResult" value, it is safe to - * re-try the whole transaction. In newer versions of the driver, MongoDB\Driver\Exception\RuntimeException::hasErrorLabel() - * should be used to test for this situation instead. - * @throws \MongoDB\Driver\Exception\RuntimeException If the transaction could not be committed (e.g. a transaction was not started) - * @since 1.5.0 - */ - final public function commitTransaction() {} - - /** - * This method closes an existing session. If a transaction was associated with this session, this transaction is also aborted, - * and all its operations are rolled back. - * - * @link https://secure.php.net/manual/en/mongodb-driver-session.endsession.php - * @return void - * @throws \MongoDB\Driver\Exception\InvalidArgumentException On argument parsing errors - * @since 1.5.0 - */ - final public function endSession() {} - - /** - * Returns the cluster time for this session - * @link https://secure.php.net/manual/en/mongodb-driver-session.getclustertime.php - * @return object|null - * @throws \MongoDB\Driver\Exception\InvalidArgumentException - * @since 1.4.0 - */ - final public function getClusterTime() {} - - /** - * Returns the logical session ID for this session - * @link https://secure.php.net/manual/en/mongodb-driver-session.getlogicalsessionid.php - * @return object Returns the logical session ID for this session - * @throws \MongoDB\Driver\Exception\InvalidArgumentException - * @since 1.4.0 - */ - final public function getLogicalSessionId() {} - - /** - * Returns the operation time for this session, or NULL if the session has no operation time - * @link https://secure.php.net/manual/en/mongodb-driver-session.getoperationtime.php - * @return \MongoDB\BSON\Timestamp|null - * @throws \MongoDB\Driver\Exception\InvalidArgumentException - * @since 1.4.0 - */ - final public function getOperationTime() {} - - /** - * Returns the server to which this session is pinned, or NULL if the session is not pinned to any server. - * @link https://secure.php.net/manual/en/mongodb-driver-session.getserver.php - * @return \MongoDB\Driver\Server|null - * @throws \MongoDB\Driver\Exception\InvalidArgumentException - * @since 1.6.0 - */ - final public function getServer() {} - - /** - * Returns options for the current transactions, or NULL if no transaction is running. - * @link https://secure.php.net/manual/en/mongodb-driver-session.gettransactionoptions.php - * @return array|null - * @throws \MongoDB\Driver\Exception\InvalidArgumentException - * @since 1.7.0 - */ - final public function getTransactionOptions() {} - - /** - * Returns the current transaction state - * @link https://secure.php.net/manual/en/mongodb-driver-session.gettransactionstate.php - * @return string - * @throws \MongoDB\Driver\Exception\InvalidArgumentException - * @since 1.7.0 - */ - final public function getTransactionState() {} - - /** - * Returns whether a multi-document transaction is in progress. - * @link https://secure.php.net/manual/en/mongodb-driver-session.isintransaction.php - * @return bool - * @throws \MongoDB\Driver\Exception\InvalidArgumentException - * @since 1.6.0 - */ - final public function isInTransaction() {} - - /** - * Starts a transaction - * @link https://secure.php.net/manual/en/mongodb-driver-session.starttransaction.php - * @param array|object $options - * @return void - * @throws \MongoDB\Driver\Exception\InvalidArgumentException On argument parsing errors - * @throws \MongoDB\Driver\Exception\CommandException If the the transaction could not be started because of a server-side problem (e.g. a lock could not be obtained). - * @throws \MongoDB\Driver\Exception\RuntimeException If the the transaction could not be started (e.g. a transaction was already started). - * @since 1.4.0 - */ - final public function startTransaction(?array $options = []) {} - } - - /** - * This interface is implemented by MongoDB\Driver\Cursor but may also be used for type-hinting and userland classes. - * @link https://www.php.net/manual/en/class.mongodb-driver-cursorinterface.php - * @since 1.6.0 - */ - interface CursorInterface extends Traversable - { - /** - * Returns the MongoDB\Driver\CursorId associated with this cursor. A cursor ID uniquely identifies the cursor on the server. - * @return CursorId Returns the MongoDB\Driver\CursorId for this cursor. - * @throws InvalidArgumentException - * @link https://www.php.net/manual/en/mongodb-driver-cursorinterface.getid.php - */ - public function getId(); - - /** - * Returns the MongoDB\Driver\Server associated with this cursor. - * This is the server that executed the MongoDB\Driver\Query or MongoDB\Driver\Command. - * @link https://www.php.net/manual/en/mongodb-driver-cursorinterface.getserver.php - * @return Server Returns the MongoDB\Driver\Server associated with this cursor. - * @throws InvalidArgumentException - */ - public function getServer(); - - /** - * Checks whether the cursor may have additional results available to read. - * @link https://www.php.net/manual/en/mongodb-driver-cursorinterface.isdead.php - * @return bool Returns TRUE if additional results are not available, and FALSE otherwise. - * @throws InvalidArgumentException - */ - public function isDead(); - - /** - * Sets a type map to use for BSON unserialization - * @link https://www.php.net/manual/en/mongodb-driver-cursorinterface.settypemap.php - * @param array $typemap Type map configuration. - * @return mixed - * @throws InvalidArgumentException - */ - public function setTypeMap(array $typemap); - - /** - * Iterates the cursor and returns its results in an array. - * MongoDB\Driver\CursorInterface::setTypeMap() may be used to control how documents are unserialized into PHP values. - * @return array Returns an array containing all results for this cursor. - * @throws InvalidArgumentException - */ - public function toArray(); - } - - /** - * The MongoDB\Driver\ClientEncryption class handles creation of data keys for client-side encryption, as well as manually encrypting and decrypting values. - * @link https://www.php.net/manual/en/class.mongodb-driver-clientencryption.php - * @since 1.7.0 - */ - final class ClientEncryption - { - public const AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC = 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'; - public const AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM = 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'; - - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Creates a new key document and inserts into the key vault collection. - * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.createdatakey.php - * @param string $kmsProvider The KMS provider ("local" or "aws") that will be used to encrypt the new encryption key. - * @param array $options [optional] - * @return \MongoDB\BSON\Binary Returns the identifier of the new key as a MongoDB\BSON\Binary object with subtype 4 (UUID). - * @throws InvalidArgumentException On argument parsing errors. - * @throws EncryptionException If an error occurs while creating the data key. - */ - final public function createDataKey($kmsProvider, ?array $options = []) {} - - /** - * Decrypts an encrypted value (BSON binary of subtype 6). - * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.decrypt.php - * @param \MongoDB\BSON\BinaryInterface $keyVaultClient A MongoDB\BSON\Binary instance with subtype 6 containing the encrypted value. - * @return mixed Returns the decrypted value - * @throws InvalidArgumentException On argument parsing errors. - * @throws EncryptionException If an error occurs while decrypting the value. - */ - final public function decrypt(\MongoDB\BSON\BinaryInterface $keyVaultClient) {} - - /** - * Encrypts a value with a given key and algorithm. - * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.encrypt.php - * @param mixed $value The value to be encrypted. Any value that can be inserted into MongoDB can be encrypted using this method. - * @param array $options [optional] - * @return \MongoDB\BSON\Binary Returns the encrypted value as MongoDB\BSON\Binary object with subtype 6. - * @throws InvalidArgumentException On argument parsing errors. - * @throws EncryptionException If an error occurs while encrypting the value. - */ - final public function encrypt($value, ?array $options = []) {} - } - } - -namespace MongoDB\Driver\Exception { - use MongoDB\Driver\WriteResult; - use Throwable; - - /** - * Thrown when the driver encounters a runtime error (e.g. internal error from » libmongoc). - * @link https://php.net/manual/en/class.mongodb-driver-exception-runtimeexception.php - * @since 1.0.0 - */ - class RuntimeException extends \RuntimeException implements Exception - { - /** - * @var bool - * @since 1.6.0 - */ - protected $errorLabels; - - /** - * Whether the given errorLabel is associated with this exception - * - * @param string $label - * @return bool - *@since 1.6.0 - */ - final public function hasErrorLabel($label) {} - } - - /** - * Common interface for all driver exceptions. This may be used to catch only exceptions originating from the driver itself. - * @link https://php.net/manual/en/class.mongodb-driver-exception-exception.php - */ - interface Exception extends Throwable {} - - /** - * Thrown when the driver fails to authenticate with the server. - * @link https://php.net/manual/en/class.mongodb-driver-exception-authenticationexception.php - * @since 1.0.0 - */ - class AuthenticationException extends ConnectionException implements Exception {} - - /** - * Base class for exceptions thrown when the driver fails to establish a database connection. - * @link https://php.net/manual/en/class.mongodb-driver-exception-connectionexception.php - * @since 1.0.0 - */ - class ConnectionException extends RuntimeException implements Exception {} - - /** - * Thrown when a driver method is given invalid arguments (e.g. invalid option types). - * @link https://php.net/manual/en/class.mongodb-driver-exception-invalidargumentexception.php - * @since 1.0.0 - */ - class InvalidArgumentException extends \InvalidArgumentException implements Exception {} - - /** - * Thrown when a command fails - * - * @link https://php.net/manual/en/class.mongodb-driver-exception-commandexception.php - * @since 1.5.0 - */ - class CommandException extends ServerException - { - protected $resultDocument; - - /** - * Returns the result document for the failed command - * @link https://secure.php.net/manual/en/mongodb-driver-commandexception.getresultdocument.php - * @return object - * @since 1.5.0 - */ - final public function getResultDocument() {} - } - - /** - * Base class for exceptions thrown by the server. The code of this exception and its subclasses will correspond to the original - * error code from the server. - * - * @link https://secure.php.net/manual/en/class.mongodb-driver-exception-serverexception.php - * @since 1.5.0 - */ - class ServerException extends RuntimeException implements Exception {} - - /** - * Base class for exceptions thrown by a failed write operation. - * The exception encapsulates a MongoDB\Driver\WriteResult object. - * @link https://php.net/manual/en/class.mongodb-driver-exception-writeexception.php - * @since 1.0.0 - */ - abstract class WriteException extends ServerException implements Exception - { - /** - * @var WriteResult associated with the failed write operation. - */ - protected $writeResult; - - /** - * @return WriteResult for the failed write operation - * @since 1.0.0 - */ - final public function getWriteResult() {} - } - - class WriteConcernException extends RuntimeException implements Exception {} - - /** - * Thrown when the driver encounters an unexpected value (e.g. during BSON serialization or deserialization). - * @link https://php.net/manual/en/class.mongodb-driver-exception-unexpectedvalueexception.php - * @since 1.0.0 - */ - class UnexpectedValueException extends \UnexpectedValueException implements Exception {} - - /** - * Thrown when a bulk write operation fails. - * @link https://php.net/manual/en/class.mongodb-driver-exception-bulkwriteexception.php - * @since 1.0.0 - */ - class BulkWriteException extends WriteException implements Exception {} - - /** - * Thrown when the driver fails to establish a database connection within a specified time limit (e.g. connectTimeoutMS). - * @link https://php.net/manual/en/class.mongodb-driver-exception-connectiontimeoutexception.php - */ - class ConnectionTimeoutException extends ConnectionException implements Exception {} - - /** - * Thrown when a query or command fails to complete within a specified time limit (e.g. maxTimeMS). - * @link https://php.net/manual/en/class.mongodb-driver-exception-executiontimeoutexception.php - */ - class ExecutionTimeoutException extends ServerException implements Exception {} - - /** - * Thrown when the driver is incorrectly used (e.g. rewinding a cursor). - * @link https://php.net/manual/en/class.mongodb-driver-exception-logicexception.php - */ - class LogicException extends \LogicException implements Exception {} - - /** - * Thrown when the driver fails to establish an SSL connection with the server. - * @link https://php.net/manual/en/class.mongodb-driver-exception-sslconnectionexception.php - */ - class SSLConnectionException extends ConnectionException implements Exception {} - - /** - * Base class for exceptions thrown during client-side encryption. - * @link https://php.net/manual/en/class.mongodb-driver-exception-encryptionexception.php - * @since 1.7.0 - */ - class EncryptionException extends RuntimeException implements Exception {} - } - -/** - * @link https://secure.php.net/manual/en/mongodb.monitoring.php - */ - -namespace MongoDB\Driver\Monitoring { - /** - * Registers a new monitoring event subscriber with the driver. - * Registered subscribers will be notified of monitoring events through specific methods. - * Note: If the object is already registered, this function is a no-op. - * @link https://secure.php.net/manual/en/function.mongodb.driver.monitoring.addsubscriber.php - * @param Subscriber $subscriber A monitoring event subscriber object to register. - * @return void - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - function addSubscriber(Subscriber $subscriber) {} - - /** - * Unregisters an existing monitoring event subscriber from the driver. - * Unregistered subscribers will no longer be notified of monitoring events. - * Note: If the object is not registered, this function is a no-op. - * @link https://secure.php.net/manual/en/function.mongodb.driver.monitoring.removesubscriber.php - * @param Subscriber $subscriber A monitoring event subscriber object to register. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - function removeSubscriber(Subscriber $subscriber) {} - - /** - * Base interface for event subscribers. - * This is used for type-hinting MongoDB\Driver\Monitoring\addSubscriber() and MongoDB\Driver\Monitoring\removeSubscriber() and should not be implemented directly. - * This interface has no methods. Its only purpose is to be the base interface for all event subscribers. - * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-subscriber.php - * @since 1.3.0 - */ - interface Subscriber {} - - /** - * Classes may implement this interface to register an event subscriber that is notified for each started, successful, and failed command event. - * @see https://secure.php.net/manual/en/mongodb.tutorial.apm.php - * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-commandsubscriber.php - * @since 1.3.0 - */ - interface CommandSubscriber extends Subscriber - { - /** - * Notification method for a failed command. - * If the subscriber has been registered with MongoDB\Driver\Monitoring\addSubscriber(), the driver will call this method when a command has failed. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsubscriber.commandfailed.php - * @param CommandFailedEvent $event An event object encapsulating information about the failed command. - * @return void - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - public function commandFailed(CommandFailedEvent $event); - - /** - * Notification method for a started command. - * If the subscriber has been registered with MongoDB\Driver\Monitoring\addSubscriber(), the driver will call this method when a command has started. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsubscriber.commandstarted.php - * @param CommandStartedEvent $event An event object encapsulating information about the started command. - * @return void - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - public function commandStarted(CommandStartedEvent $event); - - /** - * Notification method for a successful command. - * If the subscriber has been registered with MongoDB\Driver\Monitoring\addSubscriber(), the driver will call this method when a command has succeeded. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsubscriber.commandsucceeded.php - * @param CommandSucceededEvent $event An event object encapsulating information about the successful command. - * @return void - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - public function commandSucceeded(CommandSucceededEvent $event); - } - - /** - * Encapsulates information about a successful command. - * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-commandsucceededevent.php - * @since 1.3.0 - */ - class CommandSucceededEvent - { - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Returns the command name. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getcommandname.php - * @return string The command name (e.g. "find", "aggregate"). - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getCommandName() {} - - /** - * Returns the command's duration in microseconds - * The command's duration is a calculated value that includes the time to send the message and receive the reply from the server. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getdurationmicros.php - * @return int the command's duration in microseconds. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getDurationMicros() {} - - /** - * Returns the command's operation ID. - * The operation ID is generated by the driver and may be used to link events together such as bulk write operations, which may have been split across several commands at the protocol level. - * Note: Since multiple commands may share the same operation ID, it is not reliable to use this value to associate event objects with each other. The request ID returned by MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId() should be used instead. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getoperationid.php - * @return string the command's operation ID. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getOperationId() {} - - /** - * Returns the command reply document. - * The reply document will be converted from BSON to PHP using the default deserialization rules (e.g. BSON documents will be converted to stdClass). - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getreply.php - * @return object the command reply document as a stdClass object. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getReply() {} - - /** - * Returns the command's request ID. - * The request ID is generated by the driver and may be used to associate this CommandSucceededEvent with a previous CommandStartedEvent. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getrequestid.php - * @return string the command's request ID. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getRequestId() {} - - /** - * Returns the Server on which the command was executed. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getserver.php - * @return \MongoDB\Driver\Server on which the command was executed. - * @since 1.3.0 - */ - final public function getServer() {} - } - - /** - * Encapsulates information about a failed command. - * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-commandfailedevent.php - * @since 1.3.0 - */ - class CommandFailedEvent - { - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Returns the command name. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getcommandname.php - * @return string The command name (e.g. "find", "aggregate"). - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getCommandName() {} - - /** - * Returns the command's duration in microseconds - * The command's duration is a calculated value that includes the time to send the message and receive the reply from the server. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getdurationmicros.php - * @return int the command's duration in microseconds. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getDurationMicros() {} - - /** - * Returns the Exception associated with the failed command - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.geterror.php - * @return \Exception - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getError() {} - - /** - * Returns the command's operation ID. - * The operation ID is generated by the driver and may be used to link events together such as bulk write operations, which may have been split across several commands at the protocol level. - * Note: Since multiple commands may share the same operation ID, it is not reliable to use this value to associate event objects with each other. The request ID returned by MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId() should be used instead. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getoperationid.php - * @return string the command's operation ID. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getOperationId() {} - - /** - * Returns the command reply document. - * The reply document will be converted from BSON to PHP using the default deserialization rules (e.g. BSON documents will be converted to stdClass). - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getreply.php - * @return object the command reply document as a stdClass object. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getReply() {} - - /** - * Returns the command's request ID. - * The request ID is generated by the driver and may be used to associate this CommandSucceededEvent with a previous CommandStartedEvent. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getrequestid.php - * @return string the command's request ID. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getRequestId() {} - - /** - * Returns the Server on which the command was executed. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getserver.php - * @return \MongoDB\Driver\Server on which the command was executed. - * @since 1.3.0 - */ - final public function getServer() {} - } - - /** - * Encapsulates information about a failed command. - * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-commandstartedevent.php - * @since 1.3.0 - */ - class CommandStartedEvent - { - final private function __construct() {} - - final public function __wakeup() {} - - /** - * Returns the command document - * The reply document will be converted from BSON to PHP using the default deserialization rules (e.g. BSON documents will be converted to stdClass). - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getcommand.php - * @return object the command document as a stdClass object. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getCommand() {} - - /** - * Returns the command name. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getcommandname.php - * @return string The command name (e.g. "find", "aggregate"). - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getCommandName() {} - - /** - * Returns the database on which the command was executed. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getdatabasename.php - * @return string the database on which the command was executed. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getDatabaseName() {} - - /** - * Returns the command's operation ID. - * The operation ID is generated by the driver and may be used to link events together such as bulk write operations, which may have been split across several commands at the protocol level. - * Note: Since multiple commands may share the same operation ID, it is not reliable to use this value to associate event objects with each other. The request ID returned by MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId() should be used instead. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getoperationid.php - * @return string the command's operation ID. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getOperationId() {} - - /** - * Returns the command's request ID. - * The request ID is generated by the driver and may be used to associate this CommandSucceededEvent with a previous CommandStartedEvent. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getrequestid.php - * @return string the command's request ID. - * @throws \InvalidArgumentException on argument parsing errors. - * @since 1.3.0 - */ - final public function getRequestId() {} - - /** - * Returns the Server on which the command was executed. - * @link https://secure.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getserver.php - * @return \MongoDB\Driver\Server on which the command was executed. - * @since 1.3.0 - */ - final public function getServer() {} - } - } - -/** - * @link https://php.net/manual/en/book.bson.php - */ - -namespace MongoDB\BSON { - use DateTime; - use DateTimeInterface; - use JetBrains\PhpStorm\Deprecated; - use JsonSerializable; - use MongoDB\Driver\Exception\InvalidArgumentException; - use MongoDB\Driver\Exception\UnexpectedValueException; - - /** - * Converts a BSON string to its Canonical Extended JSON representation. - * The canonical format prefers type fidelity at the expense of concise output and is most suited for producing - * output that can be converted back to BSON without any loss of type information - * (e.g. numeric types will remain differentiated). - * @link https://www.php.net/manual/en/function.mongodb.bson-tocanonicalextendedjson.php - * @param string $bson BSON value to be converted - * @return string The converted JSON value - * @throws UnexpectedValueException - */ - function toCanonicalExtendedJSON($bson) {} - - /** - * Converts a BSON string to its » Relaxed Extended JSON representation. - * The relaxed format prefers use of JSON type primitives at the expense of type fidelity and is most suited for - * producing output that can be easily consumed by web APIs and humans. - * @link https://www.php.net/manual/en/function.mongodb.bson-torelaxedextendedjson.php - * @param string $bson BSON value to be converted - * @return string The converted JSON value - * @throws UnexpectedValueException - */ - function toRelaxedExtendedJSON($bson) {} - - /** - * Returns the BSON representation of a JSON value - * Converts an extended JSON string to its BSON representation. - * @link https://php.net/manual/en/function.mongodb.bson-fromjson.php - * @param string $json JSON value to be converted. - * @return string The serialized BSON document as a binary string. - * @throws UnexpectedValueException if the JSON value cannot be converted to BSON (e.g. due to a syntax error). - */ - function fromJSON($json) {} - - /** - * Returns the BSON representation of a PHP value - * Serializes a PHP array or object (e.g. document) to its BSON representation. The returned binary string will describe a BSON document. - * @link https://php.net/manual/en/function.mongodb.bson-fromphp.php - * @param array|object $value PHP value to be serialized. - * @return string The serialized BSON document as a binary string - * @throws UnexpectedValueException if the PHP value cannot be converted to BSON. - */ - function fromPHP($value) {} - - /** - * Returns the JSON representation of a BSON value - * Converts a BSON string to its extended JSON representation. - * @link https://php.net/manual/en/function.mongodb.bson-tojson.php - * @param string $bson BSON value to be converted - * @return string The converted JSON value. - * @see https://docs.mongodb.org/manual/reference/mongodb-extended-json/ - * @throws UnexpectedValueException if the input did not contain exactly one BSON document - */ - function toJSON($bson) {} - - /** - * Returns the PHP representation of a BSON value - * Unserializes a BSON document (i.e. binary string) to its PHP representation. - * The typeMap parameter may be used to control the PHP types used for converting BSON arrays and documents (both root and embedded). - * @link https://php.net/manual/en/function.mongodb.bson-tophp.php - * @param string $bson BSON value to be unserialized. - * @param array $typemap - * @return object The unserialized PHP value - * @throws UnexpectedValueException if the input did not contain exactly one BSON document. - * @throws InvalidArgumentException if a class in the type map cannot be instantiated or does not implement MongoDB\BSON\Unserializable. - */ - function toPHP($bson, array $typemap = []) {} - - /** - * Class Binary - * @link https://php.net/manual/en/class.mongodb-bson-binary.php - */ - final class Binary implements Type, BinaryInterface, \Serializable, JsonSerializable - { - public const TYPE_GENERIC = 0; - public const TYPE_FUNCTION = 1; - public const TYPE_OLD_BINARY = 2; - public const TYPE_OLD_UUID = 3; - public const TYPE_UUID = 4; - public const TYPE_MD5 = 5; - - /** - * @since 1.7.0 - */ - public const TYPE_ENCRYPTED = 6; - public const TYPE_USER_DEFINED = 128; - - /** - * Binary constructor. - * @link https://php.net/manual/en/mongodb-bson-binary.construct.php - * @param string $data - * @param int $type - */ - final public function __construct($data, $type) {} - - /** - * Returns the Binary's data - * @link https://php.net/manual/en/mongodb-bson-binary.getdata.php - * @return string - */ - final public function getData() {} - - /** - * Returns the Binary's type - * @link https://php.net/manual/en/mongodb-bson-binary.gettype.php - * @return int - */ - final public function getType() {} - - public static function __set_state(array $properties) {} - - /** - * Returns the Binary's data - * @link https://www.php.net/manual/en/mongodb-bson-binary.tostring.php - * @return string - */ - final public function __toString() {} - - /** - * Serialize a Binary - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-binary.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a Binary - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-binary.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-binary.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * BSON type for the Decimal128 floating-point format, which supports numbers with up to 34 decimal digits (i.e. significant digits) and an exponent range of −6143 to +6144. - * @link https://php.net/manual/en/class.mongodb-bson-decimal128.php - */ - final class Decimal128 implements Type, Decimal128Interface, \Serializable, JsonSerializable - { - /** - * Construct a new Decimal128 - * @link https://php.net/manual/en/mongodb-bson-decimal128.construct.php - * @param string $value A decimal string. - */ - final public function __construct($value = '') {} - - /** - * Returns the string representation of this Decimal128 - * @link https://php.net/manual/en/mongodb-bson-decimal128.tostring.php - * @return string - */ - final public function __toString() {} - - public static function __set_state(array $properties) {} - - /** - * Serialize a Decimal128 - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-decimal128.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a Decimal128 - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-decimal128.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-decimal128.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * Class Javascript - * @link https://php.net/manual/en/class.mongodb-bson-javascript.php - */ - final class Javascript implements Type, JavascriptInterface, \Serializable, JsonSerializable - { - /** - * Construct a new Javascript - * @link https://php.net/manual/en/mongodb-bson-javascript.construct.php - * @param string $javascript - * @param array|object $scope - */ - final public function __construct($javascript, $scope = []) {} - - public static function __set_state(array $properties) {} - - /** - * Returns the Javascript's code - * @return string - * @link https://secure.php.net/manual/en/mongodb-bson-javascript.getcode.php - */ - final public function getCode() {} - - /** - * Returns the Javascript's scope document - * @return object|null - * @link https://secure.php.net/manual/en/mongodb-bson-javascript.getscope.php - */ - final public function getScope() {} - - /** - * Returns the Javascript's code - * @return string - * @link https://secure.php.net/manual/en/mongodb-bson-javascript.tostring.php - */ - final public function __toString() {} - - /** - * Serialize a Javascript - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-javascript.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a Javascript - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-javascript.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-javascript.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * Class MaxKey - * @link https://php.net/manual/en/class.mongodb-bson-maxkey.php - */ - final class MaxKey implements Type, MaxKeyInterface, \Serializable, JsonSerializable - { - public static function __set_state(array $properties) {} - - /** - * Serialize a MaxKey - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-maxkey.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a MaxKey - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-maxkey.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-maxkey.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * Class MinKey - * @link https://php.net/manual/en/class.mongodb-bson-minkey.php - */ - final class MinKey implements Type, MinKeyInterface, \Serializable, JsonSerializable - { - public static function __set_state(array $properties) {} - - /** - * Serialize a MinKey - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-minkey.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a MinKey - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-minkey.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-minkey.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * Class ObjectId - * @link https://php.net/manual/en/class.mongodb-bson-objectid.php - */ - final class ObjectId implements Type, ObjectIdInterface, \Serializable, JsonSerializable - { - /** - * Construct a new ObjectId - * @link https://php.net/manual/en/mongodb-bson-objectid.construct.php - * @param string|null $id A 24-character hexadecimal string. If not provided, the driver will generate an ObjectId. - * @throws InvalidArgumentException if id is not a 24-character hexadecimal string. - */ - final public function __construct($id = null) {} - - /** - * Returns the hexadecimal representation of this ObjectId - * @link https://php.net/manual/en/mongodb-bson-objectid.tostring.php - * @return string - */ - final public function __toString() {} - - public static function __set_state(array $properties) {} - - /** - * Returns the timestamp component of this ObjectId - * @since 1.2.0 - * @link https://secure.php.net/manual/en/mongodb-bson-objectid.gettimestamp.php - * @return int the timestamp component of this ObjectId - */ - final public function getTimestamp() {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://secure.php.net/manual/en/mongodb-bson-objectid.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - */ - final public function jsonSerialize() {} - - /** - * Serialize an ObjectId - * @since 1.2.0 - * @link https://secure.php.net/manual/en/mongodb-bson-objectid.serialize.php - * @return string the serialized representation of the object - */ - final public function serialize() {} - - /** - * Unserialize an ObjectId - * @since 1.2.0 - * @link https://secure.php.net/manual/en/mongodb-bson-objectid.unserialize.php - * @return void - */ - final public function unserialize($serialized) {} - } - - /** - * Class Regex - * @link https://php.net/manual/en/class.mongodb-bson-regex.php - */ - final class Regex implements Type, RegexInterface, \Serializable, JsonSerializable - { - /** - * Construct a new Regex - * @link https://php.net/manual/en/mongodb-bson-regex.construct.php - * @param string $pattern - * @param string $flags [optional] - */ - final public function __construct($pattern, $flags = "") {} - - /** - * Returns the Regex's flags - * @link https://php.net/manual/en/mongodb-bson-regex.getflags.php - */ - final public function getFlags() {} - - /** - * Returns the Regex's pattern - * @link https://php.net/manual/en/mongodb-bson-regex.getpattern.php - * @return string - */ - final public function getPattern() {} - - /** - * Returns the string representation of this Regex - * @link https://php.net/manual/en/mongodb-bson-regex.tostring.php - * @return string - */ - final public function __toString() {} - - public static function __set_state(array $properties) {} - - /** - * Serialize a Regex - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-regex.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a Regex - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-regex.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-regex.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * Represents a BSON timestamp, which is an internal MongoDB type not intended for general date storage. - * @link https://php.net/manual/en/class.mongodb-bson-timestamp.php - */ - final class Timestamp implements TimestampInterface, Type, \Serializable, JsonSerializable - { - /** - * Construct a new Timestamp - * @link https://php.net/manual/en/mongodb-bson-timestamp.construct.php - * @param int $increment - * @param int $timestamp - */ - final public function __construct($increment, $timestamp) {} - - /** - * Returns the string representation of this Timestamp - * @link https://php.net/manual/en/mongodb-bson-timestamp.tostring.php - * @return string - */ - final public function __toString() {} - - public static function __set_state(array $properties) {} - - /** - * Returns the increment component of this TimestampInterface - * @link https://secure.php.net/manual/en/mongodb-bson-timestampinterface.getincrement.php - * @return int - * @since 1.3.0 - */ - final public function getIncrement() {} - - /** - * Returns the timestamp component of this TimestampInterface - * @link https://secure.php.net/manual/en/mongodb-bson-timestampinterface.gettimestamp.php - * @return int - * @since 1.3.0 - */ - final public function getTimestamp() {} - - /** - * Serialize a Timestamp - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-timestamp.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a Timestamp - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-timestamp.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-timestamp.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * Represents a BSON date. - * @link https://php.net/manual/en/class.mongodb-bson-utcdatetime.php - */ - final class UTCDateTime implements Type, UTCDateTimeInterface, \Serializable, \JsonSerializable - { - /** - * Construct a new UTCDateTime - * @link https://php.net/manual/en/mongodb-bson-utcdatetime.construct.php - * @param int|float|string|DateTimeInterface $milliseconds - */ - final public function __construct($milliseconds = null) {} - - public static function __set_state(array $properties) {} - - /** - * Returns the DateTime representation of this UTCDateTime - * @link https://php.net/manual/en/mongodb-bson-utcdatetime.todatetime.php - * @return \DateTime - */ - final public function toDateTime() {} - - /** - * Returns the string representation of this UTCDateTime - * @link https://php.net/manual/en/mongodb-bson-utcdatetime.tostring.php - * @return string - */ - final public function __toString() {} - - /** - * Serialize a UTCDateTime - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-utcdatetime.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a UTCDateTime - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-utcdatetime.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-utcdatetime.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - } - - /** - * BSON type for the "Undefined" type. This BSON type is deprecated, and this class can not be instantiated. It will be created - * from a BSON undefined type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database. - * - * @link https://secure.php.net/manual/en/class.mongodb-bson-undefined.php - */ - #[Deprecated] - final class Undefined implements Type, \Serializable, \JsonSerializable - { - final private function __construct() {} - - /** - * Serialize an Undefined - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-undefined.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize an Undefined - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-undefined.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-undefined.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - - /** - * Returns the Undefined as a string - * @return string Returns the string representation of this Symbol. - */ - final public function __toString() {} - } - - /** - * BSON type for the "Symbol" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a - * BSON symbol type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database. - * - * @link https://secure.php.net/manual/en/class.mongodb-bson-symbol.php - */ - #[Deprecated] - final class Symbol implements Type, \Serializable, \JsonSerializable - { - final private function __construct() {} - - /** - * Serialize a Symbol - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-symbol.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a Symbol - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-symbol.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @since 1.2.0 - * @link https://www.php.net/manual/en/mongodb-bson-symbol.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - - /** - * Returns the Symbol as a string - * @return string Returns the string representation of this Symbol. - */ - final public function __toString() {} - } - - /** - * BSON type for the "DbPointer" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a - * BSON symbol type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database. - * - * @since 1.4.0 - * @link https://secure.php.net/manual/en/class.mongodb-bson-dbpointer.php - */ - #[Deprecated] - final class DBPointer implements Type, \Serializable, \JsonSerializable - { - final private function __construct() {} - - /** - * Serialize a DBPointer - * - * @link https://www.php.net/manual/en/mongodb-bson-dbpointer.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize a DBPointer - * - * @link https://www.php.net/manual/en/mongodb-bson-dbpointer.unserialize.php - * - * @param string $serialized - * - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * - * @link https://www.php.net/manual/en/mongodb-bson-dbpointer.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - - /** - * Returns the Symbol as a string - * - * @return string Returns the string representation of this Symbol. - */ - final public function __toString() {} - } - - /** - * BSON type for a 64-bit integer. This class cannot be instantiated and is only created during BSON decoding when a 64-bit - * integer cannot be represented as a PHP integer on a 32-bit platform. Versions of the driver before 1.5.0 would throw an - * exception when attempting to decode a 64-bit integer on a 32-bit platform. - * During BSON encoding, objects of this class will convert back to a 64-bit integer type. This allows 64-bit integers to be - * roundtripped through a 32-bit PHP environment without any loss of precision. The __toString() method allows the 64-bit integer - * value to be accessed as a string. - * - * @since 1.5.0 - * @link https://secure.php.net/manual/en/class.mongodb-bson-int64.php - */ - #[Deprecated] - final class Int64 implements Type, \Serializable, \JsonSerializable - { - final private function __construct() {} - - /** - * Serialize an Int64 - * @link https://www.php.net/manual/en/mongodb-bson-int64.serialize.php - * @return string - * @throws InvalidArgumentException - */ - final public function serialize() {} - - /** - * Unserialize an Int64 - * @link https://www.php.net/manual/en/mongodb-bson-int64.unserialize.php - * @param string $serialized - * @return void - * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid - * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) - */ - final public function unserialize($serialized) {} - - /** - * Returns a representation that can be converted to JSON - * @link https://www.php.net/manual/en/mongodb-bson-int64.jsonserialize.php - * @return mixed data which can be serialized by json_encode() - * @throws InvalidArgumentException on argument parsing errors - */ - final public function jsonSerialize() {} - - /** - * Returns the Symbol as a string - * @return string Returns the string representation of this Symbol. - */ - final public function __toString() {} - } - - /** - * This interface is implemented by MongoDB\BSON\Binary but may also be used for type-hinting and userland classes. - * @link https://www.php.net/manual/en/class.mongodb-bson-binaryinterface.php - */ - interface BinaryInterface - { - /** - * @link https://www.php.net/manual/en/mongodb-bson-binaryinterface.getdata.php - * @return string Returns the BinaryInterface's data - */ - public function getData(); - - /** - * @link https://www.php.net/manual/en/mongodb-bson-binaryinterface.gettype.php - * @return int Returns the BinaryInterface's type. - */ - public function getType(); - - /** - * This method is an alias of: MongoDB\BSON\BinaryInterface::getData(). - * @link https://www.php.net/manual/en/mongodb-bson-binaryinterface.tostring.php - * @return string Returns the BinaryInterface's data. - */ - public function __toString(); - } - - /** - * This interface is implemented by MongoDB\BSON\ObjectId but may also be used for type-hinting and userland classes. - * @link https://www.php.net/manual/en/class.mongodb-bson-objectidinterface.php - */ - interface ObjectIdInterface - { - /** - * @link https://www.php.net/manual/en/mongodb-bson-objectidinterface.gettimestamp.php - * @return int Returns the timestamp component of this ObjectIdInterface. - */ - public function getTimestamp(); - - /** - * Returns the hexadecimal representation of this ObjectId - * @link https://www.php.net/manual/en/mongodb-bson-objectid.tostring.php - * @return string Returns the hexadecimal representation of this ObjectId - */ - public function __toString(); - } - - /** - * @link https://www.php.net/manual/en/class.mongodb-bson-regexinterface.php - * This interface is implemented by MongoDB\BSON\Regex but may also be used for type-hinting and userland classes. - */ - interface RegexInterface - { - /** - * @link https://www.php.net/manual/en/mongodb-bson-regexinterface.getflags.php - * @return string Returns the RegexInterface's flags. - */ - public function getFlags(); - - /** - * @link https://www.php.net/manual/en/mongodb-bson-regexinterface.getpattern.php - * @return string Returns the RegexInterface's pattern. - */ - public function getPattern(); - - /** - * Returns the string representation of this RegexInterface - * @link https://www.php.net/manual/en/mongodb-bson-regexinterface.tostring.php - * @return string - */ - public function __toString(); - } - - /** - * This interface is implemented by MongoDB\BSON\UTCDateTime but may also be used for type-hinting and userland classes. - * @link https://www.php.net/manual/en/class.mongodb-bson-utcdatetimeinterface.php - */ - interface UTCDateTimeInterface - { - /** - * @link https://www.php.net/manual/en/mongodb-bson-utcdatetimeinterface.todatetime.php - * @return DateTime Returns the DateTime representation of this UTCDateTimeInterface. The returned DateTime should use the UTC time zone. - */ - public function toDateTime(); - - /** - * Returns the string representation of this UTCDateTimeInterface - * @link https://www.php.net/manual/en/mongodb-bson-utcdatetimeinterface.tostring.php - * @return string - */ - public function __toString(); - } - - /** - * This interface is implemented by MongoDB\BSON\MaxKey but may also be used for type-hinting and userland classes. - * @link https://www.php.net/manual/en/class.mongodb-bson-maxkeyinterface.php - */ - interface MaxKeyInterface {} - - /** - * This interface is implemented by MongoDB\BSON\MinKey but may also be used for type-hinting and userland classes. - * @link https://www.php.net/manual/en/class.mongodb-bson-minkeyinterface.php - */ - interface MinKeyInterface {} - - /** - * This interface is implemented by MongoDB\BSON\Decimal128 but may also be used for type-hinting and userland classes. - * @link https://www.php.net/manual/en/class.mongodb-bson-decimal128interface.php - */ - interface Decimal128Interface - { - /** - * Returns the string representation of this Decimal128Interface - * @link https://www.php.net/manual/en/mongodb-bson-decimal128interface.tostring.php - * @return string Returns the string representation of this Decimal128Interface - */ - public function __toString(); - } - - /** - * Classes may implement this interface to take advantage of automatic ODM (object document mapping) behavior in the driver. - * @link https://php.net/manual/en/class.mongodb-bson-persistable.php - */ - interface Persistable extends Unserializable, Serializable {} - - /** - * Classes that implement this interface may return data to be serialized as a BSON array or document in lieu of the object's public properties - * @link https://php.net/manual/en/class.mongodb-bson-serializable.php - */ - interface Serializable extends Type - { - /** - * Provides an array or document to serialize as BSON - * Called during serialization of the object to BSON. The method must return an array or stdClass. - * Root documents (e.g. a MongoDB\BSON\Serializable passed to MongoDB\BSON\fromPHP()) will always be serialized as a BSON document. - * For field values, associative arrays and stdClass instances will be serialized as a BSON document and sequential arrays (i.e. sequential, numeric indexes starting at 0) will be serialized as a BSON array. - * @link https://php.net/manual/en/mongodb-bson-serializable.bsonserialize.php - * @return array|object An array or stdClass to be serialized as a BSON array or document. - */ - public function bsonSerialize(); - } - - /** - * Classes that implement this interface may be specified in a type map for unserializing BSON arrays and documents (both root and embedded). - * @link https://php.net/manual/en/class.mongodb-bson-unserializable.php - */ - interface Unserializable extends Type - { - /** - * Constructs the object from a BSON array or document - * Called during unserialization of the object from BSON. - * The properties of the BSON array or document will be passed to the method as an array. - * @link https://php.net/manual/en/mongodb-bson-unserializable.bsonunserialize.php - * @param array $data Properties within the BSON array or document. - */ - public function bsonUnserialize(array $data); - } - - /** - * Interface Type - * @link https://php.net/manual/en/class.mongodb-bson-type.php - */ - interface Type {} - - /** - * Interface TimestampInterface - * - * @link https://secure.php.net/manual/en/class.mongodb-bson-timestampinterface.php - * @since 1.3.0 - */ - interface TimestampInterface - { - /** - * Returns the increment component of this TimestampInterface - * @link https://secure.php.net/manual/en/mongodb-bson-timestampinterface.getincrement.php - * @return int - * @since 1.3.0 - */ - public function getIncrement(); - - /** - * Returns the timestamp component of this TimestampInterface - * @link https://secure.php.net/manual/en/mongodb-bson-timestampinterface.gettimestamp.php - * @return int - * @since 1.3.0 - */ - public function getTimestamp(); - - /** - * Returns the string representation of this TimestampInterface - * @link https://secure.php.net/manual/en/mongodb-bson-timestampinterface.tostring.php - * @return string - * @since 1.3.0 - */ - public function __toString(); - } - - /** - * Interface JavascriptInterface - * - * @link https://secure.php.net/manual/en/class.mongodb-bson-javascriptinterface.php - * @since 1.3.0 - */ - interface JavascriptInterface - { - /** - * Returns the JavascriptInterface's code - * @return string - * @link https://secure.php.net/manual/en/mongodb-bson-javascriptinterface.getcode.php - * @since 1.3.0 - */ - public function getCode(); - - /** - * Returns the JavascriptInterface's scope document - * @return object|null - * @link https://secure.php.net/manual/en/mongodb-bson-javascriptinterface.getscope.php - * @since 1.3.0 - */ - public function getScope(); - - /** - * Returns the JavascriptInterface's code - * @return string - * @link https://secure.php.net/manual/en/mongodb-bson-javascriptinterface.tostring.php - * @since 1.3.0 - */ - public function __toString(); - } - } - namespace { - define('MONGODB_VERSION', '1.10.0'); + define('MONGODB_VERSION', '1.15.0'); define('MONGODB_STABILITY', 'stable'); } From 9b88ae4d55f56ca39b12e983f88e6034d4d34baa Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 6 Feb 2023 08:54:43 +0100 Subject: [PATCH 292/419] Fix code formatting --- mongodb/Command.php | 1 - mongodb/Query.php | 1 - mongodb/ReadConcern.php | 1 - mongodb/ReadPreference.php | 1 - mongodb/WriteConcern.php | 1 - mongodb/mongodb.php | 7 ++----- 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/mongodb/Command.php b/mongodb/Command.php index 295828e6b..1c0d51f88 100644 --- a/mongodb/Command.php +++ b/mongodb/Command.php @@ -24,4 +24,3 @@ final public function __construct($document, ?array $options = []) {} final public function __wakeup() {} } - diff --git a/mongodb/Query.php b/mongodb/Query.php index 87f007094..a7a807a8d 100644 --- a/mongodb/Query.php +++ b/mongodb/Query.php @@ -21,4 +21,3 @@ final public function __construct($filter, ?array $options = []) {} final public function __wakeup() {} } - diff --git a/mongodb/ReadConcern.php b/mongodb/ReadConcern.php index 043ef3f99..631477b32 100644 --- a/mongodb/ReadConcern.php +++ b/mongodb/ReadConcern.php @@ -79,4 +79,3 @@ final public function serialize() {} */ final public function unserialize($serialized) {} } - diff --git a/mongodb/ReadPreference.php b/mongodb/ReadPreference.php index 589044242..6eabfccd1 100644 --- a/mongodb/ReadPreference.php +++ b/mongodb/ReadPreference.php @@ -127,4 +127,3 @@ final public function unserialize($serialized) {} final public function getMaxStalenessSeconds() {} } - diff --git a/mongodb/WriteConcern.php b/mongodb/WriteConcern.php index d5aa934f1..2558345e5 100644 --- a/mongodb/WriteConcern.php +++ b/mongodb/WriteConcern.php @@ -80,4 +80,3 @@ final public function unserialize($serialized) {} final public function isDefault() {} } - diff --git a/mongodb/mongodb.php b/mongodb/mongodb.php index 27ae7a5c4..fb42dd97d 100644 --- a/mongodb/mongodb.php +++ b/mongodb/mongodb.php @@ -11,8 +11,5 @@ * Userland PHP libraries that depend on this extension may provide higher level APIs, such as query builders, individual command helper methods, and GridFS. Application developers should consider using this extension in conjunction with the » MongoDB PHP library, which implements the same higher level APIs found in MongoDB drivers for other languages. This separation of concerns allows the driver to focus on essential features for which an extension implementation is paramount for performance. * @link https://php.net/manual/en/set.mongodb.php */ - -namespace { - define('MONGODB_VERSION', '1.15.0'); - define('MONGODB_STABILITY', 'stable'); -} +define('MONGODB_VERSION', '1.15.0'); +define('MONGODB_STABILITY', 'stable'); From b3489cf8249f2ff09184fc84db45cde226284492 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 8 Feb 2023 22:26:51 +0100 Subject: [PATCH 293/419] DOMElement::$attributes is not nullable --- dom/dom_c.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dom/dom_c.php b/dom/dom_c.php index 58e1a23be..9622a4ef6 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -1640,6 +1640,14 @@ class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode */ public $nextSibling; + /** + * @var DOMNamedNodeMap + * A DOMNamedNodeMap containing the attributes of this node (if it is a DOMElement) or NULL otherwise. + * @link https://php.net/manual/en/class.domnode.php#domnode.props.attributes + */ + #[LanguageLevelTypeAware(['8.1' => 'DOMNamedNodeMap'], default: '')] + public $attributes; + /** * @var bool * Not implemented yet, always return NULL From d9e2c0a574187478aed7a853ab36652b1e18bda1 Mon Sep 17 00:00:00 2001 From: Thomas Schulz Date: Wed, 1 Feb 2023 11:26:48 +0100 Subject: [PATCH 294/419] Added array shape for ZipArchive::statIndex method --- zip/zip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip/zip.php b/zip/zip.php index 758ecedfd..b8d1f6229 100644 --- a/zip/zip.php +++ b/zip/zip.php @@ -1065,7 +1065,7 @@ public function statName( * information about the original file in the archive, * ignoring any changes made. *

    - * @return array|false an array containing the entry details or FALSE on failure. + * @return array{name: string, index: int, crc: int, size: int, mtime: int, comp_size: int, comp_method: int, encryption_method: int}|false an array containing the entry details or FALSE on failure. */ public function statIndex( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $index, From de53302780aee15d724360f2ee728946a4527659 Mon Sep 17 00:00:00 2001 From: Thomas Schulz Date: Wed, 1 Feb 2023 12:05:25 +0100 Subject: [PATCH 295/419] Added array shape for ZipArchive::statName method --- zip/zip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip/zip.php b/zip/zip.php index b8d1f6229..c3e492c32 100644 --- a/zip/zip.php +++ b/zip/zip.php @@ -1046,7 +1046,7 @@ public function deleteName(#[LanguageLevelTypeAware(['8.0' => 'string'], default * ignoring any changes made. * ZipArchive::FL_NOCASE *

    - * @return array|false an array containing the entry details or FALSE on failure. + * @return array{name: string, index: int, crc: int, size: int, mtime: int, comp_size: int, comp_method: int, encryption_method: int}|false an array containing the entry details or FALSE on failure. */ public function statName( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, From e6a62f12b44d89658badaac11268f59e4fbae430 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 16 Feb 2023 13:12:17 +0100 Subject: [PATCH 296/419] [phpstorm-stubs] update PGSQL_LIBPQ_VERSION constant --- pgsql/pgsql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 8e864acae..021f3507e 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -2066,8 +2066,8 @@ function pg_consume_input(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'] */ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection): int|bool {} -define('PGSQL_LIBPQ_VERSION', "15.1"); -define('PGSQL_LIBPQ_VERSION_STR', "15.1"); +define('PGSQL_LIBPQ_VERSION', "15.2"); +define('PGSQL_LIBPQ_VERSION_STR', "15.2"); /** * Passed to pg_connect to force the creation of a new connection, From 159be57e7fa69f64cab69a6ca3d5e5c0b5c04d7d Mon Sep 17 00:00:00 2001 From: Max <49632507+maxm86545@users.noreply.github.com> Date: Mon, 20 Feb 2023 00:13:55 +0300 Subject: [PATCH 297/419] Fix: MaterizedView => MaterializedView --- cassandra/cassandra.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cassandra/cassandra.php b/cassandra/cassandra.php index f359fec63..010144424 100644 --- a/cassandra/cassandra.php +++ b/cassandra/cassandra.php @@ -1253,7 +1253,7 @@ public function userTypes(); * * @param string $name Materialized view name * - * @return \Cassandra\MaterizedView|null A materialized view or null + * @return \Cassandra\MaterializedView|null A materialized view or null * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Keyspace/#method-materializedView */ public function materializedView($name); @@ -4386,7 +4386,7 @@ public function userTypes() {} * * @param string $name Materialized view name * - * @return \Cassandra\MaterizedView|null A materialized view or null + * @return \Cassandra\MaterializedView|null A materialized view or null * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultKeyspace/#method-materializedView */ public function materializedView($name) {} @@ -4884,7 +4884,7 @@ public function indexes() {} * * @param string $name Materialized view name * - * @return \Cassandra\MaterizedView|null A materialized view or null + * @return \Cassandra\MaterializedView|null A materialized view or null * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultTable/#method-materializedView */ public function materializedView($name) {} From e3045ea75d790c3bb2ce4b8d3bc59cc983b87061 Mon Sep 17 00:00:00 2001 From: Max <49632507+maxm86545@users.noreply.github.com> Date: Mon, 20 Feb 2023 00:15:49 +0300 Subject: [PATCH 298/419] Fix: \Cassandra\Cluster\RetryPolicy => \Cassandra\RetryPolicy --- cassandra/cassandra.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cassandra/cassandra.php b/cassandra/cassandra.php index 010144424..0a4030a2d 100644 --- a/cassandra/cassandra.php +++ b/cassandra/cassandra.php @@ -5514,7 +5514,7 @@ public function withTCPKeepalive($delay) {} /** * Configures the retry policy. * - * @param \Cassandra\Cluster\RetryPolicy $policy the retry policy to use. + * @param \Cassandra\RetryPolicy $policy the retry policy to use. * * @return \Cassandra\Cluster\Builder self * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/Cluster/class.Builder/#method-withRetryPolicy From 735d07ca3a233c78040f77b02e68e2db3a64cd18 Mon Sep 17 00:00:00 2001 From: Max <49632507+maxm86545@users.noreply.github.com> Date: Mon, 20 Feb 2023 00:19:56 +0300 Subject: [PATCH 299/419] Fix: of of => of --- cassandra/cassandra.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cassandra/cassandra.php b/cassandra/cassandra.php index 0a4030a2d..23deaa61e 100644 --- a/cassandra/cassandra.php +++ b/cassandra/cassandra.php @@ -832,7 +832,7 @@ public function columns(); /** * Returns the partition key columns of the table * - * @return array A list of of Column instances + * @return array A list of Column instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-partitionKey */ public function partitionKey(); @@ -840,7 +840,7 @@ public function partitionKey(); /** * Returns both the partition and clustering key columns of the table * - * @return array A list of of Column instances + * @return array A list of Column instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-primaryKey */ public function primaryKey(); @@ -848,7 +848,7 @@ public function primaryKey(); /** * Returns the clustering key columns of the table * - * @return array A list of of Column instances + * @return array A list of Column instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/interface.Table/#method-clusteringKey */ public function clusteringKey(); @@ -2399,7 +2399,7 @@ public function columns() {} /** * Returns the partition key columns of the view * - * @return array A list of of Column instances + * @return array A list of Column instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultMaterializedView/#method-partitionKey */ public function partitionKey() {} @@ -2407,7 +2407,7 @@ public function partitionKey() {} /** * Returns both the partition and clustering key columns of the view * - * @return array A list of of Column instances + * @return array A list of Column instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultMaterializedView/#method-primaryKey */ public function primaryKey() {} @@ -2415,7 +2415,7 @@ public function primaryKey() {} /** * Returns the clustering key columns of the view * - * @return array A list of of Column instances + * @return array A list of Column instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultMaterializedView/#method-clusteringKey */ public function clusteringKey() {} @@ -3425,7 +3425,7 @@ abstract public function columns(); /** * Returns the partition key columns of the view * - * @return array A list of of `Column` instances + * @return array A list of `Column` instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.MaterializedView/#method-partitionKey */ abstract public function partitionKey(); @@ -3433,7 +3433,7 @@ abstract public function partitionKey(); /** * Returns both the partition and clustering key columns of the view * - * @return array A list of of `Column` instances + * @return array A list of `Column` instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.MaterializedView/#method-primaryKey */ abstract public function primaryKey(); @@ -3441,7 +3441,7 @@ abstract public function primaryKey(); /** * Returns the clustering key columns of the view * - * @return array A list of of `Column` instances + * @return array A list of `Column` instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.MaterializedView/#method-clusteringKey */ abstract public function clusteringKey(); @@ -4834,7 +4834,7 @@ public function columns() {} /** * Returns the partition key columns of the table * - * @return array A list of of `Column` instance + * @return array A list of `Column` instance * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultTable/#method-partitionKey */ public function partitionKey() {} @@ -4842,7 +4842,7 @@ public function partitionKey() {} /** * Returns both the partition and clustering key columns of the table * - * @return array A list of of `Column` instance + * @return array A list of `Column` instance * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultTable/#method-primaryKey */ public function primaryKey() {} @@ -4850,7 +4850,7 @@ public function primaryKey() {} /** * Returns the clustering key columns of the table * - * @return array A list of of `Column` instances + * @return array A list of `Column` instances * @link https://docs.datastax.com/en/developer/php-driver/latest/api/Cassandra/class.DefaultTable/#method-clusteringKey */ public function clusteringKey() {} From 7b055d8634d2143a909f2c5141ec70c82b8b9254 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Tue, 21 Feb 2023 22:30:25 +0100 Subject: [PATCH 300/419] docs(openssl): openssl_pkcs7_encrypt accepts also an array of certificates Signed-off-by: Daniel Kesselberg --- openssl/openssl.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openssl/openssl.php b/openssl/openssl.php index 42be04c03..7dc000984 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -991,7 +991,7 @@ function openssl_pkcs7_sign( * @link https://php.net/manual/en/function.openssl-pkcs7-encrypt.php * @param string $input_filename * @param string $output_filename - * @param OpenSSLCertificate|string|resource $certificate

    + * @param OpenSSLCertificate|array|string|resource $certificate

    * Either a lone X.509 certificate, or an array of X.509 certificates. *

    * @param array|null $headers

    @@ -1013,7 +1013,14 @@ function openssl_pkcs7_sign( *

    * @return bool true on success or false on failure. */ -function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_AES_128_CBC): bool {} +function openssl_pkcs7_encrypt( + string $input_filename, + string $output_filename, + #[LanguageLevelTypeAware(["8.0" => "OpenSSLCertificate|array|string"], default: "resource|array|string")] $certificate, + ?array $headers, + int $flags = 0, + int $cipher_algo = OPENSSL_CIPHER_AES_128_CBC +): bool {} /** * Encrypts data with private key From c9803bb1d7befa9cd740d5ad79d7f8e895e166c4 Mon Sep 17 00:00:00 2001 From: Jean-Luc Herren Date: Wed, 8 Mar 2023 17:23:19 +0100 Subject: [PATCH 301/419] mailparse_msg_get_part() can return false According to the source, it returns false when called incorrectly, or when the requested part was not found. --- mailparse/mailparse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailparse/mailparse.php b/mailparse/mailparse.php index ff643a98f..736fa49de 100644 --- a/mailparse/mailparse.php +++ b/mailparse/mailparse.php @@ -111,7 +111,7 @@ function mailparse_msg_get_part_data($mimemail) {} * A valid MIME resource. *

    * @param string $mimesection - * @return resource + * @return resource|false */ function mailparse_msg_get_part($mimemail, $mimesection) {} From b51c647ece0a88c59fbc94028daebd047377bcdb Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Thu, 23 Feb 2023 21:30:43 -0300 Subject: [PATCH 302/419] Update stub for "ibm_db2" --- ibm_db2/ibm_db2.php | 236 ++++++++++++++++++++++---------------------- 1 file changed, 118 insertions(+), 118 deletions(-) diff --git a/ibm_db2/ibm_db2.php b/ibm_db2/ibm_db2.php index 9130c7676..94b829b65 100644 --- a/ibm_db2/ibm_db2.php +++ b/ibm_db2/ibm_db2.php @@ -6,32 +6,23 @@ * Returns a connection to a database * @link https://php.net/manual/en/function.db2-connect.php * @param string $database

    - * For a cataloged connection to a database, database - * represents the database alias in the DB2 client catalog. + * For a cataloged connection to a database, this parameter + * represents the connection alias in the DB2 client catalog. *

    *

    * For an uncataloged connection to a database, - * database represents a complete connection - * string in the following format: - * DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=password; - * where the parameters represent the following values: - * database - *

    - * The name of the database. + * this parameter represents a complete DSN in the following format: + * DRIVER=driver;DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=password; *

    - * @param string $username

    - * The username with which you are connecting to the database. + * @param string|null $username

    + * The username with which you are connecting to the database, or null if + * the $database parameter contains a DSN which already provides the username for + * the connection. *

    - *

    - * For uncataloged connections, you must pass a null value or empty - * string. - *

    - * @param string $password

    - * The password with which you are connecting to the database. - *

    - *

    - * For uncataloged connections, you must pass a null value or empty - * string. + * @param string|null $password

    + * The password with which you are connecting to the database, or null if + * the $database parameter contains a DSN which already provides the password for + * the connection. *

    * @param array $options

    * An associative array of connection options that affect the behavior @@ -49,7 +40,7 @@ * successful. If the connection attempt fails, db2_connect * returns false. */ -function db2_connect($database, $username, $password, array $options = null) {} +function db2_connect(string $database, ?string $username, #[\SensitiveParameter] ?string $password, array $options = []) {} /** * Commits a transaction @@ -60,19 +51,29 @@ function db2_connect($database, $username, $password, array $options = null) {} *

    * @return bool true on success or false on failure. */ -function db2_commit($connection) {} +function db2_commit($connection): bool {} /** * Returns a persistent connection to a database * @link https://php.net/manual/en/function.db2-pconnect.php * @param string $database

    - * The database alias in the DB2 client catalog. + * For a cataloged connection to a database, this parameter + * represents the connection alias in the DB2 client catalog. + *

    + *

    + * For an uncataloged connection to a database, + * this parameter represents a complete DSN in the following format: + * DRIVER=driver;DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;UID=username;PWD=password; *

    - * @param string $username

    - * The username with which you are connecting to the database. + * @param string|null $username

    + * The username with which you are connecting to the database, or null if + * the $database parameter contains a DSN which already provides the username for + * the connection. *

    - * @param string $password

    - * The password with which you are connecting to the database. + * @param string|null $password

    + * The password with which you are connecting to the database, or null if + * the $database parameter contains a DSN which already provides the password for + * the connection. *

    * @param array $options

    * An associative array of connection options that affect the behavior @@ -94,7 +95,7 @@ function db2_commit($connection) {} * password parameters. If the connection attempt fails, * db2_pconnect returns false. */ -function db2_pconnect($database, $username, $password, array $options = null) {} +function db2_pconnect(string $database, ?string $username, #[\SensitiveParameter] ?string $password, array $options = []) {} /** * Returns or sets the AUTOCOMMIT state for a database connection @@ -103,7 +104,7 @@ function db2_pconnect($database, $username, $password, array $options = null) {} * A valid database connection resource variable as returned from * db2_connect or db2_pconnect. *

    - * @param bool $value

    + * @param int $value

    * One of the following constants:

    *

    * DB2_AUTOCOMMIT_OFF @@ -113,7 +114,7 @@ function db2_pconnect($database, $username, $password, array $options = null) {} * DB2_AUTOCOMMIT_ON * Turns AUTOCOMMIT on. *

    - * @return mixed

    When db2_autocommit receives only the + * @return int|bool

    When db2_autocommit receives only the * connection parameter, it returns the current state * of AUTOCOMMIT for the requested connection as an integer value. A value of * 0 indicates that AUTOCOMMIT is off, while a value of 1 indicates that @@ -126,7 +127,7 @@ function db2_pconnect($database, $username, $password, array $options = null) {} * AUTOCOMMIT state of the requested connection to the corresponding state. * true on success or false on failure.

    */ -function db2_autocommit($connection, $value = null) {} +function db2_autocommit($connection, int $value = null): int|bool {} /** * Binds a PHP variable to an SQL statement parameter @@ -152,7 +153,7 @@ function db2_autocommit($connection, $value = null) {} *

    * @return bool true on success or false on failure. */ -function db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_type = null, $data_type = null, $precision = null, $scale = null) {} +function db2_bind_param($stmt, int $parameter_number, string $variable_name, int $parameter_type = DB2_PARAM_IN, int $data_type = 0, int $precision = -1, int $scale = 0): bool {} /** * Closes a database connection @@ -162,7 +163,7 @@ function db2_bind_param($stmt, $parameter_number, $variable_name, $parameter_typ *

    * @return bool true on success or false on failure. */ -function db2_close($connection) {} +function db2_close($connection): bool {} /** * Returns a result set listing the columns and associated privileges for a table @@ -170,16 +171,16 @@ function db2_close($connection) {} * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    - * @param string $schema

    + * @param string|null $schema

    * The schema which contains the tables. To match all schemas, pass null * or an empty string. *

    - * @param string $table_name - * @param string $column_name + * @param string|null $table_name + * @param string|null $column_name * @return resource|false a statement resource with a result set containing rows describing * the column privileges for columns matching the specified parameters. The * rows are composed of the following columns: @@ -223,7 +224,7 @@ function db2_close($connection) {} * other users. * */ -function db2_column_privileges($connection, $qualifier = null, $schema = null, $table_name = null, $column_name = null) {} +function db2_column_privileges($connection, ?string $qualifier = null, ?string $schema = null, ?string $table_name = null, ?string $column_name = null) {} function db2_columnprivileges() {} @@ -352,11 +353,11 @@ function db2_columns($connection, $qualifier = null, $schema = null, $table_name * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    - * @param string $schema

    + * @param string|null $schema

    * The schema which contains the tables. If schema * is null, db2_foreign_keys matches the schema for * the current connection. @@ -446,7 +447,7 @@ function db2_columns($connection, $qualifier = null, $schema = null, $table_name * * */ -function db2_foreign_keys($connection, $qualifier, $schema, $table_name) {} +function db2_foreign_keys($connection, ?string $qualifier, ?string $schema, string $table_name) {} function db2_foreignkeys() {} @@ -456,11 +457,11 @@ function db2_foreignkeys() {} * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    - * @param string $schema

    + * @param string|null $schema

    * The schema which contains the tables. If schema * is null, db2_primary_keys matches the schema for * the current connection. @@ -503,7 +504,7 @@ function db2_foreignkeys() {} * The name of the primary key. * */ -function db2_primary_keys($connection, $qualifier, $schema, $table_name) {} +function db2_primary_keys($connection, ?string $qualifier, ?string $schema, string $table_name) {} function db2_primarykeys() {} @@ -513,7 +514,7 @@ function db2_primarykeys() {} * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    @@ -527,7 +528,7 @@ function db2_primarykeys() {} * search pattern containing _ and % * as wildcards. *

    - * @param string $parameter

    + * @param string|null $parameter

    * The name of the parameter. This parameter accepts a search pattern * containing _ and % as wildcards. * If this parameter is null, all parameters for the specified stored @@ -661,7 +662,7 @@ function db2_primarykeys() {} * * */ -function db2_procedure_columns($connection, $qualifier, $schema, $procedure, $parameter) {} +function db2_procedure_columns($connection, ?string $qualifier, string $schema, string $procedure, ?string $parameter) {} function db2_procedurecolumns() {} @@ -671,7 +672,7 @@ function db2_procedurecolumns() {} * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    @@ -727,7 +728,7 @@ function db2_procedurecolumns() {} * procedure does not return a return value. * */ -function db2_procedures($connection, $qualifier, $schema, $procedure) {} +function db2_procedures($connection, ?string $qualifier, string $schema, string $procedure) {} /** * Returns a result set listing the unique row identifier columns for a table @@ -735,7 +736,7 @@ function db2_procedures($connection, $qualifier, $schema, $procedure) {} * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    @@ -853,7 +854,7 @@ function db2_procedures($connection, $qualifier, $schema, $procedure) {} * Always returns 1. * */ -function db2_special_columns($connection, $qualifier, $schema, $table_name, $scope) {} +function db2_special_columns($connection, ?string $qualifier, string $schema, string $table_name, int $scope) {} function db2_specialcolumns() {} @@ -863,11 +864,11 @@ function db2_specialcolumns() {} * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    - * @param string $schema

    + * @param string|null $schema

    * The schema that contains the targeted table. If this parameter is * null, the statistics and indexes are returned for the schema of the * current user. @@ -876,8 +877,7 @@ function db2_specialcolumns() {} * The name of the table. *

    * @param bool $unique

    - * An integer value representing the type of index information to return. - * 0 + * Whether to return the only the unique indexes or all the indexes in the table. *

    *

    * Return only the information for unique indexes on the table. @@ -908,18 +908,18 @@ function db2_specialcolumns() {} * * *

    - * An integer value representing whether the index prohibits unique + * An boolean value representing whether the index prohibits unique * values, or whether the row represents statistics on the table itself:

    * * * * * - * + * * * * - * + * * * * @@ -1024,7 +1024,7 @@ function db2_specialcolumns() {} * *
    Return valueParameter type
    0 (SQL_FALSE)false (SQL_FALSE)The index allows duplicate values.
    1 (SQL_TRUE)true (SQL_TRUE)The index values must be unique.
    */ -function db2_statistics($connection, $qualifier, $schema, $table_name, $unique) {} +function db2_statistics($connection, ?string $qualifier, ?string $schema, string $table_name, bool $unique) {} /** * Returns a result set listing the tables and associated privileges in a database @@ -1032,16 +1032,16 @@ function db2_statistics($connection, $qualifier, $schema, $table_name, $unique) * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    - * @param string $schema

    + * @param string|null $schema

    * The schema which contains the tables. This parameter accepts a * search pattern containing _ and % * as wildcards. *

    - * @param string $table_name

    + * @param string|null $table_name

    * The name of the table. This parameter accepts a search pattern * containing _ and % as wildcards. *

    @@ -1089,7 +1089,7 @@ function db2_statistics($connection, $qualifier, $schema, $table_name, $unique) * * */ -function db2_table_privileges($connection, $qualifier = null, $schema = null, $table_name = null) {} +function db2_table_privileges($connection, ?string $qualifier = null, ?string $schema = null, ?string $table_name = null) {} function db2_tableprivileges() {} @@ -1099,17 +1099,17 @@ function db2_tableprivileges() {} * @param resource $connection

    * A valid connection to an IBM DB2, Cloudscape, or Apache Derby database. *

    - * @param string $qualifier

    + * @param string|null $qualifier

    * A qualifier for DB2 databases running on OS/390 or z/OS servers. For * other databases, pass null or an empty string. *

    - * @param string $schema

    + * @param string|null $schema

    * The schema which contains the tables. This parameter accepts a * search pattern containing _ and % * as wildcards. *

    - * @param string $table_name - * @param string $table_type + * @param string|null $table_name + * @param string|null $table_type * @return resource|false A statement resource with a result set containing rows describing * the tables that match the specified parameters. The rows are composed of * the following columns: @@ -1139,7 +1139,7 @@ function db2_tableprivileges() {} * Description of the table. * */ -function db2_tables($connection, $qualifier = null, $schema = null, $table_name = null, $table_type = null) {} +function db2_tables($connection, ?string $qualifier = null, ?string $schema = null, ?string $table_name = null, ?string $table_type = null) {} /** * Executes an SQL statement directly @@ -1173,7 +1173,7 @@ function db2_tables($connection, $qualifier = null, $schema = null, $table_name * @return resource|false A statement resource if the SQL statement was issued successfully, * or false if the database failed to execute the SQL statement. */ -function db2_exec($connection, $statement, array $options = null) {} +function db2_exec($connection, string $statement, array $options = []) {} /** * Prepares an SQL statement to be executed @@ -1209,7 +1209,7 @@ function db2_exec($connection, $statement, array $options = null) {} * returned an error. You can determine which error was returned by calling * db2_stmt_error or db2_stmt_errormsg. */ -function db2_prepare($connection, $statement, array $options = null) {} +function db2_prepare($connection, string $statement, array $options = []) {} /** * Executes a prepared SQL statement @@ -1223,13 +1223,13 @@ function db2_prepare($connection, $statement, array $options = null) {} *

    * @return bool true on success or false on failure. */ -function db2_execute($stmt, array $parameters = null) {} +function db2_execute($stmt, array $parameters = []): bool {} /** * Returns a string containing the last SQL statement error message * @link https://php.net/manual/en/function.db2-stmt-errormsg.php - * @param resource $stmt

    - * A valid statement resource. + * @param resource|null $stmt

    + * A valid statement resource or NULL. *

    * @return string a string containing the error message and SQLCODE value for the * last error that occurred issuing an SQL statement. @@ -1239,7 +1239,7 @@ function db2_stmt_errormsg($stmt = null) {} /** * Returns the last connection error message and SQLCODE value * @link https://php.net/manual/en/function.db2-conn-errormsg.php - * @param resource $connection

    + * @param resource|null $connection

    * A connection resource associated with a connection that initially * succeeded, but which over time became invalid. *

    @@ -1253,7 +1253,7 @@ function db2_conn_errormsg($connection = null) {} /** * Returns a string containing the SQLSTATE returned by the last connection attempt * @link https://php.net/manual/en/function.db2-conn-error.php - * @param resource $connection

    + * @param resource|null $connection

    * A connection resource associated with a connection that initially * succeeded, but which over time became invalid. *

    @@ -1266,8 +1266,8 @@ function db2_conn_error($connection = null) {} /** * Returns a string containing the SQLSTATE returned by an SQL statement * @link https://php.net/manual/en/function.db2-stmt-error.php - * @param resource $stmt

    - * A valid statement resource. + * @param resource|null $stmt

    + * A valid statement resource or NULL. *

    * @return string a string containing an SQLSTATE value. */ @@ -1296,7 +1296,7 @@ function db2_next_result($stmt) {} * set associated with the specified statement resource. Returns false if * the statement resource is not a valid input value. */ -function db2_num_fields($stmt) {} +function db2_num_fields($stmt): int|false {} /** * Returns the number of rows affected by an SQL statement @@ -1304,10 +1304,10 @@ function db2_num_fields($stmt) {} * @param resource $stmt

    * A valid stmt resource containing a result set. *

    - * @return int the number of rows affected by the last SQL statement issued by - * the specified statement handle. + * @return int|false the number of rows affected by the last SQL statement issued by + * the specified statement handle, or false in case of failure. */ -function db2_num_rows($stmt) {} +function db2_num_rows($stmt): int|false {} /** * Returns the name of the column in the result set @@ -1315,7 +1315,7 @@ function db2_num_rows($stmt) {} * @param resource $stmt

    * Specifies a statement resource containing a result set. *

    - * @param mixed $column

    + * @param int|string $column

    * Specifies the column in the result set. This can either be an integer * representing the 0-indexed position of the column, or a string * containing the name of the column. @@ -1324,7 +1324,7 @@ function db2_num_rows($stmt) {} * specified column does not exist in the result * set, db2_field_name returns false. */ -function db2_field_name($stmt, $column) {} +function db2_field_name($stmt, int|string $column): string|false {} /** * Returns the maximum number of bytes required to display a column @@ -1332,7 +1332,7 @@ function db2_field_name($stmt, $column) {} * @param resource $stmt

    * Specifies a statement resource containing a result set. *

    - * @param mixed $column

    + * @param int|string $column

    * Specifies the column in the result set. This can either be an integer * representing the 0-indexed position of the column, or a string * containing the name of the column. @@ -1341,7 +1341,7 @@ function db2_field_name($stmt, $column) {} * display the specified column. If the column does not exist in the result * set, db2_field_display_size returns false. */ -function db2_field_display_size($stmt, $column) {} +function db2_field_display_size($stmt, int|string $column): int|false {} /** * Returns the position of the named column in a result set @@ -1349,7 +1349,7 @@ function db2_field_display_size($stmt, $column) {} * @param resource $stmt

    * Specifies a statement resource containing a result set. *

    - * @param mixed $column

    + * @param int|string $column

    * Specifies the column in the result set. This can either be an integer * representing the 0-indexed position of the column, or a string * containing the name of the column. @@ -1358,7 +1358,7 @@ function db2_field_display_size($stmt, $column) {} * the result set. If the specified column does not exist in the result set, * db2_field_num returns false. */ -function db2_field_num($stmt, $column) {} +function db2_field_num($stmt, int|string $column): int|false {} /** * Returns the precision of the indicated column in a result set @@ -1366,7 +1366,7 @@ function db2_field_num($stmt, $column) {} * @param resource $stmt

    * Specifies a statement resource containing a result set. *

    - * @param mixed $column

    + * @param int|string $column

    * Specifies the column in the result set. This can either be an integer * representing the 0-indexed position of the column, or a string * containing the name of the column. @@ -1375,7 +1375,7 @@ function db2_field_num($stmt, $column) {} * specified column does not exist in the result set, * db2_field_precision returns false. */ -function db2_field_precision($stmt, $column) {} +function db2_field_precision($stmt, int|string $column): int|false {} /** * Returns the scale of the indicated column in a result set @@ -1383,7 +1383,7 @@ function db2_field_precision($stmt, $column) {} * @param resource $stmt

    * Specifies a statement resource containing a result set. *

    - * @param mixed $column

    + * @param int|string $column

    * Specifies the column in the result set. This can either be an integer * representing the 0-indexed position of the column, or a string * containing the name of the column. @@ -1392,7 +1392,7 @@ function db2_field_precision($stmt, $column) {} * specified column does not exist in the result set, * db2_field_scale returns false. */ -function db2_field_scale($stmt, $column) {} +function db2_field_scale($stmt, int|string $column): int|false {} /** * Returns the data type of the indicated column in a result set @@ -1400,7 +1400,7 @@ function db2_field_scale($stmt, $column) {} * @param resource $stmt

    * Specifies a statement resource containing a result set. *

    - * @param mixed $column

    + * @param int|string $column

    * Specifies the column in the result set. This can either be an integer * representing the 0-indexed position of the column, or a string * containing the name of the column. @@ -1409,7 +1409,7 @@ function db2_field_scale($stmt, $column) {} * If the specified column does not exist in the result set, * db2_field_type returns false. */ -function db2_field_type($stmt, $column) {} +function db2_field_type($stmt, int|string $column): string|false {} /** * Returns the width of the current value of the indicated column in a result set @@ -1417,7 +1417,7 @@ function db2_field_type($stmt, $column) {} * @param resource $stmt

    * Specifies a statement resource containing a result set. *

    - * @param mixed $column

    + * @param int|string $column

    * Specifies the column in the result set. This can either be an integer * representing the 0-indexed position of the column, or a string * containing the name of the column. @@ -1427,7 +1427,7 @@ function db2_field_type($stmt, $column) {} * exist in the result set, db2_field_width returns * false. */ -function db2_field_width($stmt, $column) {} +function db2_field_width($stmt, int|string $column): int|false {} /** * Returns the cursor type used by a statement resource @@ -1439,7 +1439,7 @@ function db2_field_width($stmt, $column) {} * resource uses a forward-only cursor or DB2_SCROLLABLE if * the statement resource uses a scrollable cursor. */ -function db2_cursor_type($stmt) {} +function db2_cursor_type($stmt): int {} /** * Rolls back a transaction @@ -1450,7 +1450,7 @@ function db2_cursor_type($stmt) {} *

    * @return bool true on success or false on failure. */ -function db2_rollback($connection) {} +function db2_rollback($connection): bool {} /** * Frees resources associated with the indicated statement resource @@ -1460,7 +1460,7 @@ function db2_rollback($connection) {} *

    * @return bool true on success or false on failure. */ -function db2_free_stmt($stmt) {} +function db2_free_stmt($stmt): bool {} /** * Returns a single column from a row in the result set @@ -1468,14 +1468,14 @@ function db2_free_stmt($stmt) {} * @param resource $stmt

    * A valid stmt resource. *

    - * @param mixed $column

    + * @param int|string $column

    * Either an integer mapping to the 0-indexed field in the result set, or * a string matching the name of the column. *

    * @return mixed the value of the requested field if the field exists in the result * set. Returns NULL if the field does not exist, and issues a warning. */ -function db2_result($stmt, $column) {} +function db2_result($stmt, int|string $column): mixed {} /** * Sets the result set pointer to the next row or requested row @@ -1490,7 +1490,7 @@ function db2_result($stmt, $column) {} * @return bool true if the requested row exists in the result set. Returns * false if the requested row does not exist in the result set. */ -function db2_fetch_row($stmt, $row_number = null) {} +function db2_fetch_row($stmt, int $row_number = null) {} /** * Returns an array, indexed by column name, representing a row in a result set @@ -1508,7 +1508,7 @@ function db2_fetch_row($stmt, $row_number = null) {} * there are no rows left in the result set, or if the row requested by * row_number does not exist in the result set. */ -function db2_fetch_assoc($stmt, $row_number = null) {} +function db2_fetch_assoc($stmt, int $row_number = null): array|false {} /** * Returns an array, indexed by column position, representing a row in a result set @@ -1526,7 +1526,7 @@ function db2_fetch_assoc($stmt, $row_number = null) {} * there are no rows left in the result set, or if the row requested by * row_number does not exist in the result set. */ -function db2_fetch_array($stmt, $row_number = null) {} +function db2_fetch_array($stmt, int $row_number = null): array|false {} /** * Returns an array, indexed by both column name and position, representing a row in a result set @@ -1545,7 +1545,7 @@ function db2_fetch_array($stmt, $row_number = null) {} * in the result set, or if the row requested by * row_number does not exist in the result set. */ -function db2_fetch_both($stmt, $row_number = null) {} +function db2_fetch_both($stmt, int $row_number = null): array|false {} /** * Frees resources associated with a result set @@ -1555,7 +1555,7 @@ function db2_fetch_both($stmt, $row_number = null) {} *

    * @return bool true on success or false on failure. */ -function db2_free_result($stmt) {} +function db2_free_result($stmt): bool {} /** * Set options for connection or statement resources @@ -1596,9 +1596,9 @@ function db2_free_result($stmt) {} *

    * @return bool true on success or false on failure. */ -function db2_set_option($resource, array $options, $type) {} +function db2_set_option($resource, array $options, int $type): bool {} -function db2_setoption() {} +function db2_setoption(): bool {} /** * Returns an object with properties representing columns in the fetched row @@ -1611,7 +1611,7 @@ function db2_setoption() {} * parameter results in a PHP warning if the result set uses a * forward-only cursor. *

    - * @return object|false An object representing a single row in the result set. The + * @return stdClass|false An object representing a single row in the result set. The * properties of the object map to the names of the columns in the result set. *

    *

    @@ -1628,7 +1628,7 @@ function db2_setoption() {} *

    * Returns false if no row was retrieved. */ -function db2_fetch_object($stmt, $row_number = null) {} +function db2_fetch_object($stmt, int $row_number = null): stdClass|false {} /** * Returns an object with properties that describe the DB2 database server @@ -1636,9 +1636,9 @@ function db2_fetch_object($stmt, $row_number = null) {} * @param resource $connection

    * Specifies an active DB2 client connection. *

    - * @return object|false An object on a successful call. Returns false on failure. + * @return stdClass|false An object on a successful call. Returns false on failure. */ -function db2_server_info($connection) {} +function db2_server_info($connection): stdClass|false {} /** * Returns an object with properties that describe the DB2 database client @@ -1646,9 +1646,9 @@ function db2_server_info($connection) {} * @param resource $connection

    * Specifies an active DB2 client connection. *

    - * @return object|false An object on a successful call. Returns false on failure. + * @return stdClass|false An object on a successful call. Returns false on failure. */ -function db2_client_info($connection) {} +function db2_client_info($connection): stdClass|false {} /** * Used to escape certain characters @@ -1662,7 +1662,7 @@ function db2_client_info($connection) {} * @return string string_literal with the special characters * noted above prepended with backslashes. */ -function db2_escape_string($string_literal) {} +function db2_escape_string(string $string_literal): string {} /** * Gets a user defined size of LOB files with each invocation @@ -1679,7 +1679,7 @@ function db2_escape_string($string_literal) {} * @return string|false The amount of data the user specifies. Returns * false if the data cannot be retrieved. */ -function db2_lob_read($stmt, $colnum, $length) {} +function db2_lob_read($stmt, int $colnum, int $length): string|false {} /** * Retrieves an option value for a statement resource or a connection resource @@ -1720,7 +1720,7 @@ function db2_lob_read($stmt, $colnum, $length) {} * @return string|false The current setting of the connection attribute provided on success * or false on failure. */ -function db2_get_option($resource, $option) {} +function db2_get_option($resource, string $option): string|false {} /** * Returns the auto generated ID of the last insert query that successfully executed on this connection. @@ -1736,7 +1736,7 @@ function db2_get_option($resource, $option) {} * @return string|null Returns the auto generated ID of last insert query that successfully executed on this connection * or NULL if no ID was found. */ -function db2_last_insert_id($resource) {} +function db2_last_insert_id($resource): ?string {} /** * Specifies that binary data shall be returned as is. This is the default From 412835dca173b2ca9297977552971ddea6aaaec9 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Wed, 15 Mar 2023 08:29:23 -0300 Subject: [PATCH 303/419] [ibm_db2] Argument 1 in `db2_connect()` and `db2_pconnect()` can contain the connection password --- ibm_db2/ibm_db2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ibm_db2/ibm_db2.php b/ibm_db2/ibm_db2.php index 94b829b65..b074a0baf 100644 --- a/ibm_db2/ibm_db2.php +++ b/ibm_db2/ibm_db2.php @@ -40,7 +40,7 @@ * successful. If the connection attempt fails, db2_connect * returns false. */ -function db2_connect(string $database, ?string $username, #[\SensitiveParameter] ?string $password, array $options = []) {} +function db2_connect(#[\SensitiveParameter] string $database, ?string $username, #[\SensitiveParameter] ?string $password, array $options = []) {} /** * Commits a transaction @@ -95,7 +95,7 @@ function db2_commit($connection): bool {} * password parameters. If the connection attempt fails, * db2_pconnect returns false. */ -function db2_pconnect(string $database, ?string $username, #[\SensitiveParameter] ?string $password, array $options = []) {} +function db2_pconnect(#[\SensitiveParameter] string $database, ?string $username, #[\SensitiveParameter] ?string $password, array $options = []) {} /** * Returns or sets the AUTOCOMMIT state for a database connection From 128d12d8a60028d35515f2efa028406b2a27efe2 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 11:39:06 +0100 Subject: [PATCH 304/419] [phpstorm-stubs] fix return type in \Redis::getSet --- redis/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.php b/redis/Redis.php index 9fecfcaa5..6c743a9a4 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -2126,7 +2126,7 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0) {} * @param string $key * @param mixed $value * - * @return string|mixed||false|Redis A string (mixed, if used serializer), the previous value located at this key or false if it didn't exist or Redis if in multimode + * @return string|mixed|false|Redis A string (mixed, if used serializer), the previous value located at this key or false if it didn't exist or Redis if in multimode * * @throws RedisException * From c25fde9dfd37f9d9dec8d8d0229a7c276ff4d213 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 11:47:37 +0100 Subject: [PATCH 305/419] [phpstorm-stubs] run PhpDoc tests in a separate task --- .github/workflows/main.yml | 3 +++ phpunit.xml.dist | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79e52172b..679d22906 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,9 @@ jobs: - name: Composer Install run: docker-compose -f docker-compose.yml run test_runner composer install + - name: Test PhpDoc + run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite PhpDoc + - name: Test Stubs Map, Structure and Reflection run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Structure diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 58866f106..2f1b27673 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,7 +7,6 @@ tests/BaseFunctionsTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php - tests/StubsPhpDocTest.php tests/BaseClassesTest.php @@ -15,7 +14,6 @@ tests/BaseFunctionsTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php - tests/StubsPhpDocTest.php tests/BaseClassesTest.php @@ -23,7 +21,6 @@ tests/BaseFunctionsTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php - tests/StubsPhpDocTest.php tests/StubsForbiddenTypeHintsTest.php @@ -32,7 +29,6 @@ tests/BaseFunctionsTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php - tests/StubsPhpDocTest.php tests/StubsForbiddenTypeHintsTest.php @@ -41,7 +37,6 @@ tests/BaseFunctionsTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php - tests/StubsPhpDocTest.php tests/StubsForbiddenTypeHintsTest.php @@ -50,7 +45,6 @@ tests/BaseFunctionsTest.php tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php - tests/StubsPhpDocTest.php tests/StubsForbiddenTypeHintsTest.php @@ -60,7 +54,6 @@ tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php tests/StubsParameterNamesTest.php - tests/StubsPhpDocTest.php tests/StubsTypeHintsTest.php tests/StubsForbiddenTypeHintsTest.php @@ -71,7 +64,6 @@ tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php tests/StubsParameterNamesTest.php - tests/StubsPhpDocTest.php tests/StubsTypeHintsTest.php tests/StubsForbiddenTypeHintsTest.php tests/StubsPhp81Tests.php @@ -84,7 +76,6 @@ tests/StubsMetaExpectedArgumentsTest.php tests/StubsMetaInternalTagTest.php tests/StubsParameterNamesTest.php - tests/StubsPhpDocTest.php tests/StubsTypeHintsTest.php tests/StubsForbiddenTypeHintsTest.php tests/StubsPhp81Tests.php From 6335ff85f2e5746d06725ab04680dd10dcf1fffe Mon Sep 17 00:00:00 2001 From: Quentin Dreyer Date: Fri, 24 Mar 2023 10:50:53 +0100 Subject: [PATCH 306/419] chore: add PDO::sqliteCreateAggregate + PDO::sqliteCreateCollation --- PDO/PDO.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/PDO/PDO.php b/PDO/PDO.php index bed6f480d..2ce293250 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1282,6 +1282,40 @@ final public function __sleep() {} #[TentativeType] public static function getAvailableDrivers(): array {} + /** + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo_sqlite >= 1.0.0)
    + * Registers an aggregating User Defined Function for use in SQL statements + * @link https://php.net/manual/en/pdo.sqlitecreateaggregate.php + * @param string $function_name

    + * The name of the function used in SQL statements. + *

    + * @param callable $step_func

    + * Callback function called for each row of the result set. Your PHP function should accumulate the result and store it in the aggregation context. + *

    + * @param callable $finalize_func

    + * Callback function to aggregate the "stepped" data from each row. Once all the rows have been processed, this function will be called and it should then take the data from the aggregation context and return the result. This callback function should return a type understood by SQLite (i.e. scalar type). + *

    + * @param int $num_args [optional]

    + * Hint to the SQLite parser if the callback function accepts a predetermined number of arguments. + *

    + * @return bool TRUE on success or FALSE on failure. + */ + public function sqliteCreateAggregate($function_name, $step_func, $finalyze_func, $num_args = -1) {} + + /** + * (PHP 5 >= 5.3.11, PHP 7)
    + * Registers a User Defined Function for use as a collating function in SQL statements + * @link https://php.net/manual/en/pdo.sqlitecreatecollation.php + * @param string $name

    + * Name of the SQL collating function to be created or redefined. + *

    + * @param callable $callback

    + * The name of a PHP function or user-defined function to apply as a callback, defining the behavior of the collation. It should accept two strings and return as strcmp() does, i.e. it should return -1, 1, or 0 if the first string sorts before, sorts after, or is equal to the second. + *

    + * @return bool TRUE on success or FALSE on failure. + */ + public function sqliteCreateCollation($name, $callback) {} + /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo_sqlite >= 1.0.0)
    * Registers a User Defined Function for use in SQL statements From abc15f346a938195aac7b2cb5a633d761b7a6e3c Mon Sep 17 00:00:00 2001 From: Quentin Dreyer Date: Fri, 24 Mar 2023 10:52:27 +0100 Subject: [PATCH 307/419] chore: fix typo --- PDO/PDO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PDO/PDO.php b/PDO/PDO.php index 2ce293250..98c06135a 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1300,7 +1300,7 @@ public static function getAvailableDrivers(): array {} *

    * @return bool TRUE on success or FALSE on failure. */ - public function sqliteCreateAggregate($function_name, $step_func, $finalyze_func, $num_args = -1) {} + public function sqliteCreateAggregate($function_name, $step_func, $finalize_func, $num_args = -1) {} /** * (PHP 5 >= 5.3.11, PHP 7)
    From 49b1bfef502a7a8b433fc57a19215b8a522cafe1 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 12:19:11 +0100 Subject: [PATCH 308/419] [phpstorm-stubs] fix testSignatureTypeHintsConformPhpDocInMethods --- tests/StubsTypeHintsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/StubsTypeHintsTest.php b/tests/StubsTypeHintsTest.php index 27ce38d3f..0ecbf54c6 100644 --- a/tests/StubsTypeHintsTest.php +++ b/tests/StubsTypeHintsTest.php @@ -208,8 +208,8 @@ public static function testSignatureTypeHintsConformPhpDocInMethods(PHPFunction| } } - // replace array notations like int[] or array to match the array type - return preg_replace(['/\w+\[]/', '/array<[a-z,\s]+>/'], 'array', $typeName); + // replace array notations like int[] or array or array{name:type} to match the array type + return preg_replace(['/\w+\[]/', '/array[{<][a-z,\s:|_]+[>}]/'], 'array', $typeName); }, $method->returnTypesFromPhpDoc); $unifiedSignatureTypes = array_map(function (string $type) { $typeParts = explode('\\', $type); From f75cc849761ea233107abc247f4f7f84d123fd01 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 12:19:59 +0100 Subject: [PATCH 309/419] [phpstorm-stubs] remove duplicated functions --- redis/Redis.php | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index 6c743a9a4..3eca483d0 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -3989,52 +3989,6 @@ public function bzPopMax($key_or_keys, $timeout_or_key, ...$extra_args) {} */ public function bzPopMin($key_or_keys, $timeout_or_key, ...$extra_args) {} - /** - * Can pop the highest scoring members from one ZSET. - * - * @param string $key - * @param int|null $count - * - * @return array|Redis Either an array with the key member and score of the highest element or an empty array or Redis if in multimode - * if there is no element to pop. - * - * @throws RedisException - * - * @since >= 5.0 - * @link https://redis.io/commands/zpopmax - * @example - *
    -     * // Pop the *lowest* scoring member from set `zs1`.
    -     * $redis->zPopMax('zs1');
    -     * // Pop the *lowest* 3 scoring member from set `zs1`.
    -     * $redis->zPopMax('zs1', 3);
    -     * 
    - */ - public function zPopMax($key, $count = null) {} - - /** - * Can pop the lowest scoring members from one ZSET. - * - * @param string $key - * @param int|null $count - * - * @return array|Redis Either an array with the key member and score of the lowest element or an empty array or Redis if in multimode - * if there is no element to pop. - * - * @throws RedisException - * - * @since >= 5.0 - * @link https://redis.io/commands/zpopmin - * @example - *
    -     * // Pop the *lowest* scoring member from set `zs1`.
    -     * $redis->zPopMin('zs1');
    -     * // Pop the *lowest* 3 scoring member from set `zs1`.
    -     * $redis->zPopMin('zs1', 3);
    -     * 
    - */ - public function zPopMin($key, $count = null) {} - /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. * From 3de1cd0ff9225ee2810a2f15f0c8f039d9e88a1b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 12:55:46 +0100 Subject: [PATCH 310/419] [phpstorm-stubs] fix return types of methods of ReflectionFiber --- Reflection/ReflectionFiber.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reflection/ReflectionFiber.php b/Reflection/ReflectionFiber.php index f590fa197..1b4c86c0f 100644 --- a/Reflection/ReflectionFiber.php +++ b/Reflection/ReflectionFiber.php @@ -9,9 +9,9 @@ public function __construct(Fiber $fiber) {} public function getFiber(): Fiber {} - public function getExecutingFile(): string {} + public function getExecutingFile(): ?string {} - public function getExecutingLine(): int {} + public function getExecutingLine(): ?int {} public function getCallable(): callable {} From 8fb00e53e3c6f51200a5f08adac8a1d507b43554 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 13:09:16 +0100 Subject: [PATCH 311/419] [phpstorm-stubs] update stubs according to PHP 8.2 changes --- curl/curl_d.php | 2 +- gmp/gmp.php | 9 +++++++-- random/random.php | 9 +++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/curl/curl_d.php b/curl/curl_d.php index 41873d6a5..233e564bc 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -2272,7 +2272,7 @@ * @link https://php.net/manual/en/curl.constants.php * @since 7.0.7 */ -define('CURL_MAX_READ_SIZE', 524288); +define('CURL_MAX_READ_SIZE', 10485760); /** * Enables the use of an abstract Unix domain socket instead of establishing a TCP connection to a host and sets the path to the given string. diff --git a/gmp/gmp.php b/gmp/gmp.php index aa30438f2..37266e501 100644 --- a/gmp/gmp.php +++ b/gmp/gmp.php @@ -800,6 +800,11 @@ function gmp_perfect_power(GMP|string|int $num): bool {} class GMP implements Serializable { + /** + * @since 8.2 + */ + public function __construct(int|string $num = 0, int $base = 0) {} + /** * String representation of object * @link https://php.net/manual/en/serializable.serialize.php @@ -812,12 +817,12 @@ public function __serialize(): array {} /** * Constructs the object * @link https://php.net/manual/en/serializable.unserialize.php - * @param string $serialized

    + * @param string $data

    * The string representation of the object. *

    * @return void */ - public function unserialize($serialized) {} + public function unserialize($data) {} public function __unserialize(array $data): void {} } diff --git a/random/random.php b/random/random.php index 0c1381119..0782145c5 100644 --- a/random/random.php +++ b/random/random.php @@ -1,6 +1,7 @@ + * @param int|null $seed

    * An optional seed value *

    * @param int $mode [optional]

    @@ -23,7 +24,7 @@ function lcg_value(): float {} * @return void */ function mt_srand( - int $seed = 0, + #[LanguageLevelTypeAware(['8.2' => 'int|null'], default: 'int')] $seed = null, #[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937 ): void {} @@ -33,7 +34,7 @@ function mt_srand( * an alias of {@see mt_srand()}. *

    * @link https://php.net/manual/en/function.srand.php - * @param int $seed

    + * @param int|null $seed

    * Optional seed value *

    * @param int $mode [optional]

    @@ -42,7 +43,7 @@ function mt_srand( * @return void */ function srand( - int $seed = 0, + #[LanguageLevelTypeAware(['8.2' => 'int|null'], default: 'int')] $seed = null, #[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937 ): void {} From 3589c3cb7f5933001d589b0471dea01ddd051e0c Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 13:26:10 +0100 Subject: [PATCH 312/419] [phpstorm-stubs] fix typehint mt_srand, srand --- random/random.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/random/random.php b/random/random.php index 0782145c5..19ad9bcc3 100644 --- a/random/random.php +++ b/random/random.php @@ -15,7 +15,7 @@ function lcg_value(): float {} /** * Seeds the Mersenne Twister Random Number Generator * @link https://php.net/manual/en/function.mt-srand.php - * @param int|null $seed

    + * @param int $seed

    * An optional seed value *

    * @param int $mode [optional]

    @@ -24,7 +24,7 @@ function lcg_value(): float {} * @return void */ function mt_srand( - #[LanguageLevelTypeAware(['8.2' => 'int|null'], default: 'int')] $seed = null, + int $seed = null, #[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937 ): void {} @@ -34,7 +34,7 @@ function mt_srand( * an alias of {@see mt_srand()}. *

    * @link https://php.net/manual/en/function.srand.php - * @param int|null $seed

    + * @param int $seed

    * Optional seed value *

    * @param int $mode [optional]

    @@ -43,7 +43,7 @@ function mt_srand( * @return void */ function srand( - #[LanguageLevelTypeAware(['8.2' => 'int|null'], default: 'int')] $seed = null, + int $seed = null, #[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937 ): void {} From 4a9c2952d127aa4efd2eb9142b3335d0b7f4e82e Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 24 Mar 2023 13:30:17 +0100 Subject: [PATCH 313/419] [phpstorm-stubs] fix cs-fixer --- random/random.php | 1 - 1 file changed, 1 deletion(-) diff --git a/random/random.php b/random/random.php index 19ad9bcc3..d4201eb78 100644 --- a/random/random.php +++ b/random/random.php @@ -1,7 +1,6 @@ Date: Fri, 31 Mar 2023 16:33:46 -0700 Subject: [PATCH 314/419] relay v0.6.2 --- relay/Event.php | 8 +++ relay/Relay.php | 152 +++++++++++++++++++++++++++--------------------- 2 files changed, 94 insertions(+), 66 deletions(-) diff --git a/relay/Event.php b/relay/Event.php index 977b5ef00..7a37e2b86 100644 --- a/relay/Event.php +++ b/relay/Event.php @@ -48,4 +48,12 @@ final class Event * @var mixed */ public mixed $key = null; + + /** + * Whether the invalidation was created in the client or + * originated from a Redis PUSH message. + * + * @var bool + */ + public bool $client; } diff --git a/relay/Relay.php b/relay/Relay.php index 9cf3b23c3..3b883a13b 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -12,14 +12,14 @@ class Relay * * @var string */ - public const VERSION = "0.6.0"; + public const VERSION = "0.6.2"; /** * Relay's version. * * @var string */ - public const Version = "0.6.0"; + public const Version = "0.6.2"; /** * Integer representing no compression algorithm. @@ -181,7 +181,9 @@ class Relay /** * Integer representing the PhpRedis compatibility mode option. * - * Returns `false` instead of `null` if a key doesn’t exist and will throw an exception if there is an error. + * Enabled by default. Disabling will cause Relay to: + * 1. Return `null` when a key doesn't exist, instead of `false` + * 2. Throw exceptions when an error occurs, instead of returning `false` * * @var int */ @@ -223,7 +225,21 @@ class Relay public const OPT_NULL_MULTIBULK_AS_NULL = 10; /** - * Integer representing Relay’s invalidations option. + * Integer representing the throw-on-error option. + * + * Disabled by default. When enabled, Relay will throw exceptions when errors occur. + * + * @var int + */ + public const OPT_THROW_ON_ERROR = 105; + + /** + * Integer representing Relay’s invalidation option. + * + * Enabled by default. When disabled will prevent Relay from + * performing instantaneous client-side invalidation when a key + * is changed without waiting for Redis to send an `INVALIDATE` + * message. The invalidation occurs only in the same FPM pool. * * @var int */ @@ -232,6 +248,9 @@ class Relay /** * Integer representing Relay’s allow patterns option. * + * When set only keys matching these patterns will be cached, + * unless they also match an `OPT_IGNORE_PATTERNS`. + * * @var int */ public const OPT_ALLOW_PATTERNS = 102; @@ -239,12 +258,14 @@ class Relay /** * Integer representing Relay’s ignore patterns option. * + * When set keys matching these patterns will not be cached. + * * @var int */ public const OPT_IGNORE_PATTERNS = 103; /** - * Whether or not to read/write to our in-memory cache + * Whether use in-memory caching. Enabled by default. * * @var int */ @@ -390,7 +411,7 @@ public function __construct( float $command_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0, - ) {} + ); /** * Establishes a new connection to Redis. @@ -399,7 +420,7 @@ public function __construct( * @param string $host * @param int $port * @param float $timeout - * @param string $persistent_id + * @param string|null $persistent_id * @param int $retry_interval * @param float $read_timeout * @param array $context @@ -416,7 +437,7 @@ public function connect( float $read_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0 - ): bool {} + ): bool {} {} /** * Establishes a persistent connection to Redis. @@ -424,7 +445,7 @@ public function connect( * @param string $host * @param int $port * @param float $timeout - * @param string $persistent_id + * @param string|null $persistent_id * @param int $retry_interval * @param float $read_timeout * @param array $context @@ -481,7 +502,7 @@ public function onFlushed(?callable $callback): bool {} * Registers a new `invalidated` event listener. * * @param callable $callback - * @param string $pattern + * @param string|null $pattern * @return bool */ #[\Relay\Attributes\Local] @@ -519,12 +540,13 @@ public function option(int $option, mixed $value = null): mixed {} * * Relay specific options: * - * - `OPT_ALLOW_PATTERNS`: When set only keys matching these patterns will be cached, unless they match `OPT_IGNORE_PATTERNS`. - * - `OPT_IGNORE_PATTERNS`: When set keys matching these patterns will not be cached. - * - `OPT_CLIENT_INVALIDATIONS`: When set to `true` Relay will ignore all invalidations coming from Redis - * - `OPT_PHPREDIS_COMPATIBILITY`: When set to `true` Relay will return `false` for non-existent keys instead of `null` + * - `OPT_ALLOW_PATTERNS` + * - `OPT_IGNORE_PATTERNS` + * - `OPT_THROW_ON_ERROR` + * - `OPT_CLIENT_INVALIDATIONS` + * - `OPT_PHPREDIS_COMPATIBILITY` * - * Available options for PhpRedis compatibility: + * Supported PhpRedis options: * * - `OPT_PREFIX` * - `OPT_READ_TIMEOUT` @@ -546,7 +568,7 @@ public function option(int $option, mixed $value = null): mixed {} public function setOption(int $option, mixed $value): bool {} /** - * Add a patterns to ignore. + * Adds ignore pattern(s). Matching keys will not be cached in memory. * * @param string $pattern,... * @return int @@ -555,7 +577,7 @@ public function setOption(int $option, mixed $value): bool {} public function addIgnorePatterns(string ...$pattern): int {} /** - * Add a patterns to allow. + * Adds allow pattern(s). Only matching keys will be cached in memory. * * @param string $pattern,... * @return int @@ -572,9 +594,7 @@ public function addAllowPatterns(string ...$pattern): int {} public function getTimeout(): float|false {} /** - * Returns the connection timeout. - * - * @see Relay\Relay::getTimeout() Alias. + * @alias Relay\Relay::getTimeout * * @return float|false */ @@ -590,9 +610,7 @@ public function timeout(): float|false {} public function getReadTimeout(): float|false {} /** - * Returns the read timeout. - * - * @see Relay::getReadTimeout() Alias. + * @alias Relay\Relay::getReadTimeout * * @return float|false */ @@ -609,10 +627,7 @@ public function readTimeout(): float|false {} public function getBytes(): array {} /** - * Returns the number of bytes sent and received over the network during the Relay object's - * lifetime, or since the last time {@link Relay::clearBytes()} was called. - * - * @see Relay::getBytes() Alias. + * @alias Relay\Relay::getBytes * * @return array{int, int} */ @@ -748,9 +763,7 @@ public function clearLastError(): bool {} public function endpointId(): string|false {} /** - * Returns the connection's endpoint identifier. - * - * @see Relay\Relay::endpointId() Alias. + * @alias Relay\Relay::endpointId * * @return string|false */ @@ -764,14 +777,6 @@ public function getPersistentID(): string|false {} #[\Relay\Attributes\Local] public function socketId(): string|false {} - /** - * Returns information about the license. - * - * @return array - */ - #[\Relay\Attributes\Http] - public static function license(): array {} - /** * Returns statistics about Relay. * @@ -886,25 +891,25 @@ public function flushall(bool $async = false): Relay|bool {} * Invokes a Redis function. * * @param string $name - * @param array $argv * @param array $keys + * @param array $argv * @param callable $handler * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function fcall(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed {} + public function fcall(string $name, array $keys = [], array $argv = [], callable $handler = null): mixed {} /** * Invokes a read-only Redis function. * * @param string $name - * @param array $argv * @param array $keys + * @param array $argv * @param callable $handler * @return mixed */ #[\Relay\Attributes\RedisCommand] - public function fcall_ro(string $name, array $argv = [], array $keys = [], callable $handler = null): mixed {} + public function fcall_ro(string $name, array $keys = [], array $argv = [], callable $handler = null): mixed {} /** * Calls `FUNCTION` sub-command. @@ -917,13 +922,17 @@ public function fcall_ro(string $name, array $argv = [], array $keys = [], calla public function function(string $op, string ...$args): mixed {} /** - * Flushes Relay's internal memory of all databases, or just the given database index. + * Flushes Relay's in-memory cache of all databases. + * When given an endpoint, only that connection will be flushed. + * When given an endpoint and database index, only that database + * for that connection will be flushed. * - * @param int $db + * @param string|null $endpointId + * @param int|null $db * @return bool */ #[\Relay\Attributes\Local] - public static function flushMemory(?string $key = null, int $db = -1): bool {} + public static function flushMemory(?string $endpointId = null, int $db = null): bool {} /** * Returns the number of keys in the currently-selected database. @@ -945,7 +954,7 @@ public function dump(mixed $key): Relay|string|false {} /** * Attach or detach the instance as a replica of another instance. * - * @param string $host + * @param string|null $host * @param int $port * @return Relay|bool */ @@ -1061,10 +1070,11 @@ public function lastsave(): Relay|int|false {} /** * Asynchronously save the dataset to disk. * + * @param bool $schedule * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] - public function bgsave(): Relay|bool {} + public function bgsave(bool $schedule = false): Relay|bool {} /** * Synchronously save the dataset to disk. @@ -1377,7 +1387,7 @@ public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit * * @param string $operation * @param mixed $key - * @param string $value + * @param string|null $value * @return Relay|array|bool */ #[\Relay\Attributes\RedisCommand] @@ -1513,7 +1523,7 @@ public function pfadd(string $key, array $elements): Relay|int|false {} * @return Relay|int */ #[\Relay\Attributes\RedisCommand] - public function pfcount(string $key): Relay|int {} + public function pfcount(string $key): Relay|int|false {} /** * Merge given HyperLogLogs into a single one. @@ -1640,7 +1650,7 @@ public function unlink(mixed ...$keys): Relay|int|false {} * * @param mixed $key * @param int $seconds - * @param string $mode + * @param string|null $mode * @return Relay|bool */ #[\Relay\Attributes\RedisCommand] @@ -2230,7 +2240,7 @@ public function incrbyfloat(mixed $key, float $value): Relay|float|false {} * @param mixed $other_keys,... * @return Relay|array|false */ - #[\Relay\Attributes\RedisCommand] + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function sdiff(mixed $key, mixed ...$other_keys): Relay|array|false {} /** @@ -2251,7 +2261,7 @@ public function sdiffstore(mixed $key, mixed ...$other_keys): Relay|int|false {} * @param mixed $other_keys,... * @return Relay|array|false */ - #[\Relay\Attributes\RedisCommand] + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function sinter(mixed $key, mixed ...$other_keys): Relay|array|false {} /** @@ -2261,7 +2271,7 @@ public function sinter(mixed $key, mixed ...$other_keys): Relay|array|false {} * @param int $limit * @return Relay|int|false */ - #[\Relay\Attributes\RedisCommand] + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function sintercard(array $keys, int $limit = -1): Relay|int|false {} /** @@ -2282,7 +2292,7 @@ public function sinterstore(mixed $key, mixed ...$other_keys): Relay|int|false { * @param mixed $other_keys,... * @return Relay|array|false */ - #[\Relay\Attributes\RedisCommand] + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function sunion(mixed $key, mixed ...$other_keys): Relay|array|false {} /** @@ -2396,7 +2406,7 @@ public function clearBytes(): void {} * @param mixed $iterator * @param mixed $match * @param int $count - * @param string $type + * @param string|null $type * @return array|false */ #[\Relay\Attributes\RedisCommand] @@ -2556,7 +2566,7 @@ public function spop(mixed $set, int $count = 1): mixed {} * @param int $count * @return mixed */ - #[\Relay\Attributes\RedisCommand] + #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function srandmember(mixed $set, int $count = 1): mixed {} /** @@ -2723,8 +2733,8 @@ public function xdel(string $key, array $ids): Relay|int|false {} * Retrieve information about a stream key. * * @param string $operation - * @param string $arg1 - * @param string $arg2 + * @param string|null $arg1 + * @param string|null $arg2 * @param int $count * @return mixed */ @@ -2736,10 +2746,10 @@ public function xinfo(string $operation, ?string $arg1 = null, ?string $arg2 = n * * @param string $key * @param string $group - * @param string $start - * @param string $end + * @param string|null $start + * @param string|null $end * @param int $count - * @param string $consumer + * @param string|null $consumer * @param int $idle * @return Relay|array|false */ @@ -2949,10 +2959,11 @@ public function zrevrangebylex(mixed $key, mixed $max, mixed $min, int $offset = * * @param mixed $key * @param mixed $rank - * @return Relay|int|false + * @param bool $withscore + * @return Relay|array|int|false */ #[\Relay\Attributes\RedisCommand] - public function zrank(mixed $key, mixed $rank): Relay|int|false {} + public function zrank(mixed $key, mixed $rank, bool $withscore = false): Relay|array|int|false {} /** * Returns the rank of member in the sorted set stored at key, with the scores @@ -2961,10 +2972,11 @@ public function zrank(mixed $key, mixed $rank): Relay|int|false {} * * @param mixed $key * @param mixed $rank - * @return Relay|int|false + * @param bool $withscore + * @return Relay|array|int|false */ #[\Relay\Attributes\RedisCommand] - public function zrevrank(mixed $key, mixed $rank): Relay|int|false {} + public function zrevrank(mixed $key, mixed $rank, bool $withscore = false): Relay|array|int|false {} /** * Removes the specified members from the sorted set stored at key. @@ -3191,5 +3203,13 @@ public function zpopmax(mixed $key, int $count = 1): Relay|array|false {} * @return mixed */ #[\Relay\Attributes\Local] - public function _getKeys() {} + public function _getKeys(); + + /** + * Returns information about the license. + * + * @return array + */ + #[\Relay\Attributes\Local] + public static function license(): array {} } From ac9000559e0b2c852bfeef1d21d268dd4b848644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Fri, 31 Mar 2023 16:36:33 -0700 Subject: [PATCH 315/419] fix brackets --- relay/Relay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/Relay.php b/relay/Relay.php index 3b883a13b..cebf3542b 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -437,7 +437,7 @@ public function connect( float $read_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0 - ): bool {} {} + ): bool {} /** * Establishes a persistent connection to Redis. From f3f99ac06419def834dd993a513ce88dd3e725c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Fri, 31 Mar 2023 16:39:03 -0700 Subject: [PATCH 316/419] drop `@alias` --- relay/Relay.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index cebf3542b..4ea6b5ccf 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -594,7 +594,7 @@ public function addAllowPatterns(string ...$pattern): int {} public function getTimeout(): float|false {} /** - * @alias Relay\Relay::getTimeout + * @see Relay\Relay::getTimeout() * * @return float|false */ @@ -610,7 +610,7 @@ public function timeout(): float|false {} public function getReadTimeout(): float|false {} /** - * @alias Relay\Relay::getReadTimeout + * @see Relay\Relay::getReadTimeout() * * @return float|false */ @@ -627,7 +627,7 @@ public function readTimeout(): float|false {} public function getBytes(): array {} /** - * @alias Relay\Relay::getBytes + * @see Relay\Relay::getBytes() * * @return array{int, int} */ From 8ca0125343045500617ac1008d8d975e82fc47d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Fri, 31 Mar 2023 18:45:40 -0700 Subject: [PATCH 317/419] remove another alias --- relay/Relay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/Relay.php b/relay/Relay.php index 4ea6b5ccf..279760bd5 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -763,7 +763,7 @@ public function clearLastError(): bool {} public function endpointId(): string|false {} /** - * @alias Relay\Relay::endpointId + * @see Relay\Relay::endpointId() * * @return string|false */ From 984e7a2dc085e5e5ed7247f729ad27ec071e4a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Fri, 31 Mar 2023 18:47:26 -0700 Subject: [PATCH 318/419] fix syntax --- relay/Relay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/Relay.php b/relay/Relay.php index 279760bd5..24004fe67 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -411,7 +411,7 @@ public function __construct( float $command_timeout = 0.0, #[\SensitiveParameter] array $context = [], int $database = 0, - ); + ) {} /** * Establishes a new connection to Redis. From c10a3f796c744b5b8654f2ad6140193f73982b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Fri, 31 Mar 2023 19:09:37 -0700 Subject: [PATCH 319/419] move method --- relay/Relay.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/relay/Relay.php b/relay/Relay.php index 24004fe67..d6495b43b 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -777,6 +777,14 @@ public function getPersistentID(): string|false {} #[\Relay\Attributes\Local] public function socketId(): string|false {} + /** + * Returns information about the license. + * + * @return array + */ + #[\Relay\Attributes\Local] + public static function license(): array {} + /** * Returns statistics about Relay. * @@ -3204,12 +3212,4 @@ public function zpopmax(mixed $key, int $count = 1): Relay|array|false {} */ #[\Relay\Attributes\Local] public function _getKeys(); - - /** - * Returns information about the license. - * - * @return array - */ - #[\Relay\Attributes\Local] - public static function license(): array {} } From ea1bfef00f9c0f40170b24413dff432cf01d7671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Fri, 31 Mar 2023 19:13:20 -0700 Subject: [PATCH 320/419] syntax --- relay/Relay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/Relay.php b/relay/Relay.php index d6495b43b..2cca4c6a5 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -3211,5 +3211,5 @@ public function zpopmax(mixed $key, int $count = 1): Relay|array|false {} * @return mixed */ #[\Relay\Attributes\Local] - public function _getKeys(); + public function _getKeys() {} } From 09dcdf1a0cdc149aa85c6523f8723f703b675e82 Mon Sep 17 00:00:00 2001 From: Sketch Date: Sun, 2 Apr 2023 01:12:48 +0100 Subject: [PATCH 321/419] Add stubs for PAM. https://github.com/amishmm/php-pam --- pam/pam.php | 49 ++++++++++++++++++++ tests/DockerImages/peclExtensions/Dockerfile | 4 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 pam/pam.php diff --git a/pam/pam.php b/pam/pam.php new file mode 100644 index 000000000..deef9dc6a --- /dev/null +++ b/pam/pam.php @@ -0,0 +1,49 @@ + + * The username to check. + *

    + * @param string $password

    + * The user-supplied password to check. + *

    + * @param string $error

    + * Output parameter to put any error messages in. + *

    + * @param bool $check_account_management

    + * Call pam_acct_mgmt() to check account expiration and access. (Requires root access!) + *

    + * @param string $service_name

    + * PAM service name to use. (Defaults to "php") + *

    + * @return bool Returns a bool when complete. If false, $error contains any error messages generated. + */ +#[Pure] +function pam_auth(string $username, string $password, string $error, bool $check_account_management = true, string $service_name = 'php') {} + +/** + * Change a password for a PAM unix account. + * + * @param string $username

    + * The username to check. + *

    + * @param string $old_password

    + * The current password for the account. + *

    + * @param string $new_password

    + * The new password for the account. + *

    + * @param string $error

    + * Output parameter to put any error messages in. + *

    + * @param string $service_name

    + * PAM service name to use. (Defaults to "php") + *

    + * @return bool Returns a bool when complete. If false, $error contains any error messages generated. + */ +#[Pure] +function pam_chpass(string $username, string $old_password, string $new_password, string $error, string $service_name = 'php') {} diff --git a/tests/DockerImages/peclExtensions/Dockerfile b/tests/DockerImages/peclExtensions/Dockerfile index 6447eea06..fd19b84c2 100644 --- a/tests/DockerImages/peclExtensions/Dockerfile +++ b/tests/DockerImages/peclExtensions/Dockerfile @@ -6,7 +6,7 @@ RUN set -eux; \ libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev + libpng-dev gpgme gpgme-dev linux-pam-dev RUN pecl install xdebug RUN docker-php-ext-enable xdebug @@ -48,5 +48,7 @@ RUN pecl install gnupg RUN docker-php-ext-enable gnupg RUN pecl install uopz RUN docker-php-ext-enable uopz +RUN pecl install pam +RUN docker-php-ext-enable pam WORKDIR /opt/project/phpstorm-stubs From ddf4f5261160e0660cc4b686beda04093c0193da Mon Sep 17 00:00:00 2001 From: Sketch Date: Sun, 2 Apr 2023 13:13:20 +0100 Subject: [PATCH 322/419] Add pam to PhpCoreStubsProvider::$StubDirectoryMap and regenerated stubs map. --- PhpStormStubsMap.php | 2 ++ tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php | 1 + 2 files changed, 3 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index a88f2399c..9161aa785 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -4549,6 +4549,8 @@ final class PhpStormStubsMap 'output_cache_stop' => 'zend/zend.php', 'output_reset_rewrite_vars' => 'standard/standard_9.php', 'pack' => 'standard/standard_7.php', + 'pam_auth' => 'pam/pam.php', + 'pam_chpass' => 'pam/pam.php', 'parallel\\bootstrap' => 'parallel/parallel.php', 'parallel\\count' => 'parallel/parallel.php', 'parallel\\run' => 'parallel/parallel.php', diff --git a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php index 38d2c6d9f..420eb3f87 100644 --- a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php +++ b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php @@ -124,6 +124,7 @@ class PhpCoreStubsProvider 'mysql_xdevapi', 'ncurses', 'oauth', + 'pam', 'parallel', 'Parle', 'pcov', From 1d37ae982c1a46cb0efa6731f8bc07f58e1cfb71 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Fri, 14 Apr 2023 13:29:00 +0200 Subject: [PATCH 323/419] feat(ds): add missing ArrayAccess --- ds/ds.php | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 144 insertions(+), 5 deletions(-) diff --git a/ds/ds.php b/ds/ds.php index e37753d5c..da2215bc1 100644 --- a/ds/ds.php +++ b/ds/ds.php @@ -10,6 +10,7 @@ namespace Ds; + use ArrayAccess; use Countable; use IteratorAggregate; use JsonSerializable; @@ -147,7 +148,7 @@ public function hash(); * @template TValue * @extends Collection */ - interface Sequence extends Collection + interface Sequence extends Collection, ArrayAccess { /** * Ensures that enough memory is allocated for a required capacity. @@ -807,6 +808,29 @@ public function toArray(): array {} * @since 5.4 */ public function jsonSerialize() {} + + /** + * @param int $offset + */ + public function offsetExists(mixed $offset): bool {} + + /** + * @param int $offset + * + * @return TValue + */ + public function offsetGet(mixed $offset) {} + + /** + * @param int $offset + * @param TValue $value + */ + public function offsetSet(mixed $offset, mixed $value) {} + + /** + * @param int $offset + */ + public function offsetUnset(mixed $offset): void {} } /** @@ -1161,6 +1185,29 @@ public function unshift(...$values): void {} * @since 5.4 */ public function jsonSerialize() {} + + /** + * @param int $offset + */ + public function offsetExists(mixed $offset): bool {} + + /** + * @param int $offset + * + * @return TValue + */ + public function offsetGet(mixed $offset) {} + + /** + * @param int $offset + * @param TValue $value + */ + public function offsetSet(mixed $offset, mixed $value) {} + + /** + * @param int $offset + */ + public function offsetUnset(mixed $offset): void {} } /** @@ -1168,7 +1215,7 @@ public function jsonSerialize() {} * @template TValue * @implements Collection */ - class Map implements Collection + class Map implements Collection, ArrayAccess { /** * Creates a new instance, using either a traversable object or an array for the initial values. @@ -1716,6 +1763,29 @@ public function values(): Sequence {} * @link https://www.php.net/manual/en/ds-map.xor.php */ public function xor(Map $map): Map {} + + /** + * @param TKey $offset + */ + public function offsetExists(mixed $offset): bool {} + + /** + * @param TKey $offset + * + * @return TValue + */ + public function offsetGet(mixed $offset) {} + + /** + * @param TKey $offset + * @param TValue $value + */ + public function offsetSet(mixed $offset, mixed $value) {} + + /** + * @param TKey $offset + */ + public function offsetUnset(mixed $offset): void {} } /** @@ -1803,7 +1873,7 @@ public function jsonSerialize() {} * @template TValue * @implements Collection */ - class Set implements Collection + class Set implements Collection, ArrayAccess { /** * Creates a new instance, using either a traversable object or an array @@ -2198,6 +2268,29 @@ public function toArray(): array {} * @since 5.4 */ public function jsonSerialize() {} + + /** + * @param int $offset + */ + public function offsetExists(mixed $offset): bool {} + + /** + * @param int $offset + * + * @return TValue + */ + public function offsetGet(mixed $offset) {} + + /** + * @param int $offset + * @param TValue $value + */ + public function offsetSet(mixed $offset, mixed $value) {} + + /** + * @param int $offset + */ + public function offsetUnset(mixed $offset): void {} } /** @@ -2211,7 +2304,7 @@ public function jsonSerialize() {} * * @link https://www.php.net/manual/en/class.ds-stack.php */ - class Stack implements Collection + class Stack implements Collection, ArrayAccess { /** * Creates a new instance, using either a traversable object or an array @@ -2328,6 +2421,29 @@ public function pop() {} * @param TValue ...$values The values to push onto the stack. */ public function push(...$values) {} + + /** + * @param int $offset + */ + public function offsetExists(mixed $offset): bool {} + + /** + * @param int $offset + * + * @return TValue + */ + public function offsetGet(mixed $offset) {} + + /** + * @param int $offset + * @param TValue $value + */ + public function offsetSet(mixed $offset, mixed $value) {} + + /** + * @param int $offset + */ + public function offsetUnset(mixed $offset): void {} } /** @@ -2341,7 +2457,7 @@ public function push(...$values) {} * @template TValue * @implements Collection */ - class Queue implements Collection + class Queue implements Collection, ArrayAccess { /** * Creates a new instance, using either a traversable object or an array @@ -2461,6 +2577,29 @@ public function pop() {} * @param TValue ...$values The values to push onto the queue. */ public function push(...$values) {} + + /** + * @param int $offset + */ + public function offsetExists(mixed $offset): bool {} + + /** + * @param int $offset + * + * @return TValue + */ + public function offsetGet(mixed $offset) {} + + /** + * @param int $offset + * @param TValue $value + */ + public function offsetSet(mixed $offset, mixed $value) {} + + /** + * @param int $offset + */ + public function offsetUnset(mixed $offset): void {} } /** From 1c28d86f09f02be07fb4d46651450a31c907f2b1 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 17 Apr 2023 09:40:40 +0200 Subject: [PATCH 324/419] [phpstorm-stubs] ftp_nb_get has int|false return type since 8.1 --- ftp/ftp.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ftp/ftp.php b/ftp/ftp.php index 727a95597..ee50cbc4c 100644 --- a/ftp/ftp.php +++ b/ftp/ftp.php @@ -609,10 +609,11 @@ function ftp_nb_fget( * The transfer mode. Must be either FTP_ASCII or FTP_BINARY. Optional since PHP 7.3 *

    * @param int $offset [optional]

    The position in the remote file to start downloading from.

    - * @return int FTP_FAILED or FTP_FINISHED + * @return int|false FTP_FAILED or FTP_FINISHED * or FTP_MOREDATA. */ #[EV([FTP_FAILED, FTP_FINISHED, FTP_MOREDATA])] +#[LanguageLevelTypeAware(["8.1" => "int|false"], default: "int")] function ftp_nb_get( #[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, string $local_filename, @@ -624,7 +625,7 @@ function ftp_nb_get( #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY, int $offset = 0 -): int {} +) {} /** * Continues retrieving/sending a file (non-blocking) From 077d371b23d38d7f6f039994bfb03732d7965fbc Mon Sep 17 00:00:00 2001 From: Thomas Schulz Date: Tue, 18 Apr 2023 10:42:00 +0200 Subject: [PATCH 325/419] Fixed meta for setlocale when PHP LanguageLevel is between 5.4 and 7.4 --- meta/locales/.phpstorm.meta.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/locales/.phpstorm.meta.php b/meta/locales/.phpstorm.meta.php index ca5bf1f5f..af0f30755 100644 --- a/meta/locales/.phpstorm.meta.php +++ b/meta/locales/.phpstorm.meta.php @@ -208,4 +208,5 @@ ); expectedArguments(\setlocale(), 1, argumentsSet('locales')); -} \ No newline at end of file + expectedArguments(\setlocale(), 2, argumentsSet('locales')); +} From 2a92060f6a3bf5f0cde3aac345ca7d4854954f12 Mon Sep 17 00:00:00 2001 From: "Aleksandr.Slapoguzov" Date: Wed, 7 Jun 2023 12:13:15 +0200 Subject: [PATCH 326/419] WI-72970: add expected arguments for guzzle http method --- guzzle/.phpstorm.meta.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 guzzle/.phpstorm.meta.php diff --git a/guzzle/.phpstorm.meta.php b/guzzle/.phpstorm.meta.php new file mode 100644 index 000000000..2118db218 --- /dev/null +++ b/guzzle/.phpstorm.meta.php @@ -0,0 +1,24 @@ + Date: Wed, 7 Jun 2023 12:24:59 +0200 Subject: [PATCH 327/419] WI-72970: add `guzzle` directory to StubDirectoryMap --- tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php index 420eb3f87..338b7048e 100644 --- a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php +++ b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php @@ -176,6 +176,7 @@ class PhpCoreStubsProvider 'geos', 'gnupg', 'grpc', + 'guzzle', 'igbinary', 'judy', 'libsodium', From 60ef1e7cb5474bd9328eebeff5fd3ca72ff7badc Mon Sep 17 00:00:00 2001 From: "Aleksandr.Slapoguzov" Date: Wed, 7 Jun 2023 18:38:34 +0200 Subject: [PATCH 328/419] WI-72970: move `guzzle` to `meta` directory --- {guzzle => meta/guzzle}/.phpstorm.meta.php | 0 tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php | 1 - 2 files changed, 1 deletion(-) rename {guzzle => meta/guzzle}/.phpstorm.meta.php (100%) diff --git a/guzzle/.phpstorm.meta.php b/meta/guzzle/.phpstorm.meta.php similarity index 100% rename from guzzle/.phpstorm.meta.php rename to meta/guzzle/.phpstorm.meta.php diff --git a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php index 338b7048e..420eb3f87 100644 --- a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php +++ b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php @@ -176,7 +176,6 @@ class PhpCoreStubsProvider 'geos', 'gnupg', 'grpc', - 'guzzle', 'igbinary', 'judy', 'libsodium', From 01d38e89cd54007f31c240c6e6714e894dcdd78e Mon Sep 17 00:00:00 2001 From: "Aleksandr.Slapoguzov" Date: Thu, 8 Jun 2023 08:08:52 +0200 Subject: [PATCH 329/419] WI-72970: fixing tests --- tests/StubsMetaExpectedArgumentsTest.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/StubsMetaExpectedArgumentsTest.php b/tests/StubsMetaExpectedArgumentsTest.php index 33c0795b6..53adf125e 100644 --- a/tests/StubsMetaExpectedArgumentsTest.php +++ b/tests/StubsMetaExpectedArgumentsTest.php @@ -31,6 +31,8 @@ class StubsMetaExpectedArgumentsTest extends AbstractBaseStubsTestCase { private const PSR_LOG_LOGGER_NAMESPACE_PREFIX = "Psr\\Log\\"; + private const GUZZLE_HTTP_NAMESPACE_PREFIX = "GuzzleHttp\\"; + private const ILLUMINATE_NAMESPACE_PREFIX = "Illuminate\\"; /** * @var ExpectedFunctionArgumentsInfo[] @@ -106,19 +108,25 @@ public function testFunctionReferencesExists() $expr = $argument->getFunctionReference(); if ($expr instanceof FuncCall) { $fqn = self::toPresentableFqn($expr->name->toCodeString()); - if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX)) { + if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX) && + !str_starts_with($fqn, self::GUZZLE_HTTP_NAMESPACE_PREFIX) && + !str_starts_with($fqn, self::ILLUMINATE_NAMESPACE_PREFIX)) { self::assertArrayHasKey($fqn, self::$functionsFqns, "Can't resolve function " . $fqn); } } elseif ($expr instanceof StaticCall) { if ((string)$expr->name !== '__construct') { $fqn = self::getClassMemberFqn($expr->class->toCodeString(), (string)$expr->name); - if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX)) { + if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX) && + !str_starts_with($fqn, self::GUZZLE_HTTP_NAMESPACE_PREFIX) && + !str_starts_with($fqn, self::ILLUMINATE_NAMESPACE_PREFIX)) { self::assertArrayHasKey($fqn, self::$methodsFqns, "Can't resolve method " . $fqn); } } } elseif ($expr instanceof ConstFetch) { $fqn = self::toPresentableFqn($expr->name->toCodeString()); - if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX)) { + if (!str_starts_with($fqn, self::PSR_LOG_LOGGER_NAMESPACE_PREFIX) && + !str_starts_with($fqn, self::GUZZLE_HTTP_NAMESPACE_PREFIX) && + !str_starts_with($fqn, self::ILLUMINATE_NAMESPACE_PREFIX)) { self::assertArrayHasKey($fqn, self::$constantsFqns, "Can't resolve constant " . $fqn); } } From 7d6d52ed7a06424f8c1e4b6b98288d38e14fbd41 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Wed, 14 Jun 2023 14:04:24 +0200 Subject: [PATCH 330/419] [phpstorm-stubs] update constant values --- intl/intl.php | 4 ++-- pgsql/pgsql.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/intl/intl.php b/intl/intl.php index 40cdf5731..e879e13b2 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -6754,8 +6754,8 @@ function intltz_get_id_for_windows_id(string $timezoneId, ?string $region = null * @link https://php.net/manual/en/intl.constants.php */ define('INTL_MAX_LOCALE_LEN', 156); -define('INTL_ICU_VERSION', "72.1"); -define('INTL_ICU_DATA_VERSION', "72.1"); +define('INTL_ICU_VERSION', "73.1"); +define('INTL_ICU_DATA_VERSION', "73.1"); define('ULOC_ACTUAL_LOCALE', 0); define('ULOC_VALID_LOCALE', 1); define('GRAPHEME_EXTR_COUNT', 0); diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 021f3507e..91f899c0a 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -2066,8 +2066,8 @@ function pg_consume_input(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'] */ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection): int|bool {} -define('PGSQL_LIBPQ_VERSION', "15.2"); -define('PGSQL_LIBPQ_VERSION_STR', "15.2"); +define('PGSQL_LIBPQ_VERSION', "15.3"); +define('PGSQL_LIBPQ_VERSION_STR', "15.3"); /** * Passed to pg_connect to force the creation of a new connection, From 4c19fc884ad2524eb911e8bea14445004fdf7dfb Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 17 Jun 2023 22:46:42 +0200 Subject: [PATCH 331/419] [phpstorm-stubs] fix test that check if type in signature matches PHPDoc --- tests/Model/PHPClass.php | 4 --- tests/Model/PHPDocElement.php | 4 +-- tests/Model/PHPFunction.php | 35 ++++++++++++++++++- tests/Model/PHPMethod.php | 1 + tests/Parsers/StubParser.php | 3 ++ tests/StubsTypeHintsTest.php | 7 ++-- .../Providers/Stubs/StubMethodsProvider.php | 13 ++++--- 7 files changed, 51 insertions(+), 16 deletions(-) diff --git a/tests/Model/PHPClass.php b/tests/Model/PHPClass.php index b99314f2e..0947c23ab 100644 --- a/tests/Model/PHPClass.php +++ b/tests/Model/PHPClass.php @@ -95,10 +95,6 @@ public function readObjectFromStubNode($node) $this->interfaces[] = ltrim($interfaceFQN, "\\"); } } - foreach ($node->getProperties() as $property) { - $parsedProperty = (new PHPProperty($this->name))->readObjectFromStubNode($property); - $this->addProperty($parsedProperty); - } if ($node->getDocComment() !== null) { $docBlock = DocBlockFactory::createInstance()->create($node->getDocComment()->getText()); /** @var PropertyRead[] $properties */ diff --git a/tests/Model/PHPDocElement.php b/tests/Model/PHPDocElement.php index 560c8fac5..f8a3528c1 100644 --- a/tests/Model/PHPDocElement.php +++ b/tests/Model/PHPDocElement.php @@ -76,7 +76,7 @@ trait PHPDocElement * @var bool */ public $hasInternalMetaTag = false; - public $templateTypes = null; + public $templateTypes = []; protected function collectTags(Node $node) { @@ -102,7 +102,7 @@ protected function collectTags(Node $node) $this->hasInternalMetaTag = $phpDoc->hasTag('meta'); $this->hasInheritDocTag = $phpDoc->hasTag('inheritdoc') || $phpDoc->hasTag('inheritDoc') || stripos($phpDoc->getSummary(), 'inheritdoc') > 0; - $this->templateTypes = array_map( + $this->templateTypes += array_map( function (Generic $tag) { return preg_split("/\W/", $tag->getDescription()->getBodyTemplate())[0]; }, diff --git a/tests/Model/PHPFunction.php b/tests/Model/PHPFunction.php index aaacf1324..a5ea45a6f 100644 --- a/tests/Model/PHPFunction.php +++ b/tests/Model/PHPFunction.php @@ -4,8 +4,11 @@ use Exception; use JetBrains\PhpStorm\Deprecated; +use JetBrains\PhpStorm\Internal\TentativeType; use phpDocumentor\Reflection\DocBlock\Tags\Param; use phpDocumentor\Reflection\DocBlock\Tags\Return_; +use phpDocumentor\Reflection\Types\Array_; +use phpDocumentor\Reflection\Types\Collection; use phpDocumentor\Reflection\Types\Compound; use PhpParser\Comment\Doc; use PhpParser\Node\FunctionLike; @@ -37,6 +40,8 @@ class PHPFunction extends BasePHPElement /** @var string[] */ public $returnTypesFromSignature = []; + public $hasTentativeReturnType = false; + /** * @param ReflectionFunction|ReflectionFunctionAbstract $reflectionObject * @return static @@ -102,11 +107,16 @@ public function readObjectFromStubNode($node) } } + $this->checkIfReturnTypeIsTentative($node); $this->checkDeprecationTag($node); $this->checkReturnTag(); return $this; } + protected function checkIfReturnTypeIsTentative(FunctionLike $node) { + $this->hasTentativeReturnType = self::hasTentativeReturnTypeAttribute($node); + } + protected function checkDeprecationTag(FunctionLike $node) { $this->isDeprecated = self::hasDeprecatedAttribute($node) || !empty($this->deprecatedTags); @@ -115,7 +125,14 @@ protected function checkDeprecationTag(FunctionLike $node) protected function checkReturnTag() { if (!empty($this->returnTags) && $this->returnTags[0] instanceof Return_) { - $returnType = $this->returnTags[0]->getType(); + $type = $this->returnTags[0]->getType(); + if ($type instanceof Collection) { + $returnType = $type->getFqsen(); + } elseif($type instanceof Array_ && $type->getValueType() instanceof Collection) { + $returnType = "array"; + } else { + $returnType = $type; + } if ($returnType instanceof Compound) { foreach ($returnType as $nextType) { $this->returnTypesFromPhpDoc[] = (string)$nextType; @@ -191,6 +208,22 @@ private static function hasDeprecatedAttribute(FunctionLike $node) return false; } + /** + * @param FunctionLike $node + * @return bool + */ + public static function hasTentativeReturnTypeAttribute(FunctionLike $node) + { + foreach ($node->getAttrGroups() as $group) { + foreach ($group->attrs as $attr) { + if ((string)$attr->name === TentativeType::class) { + return true; + } + } + } + return false; + } + /** * @param Doc|null $docComment * @return bool diff --git a/tests/Model/PHPMethod.php b/tests/Model/PHPMethod.php index 228ff76e9..4526da3a2 100644 --- a/tests/Model/PHPMethod.php +++ b/tests/Model/PHPMethod.php @@ -84,6 +84,7 @@ public function readObjectFromStubNode($node) $this->returnTypesFromAttribute = $typesFromAttribute; array_push($this->returnTypesFromSignature, ...self::convertParsedTypeToArray($node->getReturnType())); $this->collectTags($node); + $this->checkIfReturnTypeIsTentative($node); $this->checkDeprecationTag($node); $this->checkReturnTag(); diff --git a/tests/Parsers/StubParser.php b/tests/Parsers/StubParser.php index 0528bb37b..7ee3d893e 100644 --- a/tests/Parsers/StubParser.php +++ b/tests/Parsers/StubParser.php @@ -54,6 +54,9 @@ public static function getPhpStormStubs(): StubsContainer foreach (self::$stubs->getClasses() as $class) { $class->readMutedProblems($jsonData->classes); $class->interfaces = CommonUtils::flattenArray($visitor->combineImplementedInterfaces($class), false); + foreach ($class->methods as $method) { + $method->templateTypes += $class->templateTypes; + } } foreach (self::$stubs->getFunctions() as $function) { $function->readMutedProblems($jsonData->functions); diff --git a/tests/StubsTypeHintsTest.php b/tests/StubsTypeHintsTest.php index 0ecbf54c6..9b152a395 100644 --- a/tests/StubsTypeHintsTest.php +++ b/tests/StubsTypeHintsTest.php @@ -225,13 +225,12 @@ public static function testSignatureTypeHintsConformPhpDocInMethods(PHPFunction| $unifiedSignatureTypes[] = $typeName; } $typesIntersection = array_intersect($unifiedSignatureTypes, $unifiedPhpDocTypes); + $name = $method instanceof PHPMethod ? "Method $method->parentName::" : 'Function '; self::assertSameSize( $unifiedSignatureTypes, $typesIntersection, - $method instanceof PHPMethod ? "Method $method->parentName::" : 'Function ' . - "$functionName has mismatch in phpdoc return type and signature return type\n - signature has " . implode('|', $unifiedSignatureTypes) . "\n - but phpdoc has " . implode('|', $unifiedPhpDocTypes) + $name . "$functionName has mismatch in phpdoc return type and signature return type. + Signature has " . implode('|', $unifiedSignatureTypes) . " but phpdoc has " . implode('|', $unifiedPhpDocTypes) ); } diff --git a/tests/TestData/Providers/Stubs/StubMethodsProvider.php b/tests/TestData/Providers/Stubs/StubMethodsProvider.php index a1bd1e6f1..3845e16b4 100644 --- a/tests/TestData/Providers/Stubs/StubMethodsProvider.php +++ b/tests/TestData/Providers/Stubs/StubMethodsProvider.php @@ -13,6 +13,7 @@ use StubTests\Parsers\ParserUtils; use StubTests\TestData\Providers\EntitiesFilter; use StubTests\TestData\Providers\PhpStormStubsSingleton; +use function in_array; class StubMethodsProvider { @@ -29,21 +30,23 @@ public static function allMethodsProvider(): ?Generator public static function allFunctionAndMethodsWithReturnTypeHintsProvider(): ?Generator { - $coreClassesAndInterfaces = PhpStormStubsSingleton::getPhpStormStubs()->getClasses() + - PhpStormStubsSingleton::getPhpStormStubs()->getInterfaces(); + $coreClassesAndInterfaces = PhpStormStubsSingleton::getPhpStormStubs()->getCoreClasses() + + PhpStormStubsSingleton::getPhpStormStubs()->getCoreInterfaces(); $allFunctions = PhpStormStubsSingleton::getPhpStormStubs()->getFunctions(); $filteredMethods = []; foreach (EntitiesFilter::getFiltered($coreClassesAndInterfaces) as $class) { - $filteredMethods = EntitiesFilter::getFiltered( + $filteredMethods += EntitiesFilter::getFiltered( $class->methods, fn (PHPMethod $method) => empty($method->returnTypesFromSignature) || empty($method->returnTypesFromPhpDoc) - || $method->parentName === '___PHPSTORM_HELPERS\object', + || $method->parentName === '___PHPSTORM_HELPERS\object' || $method->hasTentativeReturnType + || in_array('mixed', $method->returnTypesFromSignature), StubProblemType::TYPE_IN_PHPDOC_DIFFERS_FROM_SIGNATURE ); } $filteredMethods += EntitiesFilter::getFiltered( $allFunctions, - fn (PHPFunction $function) => empty($function->returnTypesFromSignature) || empty($function->returnTypesFromPhpDoc), + fn (PHPFunction $function) => empty($function->returnTypesFromSignature) || empty($function->returnTypesFromPhpDoc) + || $function->hasTentativeReturnType || in_array('mixed', $function->returnTypesFromSignature), StubProblemType::TYPE_IN_PHPDOC_DIFFERS_FROM_SIGNATURE ); foreach ($filteredMethods as $methodName => $method) { From e84d730f9cbbd6aeb6df3ba8d1f9195c3e83f173 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 17 Jun 2023 22:51:43 +0200 Subject: [PATCH 332/419] [phpstorm-stubs] fix types in PHPDoc --- Core/Core_c.php | 6 +-- Reflection/ReflectionEnum.php | 2 +- Reflection/ReflectionEnumBackedCase.php | 2 + Reflection/ReflectionEnumUnitCase.php | 2 + Reflection/ReflectionReference.php | 2 +- SPL/SPL_c1.php | 4 +- intl/intl.php | 70 ++++++++++++------------- 7 files changed, 46 insertions(+), 42 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index 93f091f69..696095752 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -653,7 +653,7 @@ public function __invoke(...$_) {} * @param mixed $newScope The class scope to which associate the closure is to be associated, or 'static' to keep the current one. * If an object is given, the type of the object will be used instead. * This determines the visibility of protected and private methods of the bound object. - * @return Closure|false Returns the newly created Closure object or FALSE on failure + * @return Closure|null Returns the newly created Closure object or null on failure */ public function bindTo(?object $newThis, object|string|null $newScope = 'static'): ?Closure {} @@ -666,7 +666,7 @@ public function bindTo(?object $newThis, object|string|null $newScope = 'static' * @param mixed $newScope The class scope to which associate the closure is to be associated, or 'static' to keep the current one. * If an object is given, the type of the object will be used instead. * This determines the visibility of protected and private methods of the bound object. - * @return Closure|false Returns the newly created Closure object or FALSE on failure + * @return Closure|null Returns the newly created Closure object or null on failure */ public static function bind(Closure $closure, ?object $newThis, object|string|null $newScope = 'static'): ?Closure {} @@ -1057,7 +1057,7 @@ public function isTerminated(): bool {} public function getReturn(): mixed {} /** - * @return self|null Returns the currently executing fiber instance or NULL if in {main}. + * @return Fiber|null Returns the currently executing fiber instance or NULL if in {main}. */ public static function getCurrent(): ?Fiber {} diff --git a/Reflection/ReflectionEnum.php b/Reflection/ReflectionEnum.php index c04834d91..3d01dac4e 100644 --- a/Reflection/ReflectionEnum.php +++ b/Reflection/ReflectionEnum.php @@ -22,7 +22,7 @@ public function hasCase(string $name): bool {} public function getCases(): array {} /** - * @return ReflectionEnumPureCase|ReflectionEnumBackedCase + * @return ReflectionEnumUnitCase|ReflectionEnumBackedCase * @throws ReflectionException If no found single reflection object for the corresponding case */ public function getCase(string $name): ReflectionEnumUnitCase {} diff --git a/Reflection/ReflectionEnumBackedCase.php b/Reflection/ReflectionEnumBackedCase.php index 4409ba0a2..d3fd7d8ab 100644 --- a/Reflection/ReflectionEnumBackedCase.php +++ b/Reflection/ReflectionEnumBackedCase.php @@ -1,5 +1,7 @@ * The optional assigned values. *

    - * @return array|int If only one parameter is passed to this method, the values parsed will be + * @return array|int|null If only one parameter is passed to this method, the values parsed will be * returned as an array. Otherwise, if optional parameters are passed, the * function will return the number of assigned values. The optional * parameters must be passed by reference. @@ -1960,7 +1960,7 @@ public function __serialize(): array {} public function __unserialize(array $data): void {} /** - * @return Traversable + * @return Iterator */ public function getIterator(): Iterator {} diff --git a/intl/intl.php b/intl/intl.php index e879e13b2..6abfff43f 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -1176,7 +1176,7 @@ public function getPattern(): string|false {} * Locale::ACTUAL_LOCALE, * respectively). The default is the actual locale. *

    - * @return string The locale name used to create the formatter. + * @return string|false The locale name used to create the formatter. */ #[Pure] #[TentativeType] @@ -1289,7 +1289,7 @@ public static function isNormalized( /** * @param string $string

    The input string to normalize

    - * @param string $form + * @param int $form * @return string|null

    Returns a string containing the Decomposition_Mapping property, if present in the UCD. * Returns null if there is no Decomposition_Mapping property for the character.

    * @link https://www.php.net/manual/en/normalizer.getrawdecomposition.php @@ -1444,7 +1444,7 @@ public static function getKeywords(#[TypeAware(['8.0' => 'string'], default: '') * @param string $displayLocale

    * Optional format locale to use to display the script name *

    - * @return string Display name of the script for the $locale in the format appropriate for + * @return string|false Display name of the script for the $locale in the format appropriate for * $in_locale. */ #[TentativeType] @@ -1464,7 +1464,7 @@ public static function getDisplayScript( * @param string $displayLocale

    * Optional format locale to use to display the region name *

    - * @return string display name of the region for the $locale in the format appropriate for + * @return string|false display name of the region for the $locale in the format appropriate for * $in_locale. */ #[TentativeType] @@ -1553,7 +1553,7 @@ public static function getDisplayVariant( * (e.g. 'variant0', 'variant1', etc.). *

    *

    - * @return string The corresponding locale identifier. + * @return string|false The corresponding locale identifier. */ #[TentativeType] public static function composeLocale(array $subtags): string|false {} @@ -1567,7 +1567,7 @@ public static function composeLocale(array $subtags): string|false {} * 'private' subtags can take maximum 15 values whereas 'extlang' can take * maximum 3 values. *

    - * @return array an array containing a list of key-value pairs, where the keys + * @return array|null an array containing a list of key-value pairs, where the keys * identify the particular locale ID subtags, and the values are the * associated subtag values. The array will be ordered as the locale id * subtags e.g. in the locale id if variants are '-varX-varY-varZ' then the @@ -1604,7 +1604,7 @@ public static function getAllVariants(#[TypeAware(['8.0' => 'string'], default: * If true, the arguments will be converted to canonical form before * matching. *

    - * @return bool TRUE if $locale matches $langtag FALSE otherwise. + * @return bool|null TRUE if $locale matches $langtag FALSE otherwise. */ #[TentativeType] public static function filterMatches( @@ -1632,7 +1632,7 @@ public static function filterMatches( * @param string $defaultLocale

    * The locale to use if no match is found. *

    - * @return string The closest matching language tag or default value. + * @return string|null The closest matching language tag or default value. */ #[TentativeType] public static function lookup( @@ -1647,7 +1647,7 @@ public static function lookup( /** * @link https://php.net/manual/en/locale.canonicalize.php * @param string $locale - * @return string + * @return string|null */ #[TentativeType] public static function canonicalize(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} @@ -1659,7 +1659,7 @@ public static function canonicalize(#[TypeAware(['8.0' => 'string'], default: '' * @param string $header

    * The string containing the "Accept-Language" header according to format in RFC 2616. *

    - * @return string The corresponding locale identifier. + * @return string|false The corresponding locale identifier. */ #[TentativeType] public static function acceptFromHttp(#[TypeAware(['8.0' => 'string'], default: '')] $header): string|false {} @@ -1801,7 +1801,7 @@ public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $patte * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    * Get the pattern used by the formatter * @link https://php.net/manual/en/messageformatter.getpattern.php - * @return string The pattern string for this message formatter + * @return string|false The pattern string for this message formatter */ #[Pure] #[TentativeType] @@ -1939,7 +1939,7 @@ public function __construct( * Optional pattern to use when formatting or parsing. * Possible patterns are documented at http://userguide.icu-project.org/formatparse/datetime. *

    - * @return IntlDateFormatter + * @return IntlDateFormatter|null */ #[TentativeType] public static function create( @@ -2077,7 +2077,7 @@ public function setTimeZoneId($zone) {} * * *

    - * @return bool TRUE on success or FALSE on failure. + * @return bool|null TRUE on success or FALSE on failure. */ #[TentativeType] public function setTimeZone($timezone): ?bool {} @@ -2100,7 +2100,7 @@ public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $patte * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    * Get the pattern used for the IntlDateFormatter * @link https://php.net/manual/en/intldateformatter.getpattern.php - * @return string The pattern string being used to format/parse. + * @return string|false The pattern string being used to format/parse. */ #[Pure] #[TentativeType] @@ -2128,7 +2128,7 @@ public function getLocale( * @param bool $lenient

    * Sets whether the parser is lenient or not, default is TRUE (lenient). *

    - * @return bool TRUE on success or FALSE on failure. + * @return void */ #[TentativeType] public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient): void {} @@ -2318,7 +2318,7 @@ public function count(): int {} * Path of ResourceBundle for which to get available locales, or * empty string for default locales list. *

    - * @return array the list of locales supported by the bundle. + * @return array|false the list of locales supported by the bundle. */ #[TentativeType] public static function getLocales(#[TypeAware(['8.0' => 'string'], default: '')] $bundle): array|false {} @@ -2344,7 +2344,7 @@ public function getErrorCode(): int {} public function getErrorMessage(): string {} /** - * @return Traversable + * @return Iterator * @since 8.0 */ #[Pure] @@ -2819,7 +2819,7 @@ public function equals(#[TypeAware(['8.0' => 'IntlCalendar'], default: '')] $oth * values between 0 and * IntlCalendar::FIELD_COUNT. *

    - * @return int Returns a (signed) difference of time in the unit associated with the + * @return int|false Returns a (signed) difference of time in the unit associated with the * specified field or FALSE on failure. */ #[Pure] @@ -2858,7 +2858,7 @@ public static function fromDateTime( * values between 0 and * IntlCalendar::FIELD_COUNT. *

    - * @return int An integer with the value of the time field. + * @return int|false An integer with the value of the time field. */ #[Pure] #[TentativeType] @@ -2873,7 +2873,7 @@ public function get(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|fal * values between 0 and * IntlCalendar::FIELD_COUNT. *

    - * @return int + * @return int|false * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing the maximum value in the units associated * with the given field or FALSE on failure. */ @@ -2890,7 +2890,7 @@ public function getActualMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $fi * These are integer values between 0 and * IntlCalendar::FIELD_COUNT. *

    - * @return int + * @return int|false * An {@link https://secure.php.net/manual/en/language.types.integer.php int} representing the minimum value in the field's * unit or FALSE on failure. */ @@ -3027,7 +3027,7 @@ public function getLeastMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $fie * From the most general to the most specific, the locales are ordered in * this fashion – actual locale, valid locale, requested locale. *

    - * @return string + * @return string|false */ #[Pure] #[TentativeType] @@ -3597,7 +3597,7 @@ public static function getEquivalentID( * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    * Get last error code on the object * @link https://secure.php.net/manual/en/intltimezone.geterrorcode.php - * @return int + * @return int|false */ #[Pure] #[TentativeType] @@ -3625,7 +3625,7 @@ public static function getGMT(): IntlTimeZone {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    * Get timezone ID - * @return string + * @return string|false */ #[Pure] #[TentativeType] @@ -3683,7 +3683,7 @@ public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    * Get the timezone data version currently used by ICU * @link https://secure.php.net/manual/en/intltimezone.gettzdataversion.php - * @return string + * @return string|false */ #[TentativeType] public static function getTZDataVersion(): string|false {} @@ -3830,7 +3830,7 @@ function collator_set_attribute(Collator $object, int $attribute, int $value): b * Get current collation strength * @link https://php.net/manual/en/collator.getstrength.php * @param Collator $object - * @return int|false current collation strength, or boolean FALSE on error. + * @return int current collation strength */ #[Pure] function collator_get_strength(Collator $object): int {} @@ -3974,7 +3974,7 @@ function collator_get_sort_key( * @param string|null $pattern [optional]

    * Pattern string if the chosen style requires a pattern. *

    - * @return NumberFormatter|false|null NumberFormatter object or FALSE on error. + * @return NumberFormatter|null NumberFormatter object or NULL on error. */ #[Pure] function numfmt_create(string $locale, int $style, #[TypeAware(['8.0' => 'string|null'], default: 'string')] $pattern = null): ?NumberFormatter {} @@ -5110,7 +5110,7 @@ function grapheme_strripos(string $haystack, string $needle, int $offset = 0): i * the returned string will start at the $start'th grapheme unit from the * end of string. *

    - * @param int $length [optional]

    + * @param int|null $length [optional]

    * Length in grapheme units. * If $length is given and is positive, the string returned will contain * at most $length grapheme units beginning from $start (depending on the @@ -5880,7 +5880,7 @@ function intlcal_get_type(IntlCalendar $calendar): string {} * @param IntlCalendar $calendar

    * The calendar object, on the procedural style interface. *

    - * @param string $dayOfWeek

    + * @param int $dayOfWeek

    * One of the constants IntlCalendar::DOW_SUNDAY, * IntlCalendar::DOW_MONDAY, ..., * IntlCalendar::DOW_SATURDAY. @@ -6457,7 +6457,7 @@ function intlgregcal_is_leap_year(IntlGregorianCalendar $calendar, int $year): b * @param bool $fallback [optional]

    * Whether locale should match exactly or fallback to parent locale is allowed. *

    - * @return ResourceBundle|false|null ResourceBundle object or FALSE on error. + * @return ResourceBundle|null ResourceBundle object or NULL on error. */ #[Pure] function resourcebundle_create(?string $locale, ?string $bundle, bool $fallback = true): ?ResourceBundle {} @@ -6505,7 +6505,7 @@ function resourcebundle_locales(string $bundle): array|false {} * (PHP >= 5.3.2, PECL intl >= 2.0.0)
    * Get bundle's last error code. * @link https://php.net/manual/en/resourcebundle.geterrorcode.php - * @param $bundle + * @param ResourceBundle $bundle * @return int error code from last bundle object call. */ #[Pure(true)] @@ -6515,7 +6515,7 @@ function resourcebundle_get_error_code(ResourceBundle $bundle): int {} * (PHP >= 5.3.2, PECL intl >= 2.0.0)
    * Get bundle's last error message. * @link https://php.net/manual/en/resourcebundle.geterrormessage.php - * @param $bundle + * @param ResourceBundle $bundle * @return string error message from last bundle object's call. */ #[Pure(true)] @@ -7073,7 +7073,7 @@ private function __construct() {} * Create break iterator for boundaries of combining character sequences * @link https://secure.php.net/manual/en/intlbreakiterator.createcharacterinstance.php * @param string $locale - * @return IntlBreakIterator + * @return IntlBreakIterator|null */ #[TentativeType] public static function createCharacterInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null): ?IntlBreakIterator {} @@ -7357,7 +7357,7 @@ public static function createWordInstance($locale) {} * (PHP 5 >=5.5.0)
    * @link https://secure.php.net/manual/en/intlrulebasedbreakiterator.getbinaryrules.php * Get the binary form of compiled rules - * @return string + * @return string|false */ #[Pure] #[TentativeType] @@ -7694,7 +7694,7 @@ public function toUCallback( * @param string $str * @param string $toEncoding * @param string $fromEncoding - * @param array $options + * @param array|null $options * @return string|false */ #[TentativeType] From 2612aa874150f071b272bd924883bab7af48589e Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sat, 17 Jun 2023 22:55:53 +0200 Subject: [PATCH 333/419] [phpstorm-stubs] fix formatting --- tests/Model/PHPFunction.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/Model/PHPFunction.php b/tests/Model/PHPFunction.php index a5ea45a6f..5a8219e28 100644 --- a/tests/Model/PHPFunction.php +++ b/tests/Model/PHPFunction.php @@ -39,7 +39,6 @@ class PHPFunction extends BasePHPElement /** @var string[] */ public $returnTypesFromSignature = []; - public $hasTentativeReturnType = false; /** @@ -128,7 +127,7 @@ protected function checkReturnTag() $type = $this->returnTags[0]->getType(); if ($type instanceof Collection) { $returnType = $type->getFqsen(); - } elseif($type instanceof Array_ && $type->getValueType() instanceof Collection) { + } elseif ($type instanceof Array_ && $type->getValueType() instanceof Collection) { $returnType = "array"; } else { $returnType = $type; From 1b9d13fdae30ff616df12ba42bc141ff3870c2fb Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 18 Jun 2023 08:59:22 +0200 Subject: [PATCH 334/419] [phpstorm-stubs] Update ICU version to 73.2 in intl.php --- intl/intl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intl/intl.php b/intl/intl.php index 6abfff43f..587a55a84 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -6754,8 +6754,8 @@ function intltz_get_id_for_windows_id(string $timezoneId, ?string $region = null * @link https://php.net/manual/en/intl.constants.php */ define('INTL_MAX_LOCALE_LEN', 156); -define('INTL_ICU_VERSION', "73.1"); -define('INTL_ICU_DATA_VERSION', "73.1"); +define('INTL_ICU_VERSION', "73.2"); +define('INTL_ICU_DATA_VERSION', "73.2"); define('ULOC_ACTUAL_LOCALE', 0); define('ULOC_VALID_LOCALE', 1); define('GRAPHEME_EXTR_COUNT', 0); From c3394be2c177bcc3176112822ceca0a0c0307915 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Sun, 18 Jun 2023 09:57:44 +0200 Subject: [PATCH 335/419] [phpstorm-stubs] WI-72923 add ObjectShape attribute --- meta/attributes/ObjectShape.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 meta/attributes/ObjectShape.php diff --git a/meta/attributes/ObjectShape.php b/meta/attributes/ObjectShape.php new file mode 100644 index 000000000..dd9dd04b7 --- /dev/null +++ b/meta/attributes/ObjectShape.php @@ -0,0 +1,21 @@ +#[ObjectShape(["age" => "int", "name" => "string"])] + * + * This usage applied on an element effectively means that the object has 2 fields, the names are "age" and "name", and the corresponding types are "int" and "string". + */ +#[Attribute(Attribute::TARGET_FUNCTION|Attribute::TARGET_METHOD|Attribute::TARGET_PARAMETER|Attribute::TARGET_PROPERTY)] +class ObjectShape +{ + public function __construct(array $shape) {} +} From 8a355b57b126e9103249e394555c49b3ade3c38b Mon Sep 17 00:00:00 2001 From: Lynn Date: Sun, 4 Jun 2023 16:30:21 +0800 Subject: [PATCH 336/419] typo fix `beginnning` => `beginning` --- standard/standard_1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/standard_1.php b/standard/standard_1.php index fb5a0db1b..79b579cfe 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -44,7 +44,7 @@ function strtolower(string $string): string {} * the beginning of the string. Unlike {@see strrpos()} and {@see strripos()}, the offset cannot be negative. *

    * @return int<0,max>|false

    - * Returns the position where the needle exists relative to the beginnning of + * Returns the position where the needle exists relative to the beginning of * the haystack string (independent of search direction * or offset). * Also note that string positions start at 0, and not 1. From e2e898a29929d2f520fe95bdb2109d8fa895ba4a Mon Sep 17 00:00:00 2001 From: yonex <4462818+yonex@users.noreply.github.com> Date: Thu, 20 Apr 2023 16:01:08 +0900 Subject: [PATCH 337/419] Fix typo in Redis.php --- redis/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/Redis.php b/redis/Redis.php index 3eca483d0..f6146b689 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -310,7 +310,7 @@ public function getAuth() {} * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) * @param array|null $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * - * @return bool TRUE on success, FALSE on ertcnror. + * @return bool TRUE on success, FALSE on error. * * @throws RedisException * From 9bdfbf531e9f313ae53b4a697e6189fa07f7a2aa Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 15 Jun 2023 13:11:23 +0200 Subject: [PATCH 338/419] Update stubs for ext-mongodb 1.16 --- PhpStormStubsMap.php | 3 +++ mongodb/BSON/Document.php | 43 ++++++++++++++++++++++++++++++++++++ mongodb/BSON/Int64.php | 14 +++++------- mongodb/BSON/Iterator.php | 24 ++++++++++++++++++++ mongodb/BSON/PackedArray.php | 35 +++++++++++++++++++++++++++++ mongodb/mongodb.php | 2 +- 6 files changed, 111 insertions(+), 10 deletions(-) create mode 100644 mongodb/BSON/Document.php create mode 100644 mongodb/BSON/Iterator.php create mode 100644 mongodb/BSON/PackedArray.php diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 9161aa785..0371a9654 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -631,7 +631,9 @@ final class PhpStormStubsMap 'MongoDB\\BSON\\DBPointer' => 'mongodb/BSON/DBPointer.php', 'MongoDB\\BSON\\Decimal128' => 'mongodb/BSON/Decimal128.php', 'MongoDB\\BSON\\Decimal128Interface' => 'mongodb/BSON/Decimal128Interface.php', + 'MongoDB\\BSON\\Document' => 'mongodb/BSON/Document.php', 'MongoDB\\BSON\\Int64' => 'mongodb/BSON/Int64.php', + 'MongoDB\\BSON\\Iterator' => 'mongodb/BSON/Iterator.php', 'MongoDB\\BSON\\Javascript' => 'mongodb/BSON/Javascript.php', 'MongoDB\\BSON\\JavascriptInterface' => 'mongodb/BSON/JavascriptInterface.php', 'MongoDB\\BSON\\MaxKey' => 'mongodb/BSON/MaxKey.php', @@ -640,6 +642,7 @@ final class PhpStormStubsMap 'MongoDB\\BSON\\MinKeyInterface' => 'mongodb/BSON/MinKeyInterface.php', 'MongoDB\\BSON\\ObjectId' => 'mongodb/BSON/ObjectId.php', 'MongoDB\\BSON\\ObjectIdInterface' => 'mongodb/BSON/ObjectIdInterface.php', + 'MongoDB\\BSON\\PackedArray' => 'mongodb/BSON/PackedArray.php', 'MongoDB\\BSON\\Persistable' => 'mongodb/BSON/Persistable.php', 'MongoDB\\BSON\\Regex' => 'mongodb/BSON/Regex.php', 'MongoDB\\BSON\\RegexInterface' => 'mongodb/BSON/RegexInterface.php', diff --git a/mongodb/BSON/Document.php b/mongodb/BSON/Document.php new file mode 100644 index 000000000..d358ec901 --- /dev/null +++ b/mongodb/BSON/Document.php @@ -0,0 +1,43 @@ + Date: Tue, 20 Jun 2023 13:25:36 +0200 Subject: [PATCH 339/419] Add stubs in ClientEncryption class --- mongodb/ClientEncryption.php | 76 +++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/mongodb/ClientEncryption.php b/mongodb/ClientEncryption.php index 917d9c933..4d4170f53 100644 --- a/mongodb/ClientEncryption.php +++ b/mongodb/ClientEncryption.php @@ -19,6 +19,16 @@ final private function __construct() {} final public function __wakeup() {} + /** + * Adds an alternate name to a key document + * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.addkeyaltname.php + * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @param string $keyAltName Alternate name to add to the key document. + * @return object|null Returns the previous version of the key document, or null if no document matched. + * @throws InvalidArgumentException On argument parsing errors. + */ + final public function addKeyAltName(\MongoDB\BSON\Binary $keyId, string $keyAltName): ?object {} + /** * Creates a new key document and inserts into the key vault collection. * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.createdatakey.php @@ -38,7 +48,16 @@ final public function createDataKey($kmsProvider, ?array $options = []) {} * @throws InvalidArgumentException On argument parsing errors. * @throws EncryptionException If an error occurs while decrypting the value. */ - final public function decrypt(\MongoDB\BSON\BinaryInterface $keyVaultClient) {} + final public function decrypt(\MongoDB\BSON\Binary $keyVaultClient) {} + + /** + * Deletes a key document + * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.deletekey.php + * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @return object Returns the result of the internal deleteOne operation on the key vault collection. + * @throws InvalidArgumentException On argument parsing errors. + */ + final public function deleteKey(\MongoDB\BSON\Binary $keyId): object {} /** * Encrypts a value with a given key and algorithm. @@ -49,5 +68,58 @@ final public function decrypt(\MongoDB\BSON\BinaryInterface $keyVaultClient) {} * @throws InvalidArgumentException On argument parsing errors. * @throws EncryptionException If an error occurs while encrypting the value. */ - final public function encrypt($value, ?array $options = []) {} + final public function encrypt($value, ?array $options = []): \MongoDB\BSON\Binary {} + + /** + * Encrypts a Match Expression or Aggregate Expression to query a range index + * @param array|object $expr A BSON document containing the expression + * @param array|null $options + * @return object Returns the encrypted expression as a BSON document + * @throws InvalidArgumentException On argument parsing errors. + */ + final public function encryptExpression(array|object $expr, ?array $options = null): object {} + + /** + * Gets a key document + * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.getkey.php + * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @return object|null Returns the key document, or null if no document matched. + * @throws InvalidArgumentException On argument parsing errors. + */ + final public function getKey(\MongoDB\BSON\Binary $keyId): ?object {} + + /** + * Gets a key document by an alternate name + * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.getkeybyaltname.php + * @param string $keyAltName Alternate name for the key document. + * @return object|null Returns the key document, or null if no document matched. + * @throws InvalidArgumentException On argument parsing errors. + */ + final public function getKeyByAltName(string $keyAltName): ?object {} + + /** + * Finds all key documents in the key vault collection. + * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.getkeys.php + * @return Cursor + * @throws InvalidArgumentException On argument parsing errors. + */ + final public function getKeys(): Cursor {} + + /** + * Removes an alternate name from a key document + * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.removekeyaltname.php + * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @param string $keyAltName Alternate name to remove from the key document. + * @return object|null Returns the previous version of the key document, or null if no document matched. + */ + final public function removeKeyAltName(\MongoDB\BSON\Binary $keyId, string $keyAltName): ?object {} + + /** + * Rewraps data keys + * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.rewrapmanydatakey.php + * @param array|object $filter + * @param array|null $options + * @return object Returns an object, which will have an optional bulkWriteResult property containing the result of the internal bulkWrite operation as an object. If no data keys matched the filter or the write was unacknowledged, the bulkWriteResult property will be null. + */ + final public function rewrapManyDataKey(array|object $filter, ?array $options = null): object {} } From 3bb9c8a1050ad324c2dca7964487fa9f081f1005 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 4 Jul 2023 11:34:48 +0200 Subject: [PATCH 340/419] Add missing stubs --- PhpStormStubsMap.php | 12 ++ mongodb/BSON/Binary.php | 25 ++-- mongodb/BSON/DBPointer.php | 6 +- mongodb/BSON/Decimal128.php | 11 +- mongodb/BSON/Document.php | 3 +- mongodb/BSON/Int64.php | 9 +- mongodb/BSON/Javascript.php | 20 +--- mongodb/BSON/MaxKey.php | 7 +- mongodb/BSON/MinKey.php | 7 +- mongodb/BSON/ObjectId.php | 13 +-- mongodb/BSON/PackedArray.php | 3 +- mongodb/BSON/Regex.php | 19 +-- mongodb/BSON/Symbol.php | 9 +- mongodb/BSON/Timestamp.php | 20 +--- mongodb/BSON/UTCDateTime.php | 16 +-- mongodb/BSON/Undefined.php | 9 +- mongodb/BulkWrite.php | 22 ++-- mongodb/ClientEncryption.php | 69 ++++++++--- mongodb/Command.php | 4 +- mongodb/Cursor.php | 30 ++--- mongodb/CursorId.php | 9 +- mongodb/Exception/CommandException.php | 3 +- mongodb/Exception/RuntimeException.php | 6 +- mongodb/Exception/WriteException.php | 2 +- mongodb/Manager.php | 80 +++++++------ mongodb/Monitoring/CommandFailedEvent.php | 31 +++-- mongodb/Monitoring/CommandStartedEvent.php | 29 ++++- mongodb/Monitoring/CommandSucceededEvent.php | 29 ++++- mongodb/Monitoring/SDAMSubscriber.php | 64 ++++++++++ mongodb/Monitoring/ServerChangedEvent.php | 46 ++++++++ mongodb/Monitoring/ServerClosedEvent.php | 33 ++++++ .../Monitoring/ServerHeartbeatFailedEvent.php | 43 +++++++ .../ServerHeartbeatStartedEvent.php | 31 +++++ .../ServerHeartbeatSucceededEvent.php | 43 +++++++ mongodb/Monitoring/ServerOpeningEvent.php | 33 ++++++ mongodb/Monitoring/TopologyChangedEvent.php | 34 ++++++ mongodb/Monitoring/TopologyClosedEvent.php | 21 ++++ mongodb/Monitoring/TopologyOpeningEvent.php | 21 ++++ mongodb/Monitoring/functions.php | 5 +- mongodb/Query.php | 4 +- mongodb/ReadConcern.php | 23 ++-- mongodb/ReadPreference.php | 25 ++-- mongodb/Server.php | 109 ++++++------------ mongodb/ServerApi.php | 6 +- mongodb/ServerDescription.php | 60 ++++++++++ mongodb/Session.php | 46 ++++---- mongodb/TopologyDescription.php | 45 ++++++++ mongodb/WriteConcern.php | 28 ++--- mongodb/WriteConcernError.php | 9 +- mongodb/WriteError.php | 12 +- mongodb/WriteResult.php | 34 +++--- 51 files changed, 863 insertions(+), 415 deletions(-) create mode 100644 mongodb/Monitoring/SDAMSubscriber.php create mode 100644 mongodb/Monitoring/ServerChangedEvent.php create mode 100644 mongodb/Monitoring/ServerClosedEvent.php create mode 100644 mongodb/Monitoring/ServerHeartbeatFailedEvent.php create mode 100644 mongodb/Monitoring/ServerHeartbeatStartedEvent.php create mode 100644 mongodb/Monitoring/ServerHeartbeatSucceededEvent.php create mode 100644 mongodb/Monitoring/ServerOpeningEvent.php create mode 100644 mongodb/Monitoring/TopologyChangedEvent.php create mode 100644 mongodb/Monitoring/TopologyClosedEvent.php create mode 100644 mongodb/Monitoring/TopologyOpeningEvent.php create mode 100644 mongodb/ServerDescription.php create mode 100644 mongodb/TopologyDescription.php diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 0371a9654..b61fa2b53 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -682,13 +682,25 @@ final class PhpStormStubsMap 'MongoDB\\Driver\\Monitoring\\CommandStartedEvent' => 'mongodb/Monitoring/CommandStartedEvent.php', 'MongoDB\\Driver\\Monitoring\\CommandSubscriber' => 'mongodb/Monitoring/CommandSubscriber.php', 'MongoDB\\Driver\\Monitoring\\CommandSucceededEvent' => 'mongodb/Monitoring/CommandSucceededEvent.php', + 'MongoDB\\Driver\\Monitoring\\SDAMSubscriber' => 'mongodb/Monitoring/SDAMSubscriber.php', + 'MongoDB\\Driver\\Monitoring\\ServerChangedEvent' => 'mongodb/Monitoring/ServerChangedEvent.php', + 'MongoDB\\Driver\\Monitoring\\ServerClosedEvent' => 'mongodb/Monitoring/ServerClosedEvent.php', + 'MongoDB\\Driver\\Monitoring\\ServerHeartbeatFailedEvent' => 'mongodb/Monitoring/ServerHeartbeatFailedEvent.php', + 'MongoDB\\Driver\\Monitoring\\ServerHeartbeatStartedEvent' => 'mongodb/Monitoring/ServerHeartbeatStartedEvent.php', + 'MongoDB\\Driver\\Monitoring\\ServerHeartbeatSucceededEvent' => 'mongodb/Monitoring/ServerHeartbeatSucceededEvent.php', + 'MongoDB\\Driver\\Monitoring\\ServerOpeningEvent' => 'mongodb/Monitoring/ServerOpeningEvent.php', 'MongoDB\\Driver\\Monitoring\\Subscriber' => 'mongodb/Monitoring/Subscriber.php', + 'MongoDB\\Driver\\Monitoring\\TopologyChangedEvent' => 'mongodb/Monitoring/TopologyChangedEvent.php', + 'MongoDB\\Driver\\Monitoring\\TopologyClosedEvent' => 'mongodb/Monitoring/TopologyClosedEvent.php', + 'MongoDB\\Driver\\Monitoring\\TopologyOpeningEvent' => 'mongodb/Monitoring/TopologyOpeningEvent.php', 'MongoDB\\Driver\\Query' => 'mongodb/Query.php', 'MongoDB\\Driver\\ReadConcern' => 'mongodb/ReadConcern.php', 'MongoDB\\Driver\\ReadPreference' => 'mongodb/ReadPreference.php', 'MongoDB\\Driver\\Server' => 'mongodb/Server.php', 'MongoDB\\Driver\\ServerApi' => 'mongodb/ServerApi.php', + 'MongoDB\\Driver\\ServerDescription' => 'mongodb/ServerDescription.php', 'MongoDB\\Driver\\Session' => 'mongodb/Session.php', + 'MongoDB\\Driver\\TopologyDescription' => 'mongodb/TopologyDescription.php', 'MongoDB\\Driver\\WriteConcern' => 'mongodb/WriteConcern.php', 'MongoDB\\Driver\\WriteConcernError' => 'mongodb/WriteConcernError.php', 'MongoDB\\Driver\\WriteError' => 'mongodb/WriteError.php', diff --git a/mongodb/BSON/Binary.php b/mongodb/BSON/Binary.php index 3d4ab6137..92652ae2d 100644 --- a/mongodb/BSON/Binary.php +++ b/mongodb/BSON/Binary.php @@ -23,58 +23,55 @@ final class Binary implements Type, BinaryInterface, \Serializable, JsonSerializ * @since 1.7.0 */ public const TYPE_ENCRYPTED = 6; + + /** + * @since 1.12.0 + */ + public const TYPE_COLUMN = 7; public const TYPE_USER_DEFINED = 128; /** * Binary constructor. * @link https://php.net/manual/en/mongodb-bson-binary.construct.php - * @param string $data - * @param int $type */ - final public function __construct($data, $type) {} + final public function __construct(string $data, int $type = Binary::TYPE_GENERIC) {} /** * Returns the Binary's data * @link https://php.net/manual/en/mongodb-bson-binary.getdata.php - * @return string */ - final public function getData() {} + final public function getData(): string {} /** * Returns the Binary's type * @link https://php.net/manual/en/mongodb-bson-binary.gettype.php - * @return int */ - final public function getType() {} + final public function getType(): int {} public static function __set_state(array $properties) {} /** * Returns the Binary's data * @link https://www.php.net/manual/en/mongodb-bson-binary.tostring.php - * @return string */ - final public function __toString() {} + final public function __toString(): string {} /** * Serialize a Binary * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-binary.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a Binary * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-binary.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data) {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/DBPointer.php b/mongodb/BSON/DBPointer.php index 9bf110054..d383ecbbb 100644 --- a/mongodb/BSON/DBPointer.php +++ b/mongodb/BSON/DBPointer.php @@ -25,7 +25,7 @@ final private function __construct() {} * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a DBPointer @@ -38,7 +38,7 @@ final public function serialize() {} * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON @@ -54,5 +54,5 @@ final public function jsonSerialize() {} * * @return string Returns the string representation of this Symbol. */ - final public function __toString() {} + final public function __toString(): string {} } diff --git a/mongodb/BSON/Decimal128.php b/mongodb/BSON/Decimal128.php index ab4cf1355..5936979d8 100644 --- a/mongodb/BSON/Decimal128.php +++ b/mongodb/BSON/Decimal128.php @@ -17,14 +17,13 @@ final class Decimal128 implements Type, Decimal128Interface, \Serializable, Json * @link https://php.net/manual/en/mongodb-bson-decimal128.construct.php * @param string $value A decimal string. */ - final public function __construct($value = '') {} + final public function __construct(string $value = '') {} /** * Returns the string representation of this Decimal128 * @link https://php.net/manual/en/mongodb-bson-decimal128.tostring.php - * @return string */ - final public function __toString() {} + final public function __toString(): string {} public static function __set_state(array $properties) {} @@ -35,18 +34,16 @@ public static function __set_state(array $properties) {} * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a Decimal128 * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-decimal128.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/Document.php b/mongodb/BSON/Document.php index d358ec901..86cb17aec 100644 --- a/mongodb/BSON/Document.php +++ b/mongodb/BSON/Document.php @@ -34,8 +34,7 @@ final public static function __set_state(array $properties): Document {} final public function serialize(): string {} - /** @param string $serialized */ - final public function unserialize($serialized): void {} + final public function unserialize(string $data): void {} final public function __unserialize(array $data): void {} diff --git a/mongodb/BSON/Int64.php b/mongodb/BSON/Int64.php index 732216485..ba2145f17 100644 --- a/mongodb/BSON/Int64.php +++ b/mongodb/BSON/Int64.php @@ -19,22 +19,19 @@ final public function __construct(string|int $value) {} /** * Serialize an Int64 * @link https://www.php.net/manual/en/mongodb-bson-int64.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} public static function __set_state(array $properties) {} /** * Unserialize an Int64 * @link https://www.php.net/manual/en/mongodb-bson-int64.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON @@ -48,5 +45,5 @@ final public function jsonSerialize() {} * Returns the Symbol as a string * @return string Returns the string representation of this Symbol. */ - final public function __toString() {} + final public function __toString(): string {} } diff --git a/mongodb/BSON/Javascript.php b/mongodb/BSON/Javascript.php index 12a4ead76..6201b7df8 100644 --- a/mongodb/BSON/Javascript.php +++ b/mongodb/BSON/Javascript.php @@ -15,53 +15,45 @@ final class Javascript implements Type, JavascriptInterface, \Serializable, Json /** * Construct a new Javascript * @link https://php.net/manual/en/mongodb-bson-javascript.construct.php - * @param string $javascript - * @param array|object $scope */ - final public function __construct($javascript, $scope = []) {} + final public function __construct(string $javascript, array|object|null $scope = null) {} public static function __set_state(array $properties) {} /** * Returns the Javascript's code - * @return string * @link https://secure.php.net/manual/en/mongodb-bson-javascript.getcode.php */ - final public function getCode() {} + final public function getCode(): string {} /** * Returns the Javascript's scope document - * @return object|null * @link https://secure.php.net/manual/en/mongodb-bson-javascript.getscope.php */ - final public function getScope() {} + final public function getScope(): ?object {} /** * Returns the Javascript's code - * @return string * @link https://secure.php.net/manual/en/mongodb-bson-javascript.tostring.php */ - final public function __toString() {} + final public function __toString(): string {} /** * Serialize a Javascript * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-javascript.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a Javascript * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-javascript.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/MaxKey.php b/mongodb/BSON/MaxKey.php index 086d4cb4a..c9c65927a 100644 --- a/mongodb/BSON/MaxKey.php +++ b/mongodb/BSON/MaxKey.php @@ -18,21 +18,18 @@ public static function __set_state(array $properties) {} * Serialize a MaxKey * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-maxkey.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a MaxKey * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-maxkey.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/MinKey.php b/mongodb/BSON/MinKey.php index 9926d68a7..c09e3846e 100644 --- a/mongodb/BSON/MinKey.php +++ b/mongodb/BSON/MinKey.php @@ -18,21 +18,18 @@ public static function __set_state(array $properties) {} * Serialize a MinKey * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-minkey.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a MinKey * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-minkey.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/ObjectId.php b/mongodb/BSON/ObjectId.php index 47e5b113f..44d45301f 100644 --- a/mongodb/BSON/ObjectId.php +++ b/mongodb/BSON/ObjectId.php @@ -17,14 +17,13 @@ final class ObjectId implements Type, ObjectIdInterface, \Serializable, JsonSeri * @param string|null $id A 24-character hexadecimal string. If not provided, the driver will generate an ObjectId. * @throws InvalidArgumentException if id is not a 24-character hexadecimal string. */ - final public function __construct($id = null) {} + final public function __construct(?string $id = null) {} /** * Returns the hexadecimal representation of this ObjectId * @link https://php.net/manual/en/mongodb-bson-objectid.tostring.php - * @return string */ - final public function __toString() {} + final public function __toString(): string {} public static function __set_state(array $properties) {} @@ -34,7 +33,7 @@ public static function __set_state(array $properties) {} * @link https://secure.php.net/manual/en/mongodb-bson-objectid.gettimestamp.php * @return int the timestamp component of this ObjectId */ - final public function getTimestamp() {} + final public function getTimestamp(): int {} /** * Returns a representation that can be converted to JSON @@ -48,15 +47,13 @@ final public function jsonSerialize() {} * Serialize an ObjectId * @since 1.2.0 * @link https://secure.php.net/manual/en/mongodb-bson-objectid.serialize.php - * @return string the serialized representation of the object */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize an ObjectId * @since 1.2.0 * @link https://secure.php.net/manual/en/mongodb-bson-objectid.unserialize.php - * @return void */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} } diff --git a/mongodb/BSON/PackedArray.php b/mongodb/BSON/PackedArray.php index c8a6d8dbe..4fc63d8d5 100644 --- a/mongodb/BSON/PackedArray.php +++ b/mongodb/BSON/PackedArray.php @@ -26,8 +26,7 @@ final public static function __set_state(array $properties): PackedArray {} final public function serialize(): string {} - /** @param string $serialized */ - final public function unserialize($serialized): void {} + final public function unserialize(string $data): void {} final public function __unserialize(array $data): void {} diff --git a/mongodb/BSON/Regex.php b/mongodb/BSON/Regex.php index 4eadc6b51..47ae2060f 100644 --- a/mongodb/BSON/Regex.php +++ b/mongodb/BSON/Regex.php @@ -15,30 +15,26 @@ final class Regex implements Type, RegexInterface, \Serializable, JsonSerializab /** * Construct a new Regex * @link https://php.net/manual/en/mongodb-bson-regex.construct.php - * @param string $pattern - * @param string $flags [optional] */ - final public function __construct($pattern, $flags = "") {} + final public function __construct(string $pattern, string $flags = '') {} /** * Returns the Regex's flags * @link https://php.net/manual/en/mongodb-bson-regex.getflags.php */ - final public function getFlags() {} + final public function getFlags(): string {} /** * Returns the Regex's pattern * @link https://php.net/manual/en/mongodb-bson-regex.getpattern.php - * @return string */ - final public function getPattern() {} + final public function getPattern(): string {} /** * Returns the string representation of this Regex * @link https://php.net/manual/en/mongodb-bson-regex.tostring.php - * @return string */ - final public function __toString() {} + final public function __toString(): string {} public static function __set_state(array $properties) {} @@ -46,21 +42,18 @@ public static function __set_state(array $properties) {} * Serialize a Regex * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-regex.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a Regex * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-regex.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/Symbol.php b/mongodb/BSON/Symbol.php index 46f1094b1..a49cb54e4 100644 --- a/mongodb/BSON/Symbol.php +++ b/mongodb/BSON/Symbol.php @@ -21,21 +21,18 @@ final private function __construct() {} * Serialize a Symbol * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-symbol.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a Symbol * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-symbol.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON @@ -50,5 +47,5 @@ final public function jsonSerialize() {} * Returns the Symbol as a string * @return string Returns the string representation of this Symbol. */ - final public function __toString() {} + final public function __toString(): string {} } diff --git a/mongodb/BSON/Timestamp.php b/mongodb/BSON/Timestamp.php index 27effa941..47263fee3 100644 --- a/mongodb/BSON/Timestamp.php +++ b/mongodb/BSON/Timestamp.php @@ -15,55 +15,47 @@ final class Timestamp implements TimestampInterface, Type, \Serializable, JsonSe /** * Construct a new Timestamp * @link https://php.net/manual/en/mongodb-bson-timestamp.construct.php - * @param int $increment - * @param int $timestamp */ - final public function __construct($increment, $timestamp) {} + final public function __construct(int $increment, int $timestamp) {} /** * Returns the string representation of this Timestamp * @link https://php.net/manual/en/mongodb-bson-timestamp.tostring.php - * @return string */ - final public function __toString() {} + final public function __toString(): string {} public static function __set_state(array $properties) {} /** * Returns the increment component of this TimestampInterface * @link https://secure.php.net/manual/en/mongodb-bson-timestampinterface.getincrement.php - * @return int * @since 1.3.0 */ - final public function getIncrement() {} + final public function getIncrement(): int {} /** * Returns the timestamp component of this TimestampInterface * @link https://secure.php.net/manual/en/mongodb-bson-timestampinterface.gettimestamp.php - * @return int * @since 1.3.0 */ - final public function getTimestamp() {} + final public function getTimestamp(): int {} /** * Serialize a Timestamp * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-timestamp.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a Timestamp * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-timestamp.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/UTCDateTime.php b/mongodb/BSON/UTCDateTime.php index 6aff6f0aa..5acc58eb5 100644 --- a/mongodb/BSON/UTCDateTime.php +++ b/mongodb/BSON/UTCDateTime.php @@ -15,45 +15,39 @@ final class UTCDateTime implements Type, UTCDateTimeInterface, \Serializable, \J /** * Construct a new UTCDateTime * @link https://php.net/manual/en/mongodb-bson-utcdatetime.construct.php - * @param int|float|string|DateTimeInterface $milliseconds */ - final public function __construct($milliseconds = null) {} + final public function __construct(int|string|float|DateTimeInterface|null $milliseconds = null) {} public static function __set_state(array $properties) {} /** * Returns the DateTime representation of this UTCDateTime * @link https://php.net/manual/en/mongodb-bson-utcdatetime.todatetime.php - * @return \DateTime */ - final public function toDateTime() {} + final public function toDateTime(): \DateTime {} /** * Returns the string representation of this UTCDateTime * @link https://php.net/manual/en/mongodb-bson-utcdatetime.tostring.php - * @return string */ - final public function __toString() {} + final public function __toString(): string {} /** * Serialize a UTCDateTime * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-utcdatetime.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a UTCDateTime * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-utcdatetime.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON diff --git a/mongodb/BSON/Undefined.php b/mongodb/BSON/Undefined.php index 0ef0ab1e7..9b69ad691 100644 --- a/mongodb/BSON/Undefined.php +++ b/mongodb/BSON/Undefined.php @@ -21,21 +21,18 @@ final private function __construct() {} * Serialize an Undefined * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-undefined.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize an Undefined * @since 1.2.0 * @link https://www.php.net/manual/en/mongodb-bson-undefined.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} /** * Returns a representation that can be converted to JSON @@ -50,5 +47,5 @@ final public function jsonSerialize() {} * Returns the Undefined as a string * @return string Returns the string representation of this Symbol. */ - final public function __toString() {} + final public function __toString(): string {} } diff --git a/mongodb/BulkWrite.php b/mongodb/BulkWrite.php index 9dbf73c4c..15d749929 100644 --- a/mongodb/BulkWrite.php +++ b/mongodb/BulkWrite.php @@ -22,7 +22,7 @@ final class BulkWrite implements \Countable * @param array $options * @throws InvalidArgumentException on argument parsing errors. */ - final public function __construct(?array $options = []) {} + final public function __construct(?array $options = null) {} final public function __wakeup() {} @@ -33,34 +33,32 @@ final public function __wakeup() {} * @return int number of expected roundtrips to execute the BulkWrite. * @throws InvalidArgumentException on argument parsing errors. */ - final public function count() {} + final public function count(): int {} /** * Add a delete operation to the bulk * @link https://php.net/manual/en/mongodb-driver-bulkwrite.delete.php - * @param array|object $query The search filter - * @param array $deleteOptions + * @param array|object $filter The search filter + * @param array|null $deleteOptions * @throws InvalidArgumentException on argument parsing errors. */ - final public function delete($query, ?array $deleteOptions = []) {} + final public function delete(array|object $filter, ?array $deleteOptions = null): void {} /** * Add an insert operation to the bulk - * If the document did not have an _id, a MongoDB\BSON\ObjectId will be generated and returned; otherwise, no value is returned. * @link https://php.net/manual/en/mongodb-driver-bulkwrite.insert.php - * @param array|object $document - * @return mixed + * @return mixed If the document did not have an _id, a MongoDB\BSON\ObjectId will be generated and returned; otherwise, no value is returned. * @throws InvalidArgumentException on argument parsing errors. */ - final public function insert($document) {} + final public function insert(array|object $document) {} /** * Add an update operation to the bulk * @link https://php.net/manual/en/mongodb-driver-bulkwrite.update.php - * @param array|object $query The search filter + * @param array|object $filter The search filter * @param array|object $newObj A document containing either update operators (e.g. $set) or a replacement document (i.e. only field:value expressions) - * @param array $updateOptions + * @param array|null $updateOptions * @throws InvalidArgumentException on argument parsing errors. */ - final public function update($query, $newObj, ?array $updateOptions = []) {} + final public function update(array|object $filter, array|object $newObj, ?array $updateOptions = null) {} } diff --git a/mongodb/ClientEncryption.php b/mongodb/ClientEncryption.php index 4d4170f53..b087ea2cf 100644 --- a/mongodb/ClientEncryption.php +++ b/mongodb/ClientEncryption.php @@ -2,6 +2,7 @@ namespace MongoDB\Driver; +use MongoDB\BSON\Binary; use MongoDB\Driver\Exception\EncryptionException; use MongoDB\Driver\Exception\InvalidArgumentException; @@ -15,30 +16,59 @@ final class ClientEncryption public const AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC = 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'; public const AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM = 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'; - final private function __construct() {} + /** + * @since 1.14.0 + */ + public const ALGORITHM_INDEXED = 'Indexed'; + + /** + * @since 1.14.0 + */ + public const ALGORITHM_UNINDEXED = 'Unindexed'; + + /** + * @since 1.16.0 + */ + public const ALGORITHM_RANGE_PREVIEW = 'RangePreview'; + + /** + * @since 1.14.0 + */ + public const QUERY_TYPE_EQUALITY = 'equality'; + + /** + * @since 1.16.0 + */ + public const QUERY_TYPE_RANGE_PREVIEW = 'rangePreview'; + + /** + * @since 1.14.0 + */ + final public function __construct(array $options) {} final public function __wakeup() {} /** * Adds an alternate name to a key document * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.addkeyaltname.php - * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @param Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. * @param string $keyAltName Alternate name to add to the key document. * @return object|null Returns the previous version of the key document, or null if no document matched. * @throws InvalidArgumentException On argument parsing errors. + * @since 1.15.0 */ - final public function addKeyAltName(\MongoDB\BSON\Binary $keyId, string $keyAltName): ?object {} + final public function addKeyAltName(Binary $keyId, string $keyAltName): ?object {} /** * Creates a new key document and inserts into the key vault collection. * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.createdatakey.php * @param string $kmsProvider The KMS provider ("local" or "aws") that will be used to encrypt the new encryption key. - * @param array $options [optional] - * @return \MongoDB\BSON\Binary Returns the identifier of the new key as a MongoDB\BSON\Binary object with subtype 4 (UUID). + * @param array|null $options [optional] + * @return Binary Returns the identifier of the new key as a MongoDB\BSON\Binary object with subtype 4 (UUID). * @throws InvalidArgumentException On argument parsing errors. * @throws EncryptionException If an error occurs while creating the data key. */ - final public function createDataKey($kmsProvider, ?array $options = []) {} + final public function createDataKey(string $kmsProvider, ?array $options = null): Binary {} /** * Decrypts an encrypted value (BSON binary of subtype 6). @@ -48,27 +78,28 @@ final public function createDataKey($kmsProvider, ?array $options = []) {} * @throws InvalidArgumentException On argument parsing errors. * @throws EncryptionException If an error occurs while decrypting the value. */ - final public function decrypt(\MongoDB\BSON\Binary $keyVaultClient) {} + final public function decrypt(Binary $keyVaultClient) {} /** * Deletes a key document * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.deletekey.php - * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @param Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. * @return object Returns the result of the internal deleteOne operation on the key vault collection. * @throws InvalidArgumentException On argument parsing errors. + * @since 1.15.0 */ - final public function deleteKey(\MongoDB\BSON\Binary $keyId): object {} + final public function deleteKey(Binary $keyId): object {} /** * Encrypts a value with a given key and algorithm. * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.encrypt.php * @param mixed $value The value to be encrypted. Any value that can be inserted into MongoDB can be encrypted using this method. - * @param array $options [optional] - * @return \MongoDB\BSON\Binary Returns the encrypted value as MongoDB\BSON\Binary object with subtype 6. + * @param array|null $options [optional] + * @return Binary Returns the encrypted value as MongoDB\BSON\Binary object with subtype 6. * @throws InvalidArgumentException On argument parsing errors. * @throws EncryptionException If an error occurs while encrypting the value. */ - final public function encrypt($value, ?array $options = []): \MongoDB\BSON\Binary {} + final public function encrypt($value, ?array $options = null): Binary {} /** * Encrypts a Match Expression or Aggregate Expression to query a range index @@ -76,17 +107,19 @@ final public function encrypt($value, ?array $options = []): \MongoDB\BSON\Binar * @param array|null $options * @return object Returns the encrypted expression as a BSON document * @throws InvalidArgumentException On argument parsing errors. + * @since 1.16.0 */ final public function encryptExpression(array|object $expr, ?array $options = null): object {} /** * Gets a key document * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.getkey.php - * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @param Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. * @return object|null Returns the key document, or null if no document matched. * @throws InvalidArgumentException On argument parsing errors. + * @since 1.15.0 */ - final public function getKey(\MongoDB\BSON\Binary $keyId): ?object {} + final public function getKey(Binary $keyId): ?object {} /** * Gets a key document by an alternate name @@ -94,6 +127,7 @@ final public function getKey(\MongoDB\BSON\Binary $keyId): ?object {} * @param string $keyAltName Alternate name for the key document. * @return object|null Returns the key document, or null if no document matched. * @throws InvalidArgumentException On argument parsing errors. + * @since 1.15.0 */ final public function getKeyByAltName(string $keyAltName): ?object {} @@ -102,17 +136,19 @@ final public function getKeyByAltName(string $keyAltName): ?object {} * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.getkeys.php * @return Cursor * @throws InvalidArgumentException On argument parsing errors. + * @since 1.15.0 */ final public function getKeys(): Cursor {} /** * Removes an alternate name from a key document * @link https://www.php.net/manual/en/mongodb-driver-clientencryption.removekeyaltname.php - * @param \MongoDB\BSON\Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. + * @param Binary $keyId A MongoDB\BSON\Binary instance with subtype 4 (UUID) identifying the key document. * @param string $keyAltName Alternate name to remove from the key document. * @return object|null Returns the previous version of the key document, or null if no document matched. + * @since 1.15.0 */ - final public function removeKeyAltName(\MongoDB\BSON\Binary $keyId, string $keyAltName): ?object {} + final public function removeKeyAltName(Binary $keyId, string $keyAltName): ?object {} /** * Rewraps data keys @@ -120,6 +156,7 @@ final public function removeKeyAltName(\MongoDB\BSON\Binary $keyId, string $keyA * @param array|object $filter * @param array|null $options * @return object Returns an object, which will have an optional bulkWriteResult property containing the result of the internal bulkWrite operation as an object. If no data keys matched the filter or the write was unacknowledged, the bulkWriteResult property will be null. + * @since 1.16.0 */ final public function rewrapManyDataKey(array|object $filter, ?array $options = null): object {} } diff --git a/mongodb/Command.php b/mongodb/Command.php index 1c0d51f88..c96c8cda3 100644 --- a/mongodb/Command.php +++ b/mongodb/Command.php @@ -15,12 +15,12 @@ final class Command /** * Construct new Command * @param array|object $document The complete command to construct - * @param array $options Do not use this parameter to specify options described in the command's reference in the MongoDB manual. + * @param array|null $commandOptions Do not use this parameter to specify options described in the command's reference in the MongoDB manual. * @throws InvalidArgumentException on argument parsing errors. * @link https://secure.php.net/manual/en/mongodb-driver-command.construct.php * @since 1.0.0 */ - final public function __construct($document, ?array $options = []) {} + final public function __construct(array|object $document, ?array $commandOptions = null) {} final public function __wakeup() {} } diff --git a/mongodb/Cursor.php b/mongodb/Cursor.php index 196f7e6da..9befc9a71 100644 --- a/mongodb/Cursor.php +++ b/mongodb/Cursor.php @@ -22,25 +22,22 @@ final public function __wakeup() {} /** * Returns the current element. * @link https://www.php.net/manual/en/mongodb-driver-cursor.current.php - * @return array|object */ - public function current() {} + public function current(): array|object|null {} /** * Returns the MongoDB\Driver\CursorId associated with this cursor. A cursor ID cursor uniquely identifies the cursor on the server. * @link https://php.net/manual/en/mongodb-driver-cursor.getid.php - * @return CursorId for this Cursor * @throws InvalidArgumentException on argument parsing errors. */ - final public function getId() {} + final public function getId(): CursorId {} /** * Returns the MongoDB\Driver\Server associated with this cursor. This is the server that executed the query or command. * @link https://php.net/manual/en/mongodb-driver-cursor.getserver.php - * @return Server for this Cursor * @throws InvalidArgumentException on argument parsing errors. */ - final public function getServer() {} + final public function getServer(): Server {} /** * Checks if a cursor is still alive @@ -48,60 +45,53 @@ final public function getServer() {} * @return bool * @throws InvalidArgumentException On argument parsing errors */ - final public function isDead() {} + final public function isDead(): bool {} /** * Returns the current result's index within the cursor. * @link https://www.php.net/manual/en/mongodb-driver-cursor.key.php - * @return int */ - public function key() {} + public function key(): ?int {} /** * Advances the cursor to the next result. * @link https://www.php.net/manual/en/mongodb-driver-cursor.next.php - * @return void * @throws \MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. * @throws \MongoDB\Driver\Exception\ConnectionException if connection to the server fails (for reasons other than authentication). * @throws \MongoDB\Driver\Exception\AuthenticationException if authentication is needed and fails. */ - public function next() {} + public function next(): void {} /** * Rewind the cursor to the first result. * @link https://www.php.net/manual/en/mongodb-driver-cursor.rewind.php - * @return void * @throws \MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. * @throws \MongoDB\Driver\Exception\ConnectionException if connection to the server fails (for reasons other than authentication). * @throws \MongoDB\Driver\Exception\AuthenticationException if authentication is needed and fails. * @throws \MongoDB\Driver\Exception\LogicException if this method is called after the cursor has advanced beyond its first position. */ - public function rewind() {} + public function rewind(): void {} /** * Sets a type map to use for BSON unserialization * * @link https://php.net/manual/en/mongodb-driver-cursor.settypemap.php * - * @param array $typemap - * @return void * @throws InvalidArgumentException On argument parsing errors or if a class in the type map cannot * be instantiated or does not implement MongoDB\BSON\Unserializable */ - final public function setTypeMap(array $typemap) {} + final public function setTypeMap(array $typemap): void {} /** * Returns an array of all result documents for this cursor * @link https://php.net/manual/en/mongodb-driver-cursor.toarray.php - * @return array * @throws InvalidArgumentException On argument parsing errors */ - final public function toArray() {} + final public function toArray(): array {} /** * Checks if the current position in the cursor is valid. * @link https://www.php.net/manual/en/mongodb-driver-cursor.valid.php - * @return bool */ - public function valid() {} + public function valid(): bool {} } diff --git a/mongodb/CursorId.php b/mongodb/CursorId.php index ec34e07a6..ed8041735 100644 --- a/mongodb/CursorId.php +++ b/mongodb/CursorId.php @@ -25,7 +25,7 @@ final private function __construct() {} * @return string representation of the cursor ID. * @throws InvalidArgumentException on argument parsing errors. */ - final public function __toString() {} + final public function __toString(): string {} final public function __wakeup() {} @@ -35,19 +35,16 @@ public static function __set_state(array $properties) {} * Serialize a CursorId * @since 1.7.0 * @link https://php.net/manual/en/mongodb-driver-cursorid.serialize.php - * @return string * @throws InvalidArgumentException */ - final public function serialize() {} + final public function serialize(): string {} /** * Unserialize a CursorId * @since 1.7.0 * @link https://php.net/manual/en/mongodb-driver-cursorid.unserialize.php - * @param string $serialized - * @return void * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed) */ - final public function unserialize($serialized) {} + final public function unserialize(string $data): void {} } diff --git a/mongodb/Exception/CommandException.php b/mongodb/Exception/CommandException.php index eafbfc2c3..ef61293d1 100644 --- a/mongodb/Exception/CommandException.php +++ b/mongodb/Exception/CommandException.php @@ -15,8 +15,7 @@ class CommandException extends ServerException /** * Returns the result document for the failed command * @link https://secure.php.net/manual/en/mongodb-driver-commandexception.getresultdocument.php - * @return object * @since 1.5.0 */ - final public function getResultDocument() {} + final public function getResultDocument(): object {} } diff --git a/mongodb/Exception/RuntimeException.php b/mongodb/Exception/RuntimeException.php index 18acec26b..f0f152a45 100644 --- a/mongodb/Exception/RuntimeException.php +++ b/mongodb/Exception/RuntimeException.php @@ -18,9 +18,7 @@ class RuntimeException extends \RuntimeException implements Exception /** * Whether the given errorLabel is associated with this exception * - * @param string $label - * @return bool - *@since 1.6.0 + * @since 1.6.0 */ - final public function hasErrorLabel($label) {} + final public function hasErrorLabel(string $label): bool {} } diff --git a/mongodb/Exception/WriteException.php b/mongodb/Exception/WriteException.php index 5c847c0ca..a50621ff1 100644 --- a/mongodb/Exception/WriteException.php +++ b/mongodb/Exception/WriteException.php @@ -21,5 +21,5 @@ abstract class WriteException extends ServerException implements Exception * @return WriteResult for the failed write operation * @since 1.0.0 */ - final public function getWriteResult() {} + final public function getWriteResult(): WriteResult {} } diff --git a/mongodb/Manager.php b/mongodb/Manager.php index 960bcc3e6..4af626c6c 100644 --- a/mongodb/Manager.php +++ b/mongodb/Manager.php @@ -23,13 +23,13 @@ final class Manager /** * Manager constructor. * @link https://php.net/manual/en/mongodb-driver-manager.construct.php - * @param string $uri A mongodb:// connection URI - * @param array $options Connection string options - * @param array $driverOptions Any driver-specific options not included in MongoDB connection spec. + * @param string|null $uri A mongodb:// connection URI + * @param array|null $options Connection string options + * @param array|null $driverOptions Any driver-specific options not included in MongoDB connection spec. * @throws InvalidArgumentException on argument parsing errors * @throws RuntimeException if the uri format is invalid */ - final public function __construct($uri = '', array $options = [], array $driverOptions = []) {} + final public function __construct(?string $uri = null, ?array $options = null, ?array $driverOptions = null) {} final public function __wakeup() {} @@ -47,9 +47,8 @@ final public function createClientEncryption(array $options) {} * Execute one or more write operations * @link https://php.net/manual/en/mongodb-driver-manager.executebulkwrite.php * @param string $namespace A fully qualified namespace (databaseName.collectionName) - * @param BulkWrite $zbulk The MongoDB\Driver\BulkWrite to execute. - * @param array|WriteConcern $options WriteConcern type for backwards compatibility - * @return WriteResult + * @param BulkWrite $bulk The MongoDB\Driver\BulkWrite to execute. + * @param array|WriteConcern|null $options WriteConcern type for backwards compatibility * @throws InvalidArgumentException on argument parsing errors. * @throws ConnectionException if connection to the server fails for other then authentication reasons * @throws AuthenticationException if authentication is needed and fails @@ -57,14 +56,13 @@ final public function createClientEncryption(array $options) {} * @throws RuntimeException on other errors (invalid command, command arguments, ...) * @since 1.4.0 added $options argument */ - final public function executeBulkWrite($namespace, BulkWrite $zbulk, $options = []) {} + final public function executeBulkWrite(string $namespace, BulkWrite $bulk, array|WriteConcern|null $options = null): WriteResult {} /** * @link https://php.net/manual/en/mongodb-driver-manager.executecommand.php * @param string $db The name of the database on which to execute the command. * @param Command $command The command document. - * @param array|ReadPreference $options ReadPreference type for backwards compatibility - * @return Cursor + * @param array|ReadPreference|null $options ReadPreference type for backwards compatibility * @throws Exception * @throws AuthenticationException if authentication is needed and fails * @throws ConnectionException if connection to the server fails for other then authentication reasons @@ -73,29 +71,27 @@ final public function executeBulkWrite($namespace, BulkWrite $zbulk, $options = * @throws WriteConcernException on Write Concern failure * @since 1.4.0 added $options argument */ - final public function executeCommand($db, Command $command, $options = []) {} + final public function executeCommand(string $db, Command $command, array|ReadPreference|null $options = null): Cursor {} /** * Execute a MongoDB query * @link https://php.net/manual/en/mongodb-driver-manager.executequery.php * @param string $namespace A fully qualified namespace (databaseName.collectionName) - * @param Query $zquery A MongoDB\Driver\Query to execute. - * @param array|ReadPreference $options ReadPreference type for backwards compatibility - * @return Cursor + * @param Query $query A MongoDB\Driver\Query to execute. + * @param array|ReadPreference|null $options ReadPreference type for backwards compatibility * @throws Exception * @throws AuthenticationException if authentication is needed and fails * @throws ConnectionException if connection to the server fails for other then authentication reasons * @throws RuntimeException on other errors (invalid command, command arguments, ...) * @since 1.4.0 added $options argument */ - final public function executeQuery($namespace, Query $zquery, $options = []) {} + final public function executeQuery(string $namespace, Query $query, array|ReadPreference|null $options = null): Cursor {} /** * @link https://php.net/manual/en/mongodb-driver-manager.executereadcommand.php * @param string $db The name of the database on which to execute the command that reads. * @param Command $command The command document. - * @param array $options - * @return Cursor + * @param array|null $options * @throws Exception * @throws AuthenticationException if authentication is needed and fails * @throws ConnectionException if connection to the server fails for other then authentication reasons @@ -104,14 +100,13 @@ final public function executeQuery($namespace, Query $zquery, $options = []) {} * @throws WriteConcernException on Write Concern failure * @since 1.4.0 */ - final public function executeReadCommand($db, Command $command, array $options = []) {} + final public function executeReadCommand(string $db, Command $command, ?array $options = null): Cursor {} /** * @link https://php.net/manual/en/mongodb-driver-manager.executereadwritecommand.php * @param string $db The name of the database on which to execute the command that reads. * @param Command $command The command document. - * @param array $options - * @return Cursor + * @param array|null $options * @throws Exception * @throws AuthenticationException if authentication is needed and fails * @throws ConnectionException if connection to the server fails for other then authentication reasons @@ -120,14 +115,13 @@ final public function executeReadCommand($db, Command $command, array $options = * @throws WriteConcernException on Write Concern failure * @since 1.4.0 */ - final public function executeReadWriteCommand($db, Command $command, $options = []) {} + final public function executeReadWriteCommand(string $db, Command $command, ?array $options = null): Cursor {} /** * @link https://php.net/manual/en/mongodb-driver-manager.executewritecommand.php * @param string $db The name of the database on which to execute the command that writes. * @param Command $command The command document. - * @param array $options - * @return Cursor + * @param array|null $options * @throws Exception * @throws AuthenticationException if authentication is needed and fails * @throws ConnectionException if connection to the server fails for other then authentication reasons @@ -136,15 +130,21 @@ final public function executeReadWriteCommand($db, Command $command, $options = * @throws WriteConcernException on Write Concern failure * @since 1.4.0 */ - final public function executeWriteCommand($db, Command $command, array $options = []) {} + final public function executeWriteCommand(string $db, Command $command, ?array $options = null): Cursor {} + + /** + * Return the encryptedFieldsMap auto encryption option for the Manager + * @link https://www.php.net/manual/en/mongodb-driver-manager.getencryptedfieldsmap.php + * @since 1.14.0 + */ + final public function getEncryptedFieldsMap(): array|object|null {} /** * Return the ReadConcern for the Manager * @link https://php.net/manual/en/mongodb-driver-manager.getreadconcern.php * @throws InvalidArgumentException on argument parsing errors. - * @return ReadConcern */ - final public function getReadConcern() {} + final public function getReadConcern(): ReadConcern {} /** * Return the ReadPreference for the Manager @@ -152,7 +152,7 @@ final public function getReadConcern() {} * @throws InvalidArgumentException * @return ReadPreference */ - final public function getReadPreference() {} + final public function getReadPreference(): ReadPreference {} /** * Return the servers to which this manager is connected @@ -160,7 +160,7 @@ final public function getReadPreference() {} * @throws InvalidArgumentException on argument parsing errors * @return Server[] */ - final public function getServers() {} + final public function getServers(): array {} /** * Return the WriteConcern for the Manager @@ -168,32 +168,42 @@ final public function getServers() {} * @throws InvalidArgumentException on argument parsing errors. * @return WriteConcern */ - final public function getWriteConcern() {} + final public function getWriteConcern(): WriteConcern {} /** * Preselect a MongoDB node based on provided readPreference. This can be useful to guarantee a command runs on a specific server when operating in a mixed version cluster. * https://secure.php.net/manual/en/mongodb-driver-manager.selectserver.php - * @param ReadPreference $readPreference Optionally, a MongoDB\Driver\ReadPreference to route the command to. If none given, defaults to the Read Preferences set by the MongoDB Connection URI. + * @param ReadPreference|null $readPreference Optionally, a MongoDB\Driver\ReadPreference to route the command to. If none given, defaults to the Read Preferences set by the MongoDB Connection URI. * @throws InvalidArgumentException on argument parsing errors. * @throws ConnectionException if connection to the server fails (for reasons other than authentication). * @throws AuthenticationException if authentication is needed and fails. * @throws RuntimeException if a server matching the read preference could not be found. * @return Server */ - final public function selectServer(ReadPreference $readPreference = null) {} + final public function selectServer(?ReadPreference $readPreference = null) {} /** * Start a new client session for use with this client - * @param array $options + * @param array|null $options * @return \MongoDB\Driver\Session * @throws \MongoDB\Driver\Exception\InvalidArgumentException On argument parsing errors * @throws \MongoDB\Driver\Exception\RuntimeException If the session could not be created (e.g. libmongoc does not support crypto). * @link https://secure.php.net/manual/en/mongodb-driver-manager.startsession.php * @since 1.4.0 */ - final public function startSession(?array $options = []) {} + final public function startSession(?array $options = null) {} - final public function addSubscriber(Subscriber $subscriber) {} + /** + * Registers a monitoring event subscriber with this Manager + * @link https://www.php.net/manual/en/mongodb-driver-manager.addsubscriber.php + * @since 1.10.0 + */ + final public function addSubscriber(Subscriber $subscriber): void {} - final public function removeSubscriber(Subscriber $subscriber) {} + /** + * Unregisters a monitoring event subscriber with this Manager + * @link https://www.php.net/manual/en/mongodb-driver-manager.removesubscriber.php + * @since 1.10.0 + */ + final public function removeSubscriber(Subscriber $subscriber): void {} } diff --git a/mongodb/Monitoring/CommandFailedEvent.php b/mongodb/Monitoring/CommandFailedEvent.php index 5b8db2648..21fc93a92 100644 --- a/mongodb/Monitoring/CommandFailedEvent.php +++ b/mongodb/Monitoring/CommandFailedEvent.php @@ -2,6 +2,9 @@ namespace MongoDB\Driver\Monitoring; +use MongoDB\BSON\ObjectId; +use MongoDB\Driver\Server; + /** * Encapsulates information about a failed command. * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-commandfailedevent.php @@ -20,7 +23,7 @@ final public function __wakeup() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getCommandName() {} + final public function getCommandName(): string {} /** * Returns the command's duration in microseconds @@ -30,7 +33,7 @@ final public function getCommandName() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getDurationMicros() {} + final public function getDurationMicros(): int {} /** * Returns the Exception associated with the failed command @@ -39,7 +42,7 @@ final public function getDurationMicros() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getError() {} + final public function getError(): \Exception {} /** * Returns the command's operation ID. @@ -50,7 +53,7 @@ final public function getError() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getOperationId() {} + final public function getOperationId(): string {} /** * Returns the command reply document. @@ -60,7 +63,7 @@ final public function getOperationId() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getReply() {} + final public function getReply(): object {} /** * Returns the command's request ID. @@ -70,7 +73,7 @@ final public function getReply() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getRequestId() {} + final public function getRequestId(): string {} /** * Returns the Server on which the command was executed. @@ -78,5 +81,19 @@ final public function getRequestId() {} * @return \MongoDB\Driver\Server on which the command was executed. * @since 1.3.0 */ - final public function getServer() {} + final public function getServer(): Server {} + + /** + * Returns the load balancer service ID for the command + * @link https://www.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getserviceid.php + * @since 1.11.0 + */ + final public function getServiceId(): ?ObjectId {} + + /** + * Returns the server connection ID for the command + * @link https://www.php.net/manual/en/mongodb-driver-monitoring-commandfailedevent.getserverconnectionid.php + * @since 1.14.0 + */ + final public function getServerConnectionId(): ?int {} } diff --git a/mongodb/Monitoring/CommandStartedEvent.php b/mongodb/Monitoring/CommandStartedEvent.php index 3ab655e83..31b18d037 100644 --- a/mongodb/Monitoring/CommandStartedEvent.php +++ b/mongodb/Monitoring/CommandStartedEvent.php @@ -2,6 +2,9 @@ namespace MongoDB\Driver\Monitoring; +use MongoDB\BSON\ObjectId; +use MongoDB\Driver\Server; + /** * Encapsulates information about a failed command. * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-commandstartedevent.php @@ -21,7 +24,7 @@ final public function __wakeup() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getCommand() {} + final public function getCommand(): object {} /** * Returns the command name. @@ -30,7 +33,7 @@ final public function getCommand() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getCommandName() {} + final public function getCommandName(): string {} /** * Returns the database on which the command was executed. @@ -39,7 +42,7 @@ final public function getCommandName() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getDatabaseName() {} + final public function getDatabaseName(): string {} /** * Returns the command's operation ID. @@ -50,7 +53,7 @@ final public function getDatabaseName() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getOperationId() {} + final public function getOperationId(): string {} /** * Returns the command's request ID. @@ -60,7 +63,7 @@ final public function getOperationId() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getRequestId() {} + final public function getRequestId(): string {} /** * Returns the Server on which the command was executed. @@ -68,5 +71,19 @@ final public function getRequestId() {} * @return \MongoDB\Driver\Server on which the command was executed. * @since 1.3.0 */ - final public function getServer() {} + final public function getServer(): Server {} + + /** + * Returns the load balancer service ID for the command + * @link https://www.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getserviceid.php + * @since 1.11.0 + */ + final public function getServiceId(): ?ObjectId {} + + /** + * Returns the server connection ID for the command + * @link https://www.php.net/manual/en/mongodb-driver-monitoring-commandstartedevent.getserverconnectionid.php + * @since 1.14.0 + */ + final public function getServerConnectionId(): ?int {} } diff --git a/mongodb/Monitoring/CommandSucceededEvent.php b/mongodb/Monitoring/CommandSucceededEvent.php index 344a0a65b..d55afe0e0 100644 --- a/mongodb/Monitoring/CommandSucceededEvent.php +++ b/mongodb/Monitoring/CommandSucceededEvent.php @@ -2,6 +2,9 @@ namespace MongoDB\Driver\Monitoring; +use MongoDB\BSON\ObjectId; +use MongoDB\Driver\Server; + /** * Encapsulates information about a successful command. * @link https://secure.php.net/manual/en/class.mongodb-driver-monitoring-commandsucceededevent.php @@ -20,7 +23,7 @@ final public function __wakeup() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getCommandName() {} + final public function getCommandName(): string {} /** * Returns the command's duration in microseconds @@ -30,7 +33,7 @@ final public function getCommandName() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getDurationMicros() {} + final public function getDurationMicros(): int {} /** * Returns the command's operation ID. @@ -41,7 +44,7 @@ final public function getDurationMicros() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getOperationId() {} + final public function getOperationId(): string {} /** * Returns the command reply document. @@ -51,7 +54,7 @@ final public function getOperationId() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getReply() {} + final public function getReply(): object {} /** * Returns the command's request ID. @@ -61,7 +64,7 @@ final public function getReply() {} * @throws \InvalidArgumentException on argument parsing errors. * @since 1.3.0 */ - final public function getRequestId() {} + final public function getRequestId(): string {} /** * Returns the Server on which the command was executed. @@ -69,5 +72,19 @@ final public function getRequestId() {} * @return \MongoDB\Driver\Server on which the command was executed. * @since 1.3.0 */ - final public function getServer() {} + final public function getServer(): Server {} + + /** + * Returns the load balancer service ID for the command + * @link https://www.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getserviceid.php + * @since 1.11.0 + */ + final public function getServiceId(): ?ObjectId {} + + /** + * Returns the server connection ID for the command + * @link https://www.php.net/manual/en/mongodb-driver-monitoring-commandsucceededevent.getserverconnectionid.php + * @since 1.14.0 + */ + final public function getServerConnectionId(): ?int {} } diff --git a/mongodb/Monitoring/SDAMSubscriber.php b/mongodb/Monitoring/SDAMSubscriber.php new file mode 100644 index 000000000..0071d1af6 --- /dev/null +++ b/mongodb/Monitoring/SDAMSubscriber.php @@ -0,0 +1,64 @@ + - * options - * - * - * - * Option - * Type - * Description - * - * - * - * - * - * - * - * readPreference - * MongoDB\Driver\ReadPreference - * - *

    - * A read preference to use for selecting a server for the operation. - *

    - * - * - * - * session - * MongoDB\Driver\Session - * - *

    - * A session to associate with the operation. - *

    - * - * - * - * - * The third parameter is now an options array. For backwards compatibility, this parameter will still accept a MongoDB\Driver\ReadPreference object. + * @param Query $query The MongoDB\Driver\Query to execute. + * @param array|ReadPreference|null $options * @throws InvalidArgumentException on argument parsing errors. * @throws ConnectionException if connection to the server fails (for reasons other than authentication). * @throws AuthenticationException if authentication is needed and fails. * @throws RuntimeException on other errors (e.g. invalid command, issuing a write command to a secondary). * @return Cursor */ - final public function executeQuery($namespace, Query $zquery, $options = []) {} + final public function executeQuery(string $namespace, Query $query, array|ReadPreference|null $options = null): Cursor {} /** * Returns the hostname of this server * @link https://php.net/manual/en/mongodb-driver-server.gethost.php * @throws InvalidArgumentException on argument parsing errors. - * @return string */ - final public function getHost() {} + final public function getHost(): string {} /** * Returns an array of information about this server * @link https://php.net/manual/en/mongodb-driver-server.getinfo.php * @throws InvalidArgumentException on argument parsing errors. - * @return array */ - final public function getInfo() {} + final public function getInfo(): array {} /** * Returns the latency of this server * @link https://php.net/manual/en/mongodb-driver-server.getlatency.php * @throws InvalidArgumentException on argument parsing errors. - * @return int */ - final public function getLatency() {} + final public function getLatency(): int {} /** * Returns the port on which this server is listening * @link https://php.net/manual/en/mongodb-driver-server.getport.php * @throws InvalidArgumentException on argument parsing errors. - * @return int */ - final public function getPort() {} + final public function getPort(): int {} + + /** + * Returns a ServerDescription for this server + * https://www.php.net/manual/en/mongodb-driver-server.getserverdescription.php + * @since 1.13.0 + */ + final public function getServerDescription(): ServerDescription {} /** * Returns an array of tags describing this server in a replica set @@ -195,7 +165,7 @@ final public function getPort() {} * @throws InvalidArgumentException on argument parsing errors. * @return array An array of tags used to describe this server in a replica set. The array will contain zero or more string key and value pairs. */ - final public function getTags() {} + final public function getTags(): array {} /** * Returns an integer denoting the type of this server @@ -203,45 +173,40 @@ final public function getTags() {} * @throws InvalidArgumentException on argument parsing errors. * @return int denoting the type of this server */ - final public function getType() {} + final public function getType(): int {} /** * Checks if this server is an arbiter member of a replica set * @link https://php.net/manual/en/mongodb-driver-server.isarbiter.php * @throws InvalidArgumentException on argument parsing errors. - * @return bool */ - final public function isArbiter() {} + final public function isArbiter(): bool {} /** * Checks if this server is a hidden member of a replica set * @link https://php.net/manual/en/mongodb-driver-server.ishidden.php * @throws InvalidArgumentException on argument parsing errors. - * @return bool */ - final public function isHidden() {} + final public function isHidden(): bool {} /** * Checks if this server is a passive member of a replica set * @link https://php.net/manual/en/mongodb-driver-server.ispassive.php * @throws InvalidArgumentException on argument parsing errors. - * @return bool */ - final public function isPassive() {} + final public function isPassive(): bool {} /** * Checks if this server is a primary member of a replica set * @link https://php.net/manual/en/mongodb-driver-server.isprimary.php * @throws InvalidArgumentException on argument parsing errors. - * @return bool */ - final public function isPrimary() {} + final public function isPrimary(): bool {} /** * Checks if this server is a secondary member of a replica set * @link https://php.net/manual/en/mongodb-driver-server.issecondary.php * @throws InvalidArgumentException on argument parsing errors. - * @return bool */ - final public function isSecondary() {} + final public function isSecondary(): bool {} } diff --git a/mongodb/ServerApi.php b/mongodb/ServerApi.php index 30252e829..42a332398 100644 --- a/mongodb/ServerApi.php +++ b/mongodb/ServerApi.php @@ -10,9 +10,9 @@ final public function __construct(string $version, ?bool $strict = false, ?bool public static function __set_state(array $properties) {} - final public function unserialize(string $serialized) {} + final public function unserialize(string $data): void {} - final public function serialize() {} + final public function serialize(): string {} - final public function bsonSerialize() {} + final public function bsonSerialize(): array|object {} } diff --git a/mongodb/ServerDescription.php b/mongodb/ServerDescription.php new file mode 100644 index 000000000..1b1d130f2 --- /dev/null +++ b/mongodb/ServerDescription.php @@ -0,0 +1,60 @@ + Date: Thu, 22 Jun 2023 17:45:06 +0200 Subject: [PATCH 341/419] Update random_int and random_bytes exception thrown --- random/random.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random/random.php b/random/random.php index d4201eb78..c63c8e3dc 100644 --- a/random/random.php +++ b/random/random.php @@ -92,7 +92,7 @@ function getrandmax(): int {} * @param int $length The length of the random string that should be returned in bytes. * @return string Returns a string containing the requested number of cryptographically secure random bytes. * @since 7.0 - * @throws Exception if an appropriate source of randomness cannot be found. + * @throws Random\RandomException if an appropriate source of randomness cannot be found. */ function random_bytes(int $length): string {} @@ -103,7 +103,7 @@ function random_bytes(int $length): string {} * @param int $max The highest value to be returned, which must be less than or equal to PHP_INT_MAX. * @return int Returns a cryptographically secure random integer in the range min to max, inclusive. * @since 7.0 - * @throws Exception if an appropriate source of randomness cannot be found. + * @throws Random\RandomException if an appropriate source of randomness cannot be found. */ function random_int(int $min, int $max): int {} } From d26a67b21d57f22886a793b00f7c31ed02692477 Mon Sep 17 00:00:00 2001 From: Thomas Schulz Date: Tue, 18 Apr 2023 11:24:56 +0200 Subject: [PATCH 342/419] Added meta for Spoofchecker setChecks and setRestrictionLevel method arguments --- meta/.phpstorm.meta.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index ede319ab1..ed06f4cfa 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -627,6 +627,9 @@ function expectedReturnValues($functionReference, $values) { expectedReturnValues(\session_module_name(), argumentsSet('session_module_names')); expectedReturnValues(\session_status(), \PHP_SESSION_DISABLED, \PHP_SESSION_NONE, \PHP_SESSION_ACTIVE); + expectedArguments(\Spoofchecker::setChecks(), 0, \Spoofchecker::SINGLE_SCRIPT_CONFUSABLE | \Spoofchecker::MIXED_SCRIPT_CONFUSABLE | \Spoofchecker::WHOLE_SCRIPT_CONFUSABLE | \Spoofchecker::ANY_CASE | \Spoofchecker::SINGLE_SCRIPT | \Spoofchecker::INVISIBLE | \Spoofchecker::CHAR_LIMIT); + expectedArguments(\Spoofchecker::setRestrictionLevel(), 0, \Spoofchecker::ASCII, \Spoofchecker::HIGHLY_RESTRICTIVE, \Spoofchecker::MODERATELY_RESTRICTIVE, \Spoofchecker::MINIMALLY_RESTRICTIVE, \Spoofchecker::UNRESTRICTIVE, \Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE); + expectedArguments(\checkdnsrr(), 1, 'A', 'MX', 'NS', 'SOA', 'PTR', 'CNAME', 'AAAA', 'A6', 'SRV', 'NAPTR', 'TXT', 'ANY'); expectedArguments(\yaml_emit(), 1, YAML_ANY_ENCODING, YAML_UTF8_ENCODING, YAML_UTF16LE_ENCODING, YAML_UTF16BE_ENCODING); From 3dae7505cf51d570eb4e65f6501f678dbc7fffca Mon Sep 17 00:00:00 2001 From: Martin Herndl Date: Mon, 3 Jul 2023 20:40:25 +0200 Subject: [PATCH 343/419] Add throws PHPDoc to `constant()` --- standard/standard_0.php | 1 + 1 file changed, 1 insertion(+) diff --git a/standard/standard_0.php b/standard/standard_0.php index 62c05f4cb..df3fa0ec1 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -158,6 +158,7 @@ public function read(#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $d *

    * @return mixed the value of the constant, or null if the constant is not * defined. + * @throws Error If the constant is not defined */ #[Pure(true)] function constant(string $name): mixed {} From 0b9854c8ba932966f3cb1469a2d18ab9249272b9 Mon Sep 17 00:00:00 2001 From: Martin Herndl Date: Mon, 3 Jul 2023 21:02:25 +0200 Subject: [PATCH 344/419] WI-72311: Update `constant()` return type description --- standard/standard_0.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/standard/standard_0.php b/standard/standard_0.php index df3fa0ec1..de46f9761 100644 --- a/standard/standard_0.php +++ b/standard/standard_0.php @@ -156,8 +156,7 @@ public function read(#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $d * @param string $name

    * The constant name. *

    - * @return mixed the value of the constant, or null if the constant is not - * defined. + * @return mixed the value of the constant. * @throws Error If the constant is not defined */ #[Pure(true)] From 57e00c6ffbe2d80c6a7d98aa52b9afb3362d3004 Mon Sep 17 00:00:00 2001 From: Artemy Pestretsov Date: Tue, 8 Aug 2023 16:39:20 +0200 Subject: [PATCH 345/419] WI-73605 Add #[Override] attribute --- Core/Core_c.php | 9 +++++++++ PhpStormStubsMap.php | 1 + 2 files changed, 10 insertions(+) diff --git a/Core/Core_c.php b/Core/Core_c.php index 696095752..8058f81bb 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -1124,3 +1124,12 @@ public function getValue(): mixed {} public function __debugInfo(): array {} } + +/** + * @since 8.3 + */ +#[Attribute(Attribute::TARGET_METHOD)] +final class Override +{ + public function __construct() {} +} diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index b61fa2b53..cd5a94c45 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -748,6 +748,7 @@ final class PhpStormStubsMap 'OutOfRangeException' => 'SPL/SPL.php', 'OuterIterator' => 'SPL/SPL.php', 'OverflowException' => 'SPL/SPL.php', + 'Override' => 'Core/Core_c.php', 'OwsrequestObj' => 'mapscript/mapscript.php', 'PDFlib' => 'pdflib/PDFlib.php', 'PDO' => 'PDO/PDO.php', From 515427c694d18132db86bb910a1828eab3699c63 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Mon, 14 Aug 2023 21:57:22 +0100 Subject: [PATCH 346/419] protocol_version was always an int property --- mysqli/mysqli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqli/mysqli.php b/mysqli/mysqli.php index b9dec2fa1..98068a61c 100644 --- a/mysqli/mysqli.php +++ b/mysqli/mysqli.php @@ -169,7 +169,7 @@ class mysqli public $sqlstate; /** - * @var string + * @var int */ #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] public $protocol_version; From 3e7eb717bda68cd04f0879f5d0e306c0605ff7f4 Mon Sep 17 00:00:00 2001 From: Jean-Luc Herren Date: Wed, 9 Aug 2023 14:08:17 +0200 Subject: [PATCH 347/419] Meta: Add missing session related ini values --- meta/.phpstorm.meta.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index ed06f4cfa..99575c37e 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -468,7 +468,7 @@ function argumentsSet($setName) { 'safe_mode', 'safe_mode_allowed_env_vars', 'safe_mode_exec_dir', 'safe_mode_gid', 'safe_mode_include_dir', 'safe_mode_protected_env_vars', 'sendmail_from', 'sendmail_path', 'serialize_precision', - 'session.auto_start', 'session.bug_compat_42', 'session.bug_compat_warn', 'session.cache_expire', 'session.cache_limiter', 'session.cookie_domain', 'session.cookie_httponly', 'session.cookie_lifetime', 'session.cookie_path', 'session.cookie_secure', 'session.entropy_file', 'session.entropy_length', 'session.gc_dividend', 'session.gc_divisor', 'session.gc_maxlifetime', 'session.gc_probability', 'session.hash_bits_per_character', 'session.hash_function', 'session.name', 'session.referer_check', 'session.save_handler', 'session.save_path', 'session.serialize_handler', 'session.use_cookies', 'session.use_only_cookies', 'session.use_trans_sid', + 'session.auto_start', 'session.bug_compat_42', 'session.bug_compat_warn', 'session.cache_expire', 'session.cache_limiter', 'session.cookie_domain', 'session.cookie_httponly', 'session.cookie_lifetime', 'session.cookie_path', 'session.cookie_secure', 'session.cookie_samesite', 'session.entropy_file', 'session.entropy_length', 'session.gc_dividend', 'session.gc_divisor', 'session.gc_maxlifetime', 'session.gc_probability', 'session.hash_bits_per_character', 'session.hash_function', 'session.name', 'session.referer_check', 'session.save_handler', 'session.save_path', 'session.serialize_handler', 'session.use_cookies', 'session.use_only_cookies', 'session.use_trans_sid', 'session.lazy_write', 'session.sid_bits_per_character', 'session.sid_length', 'session.trans_sid_hosts', 'session.trans_sid_tags', 'session.upload_progress.enabled', 'session.upload_progress.cleanup', 'session.upload_progress.prefix', 'session.upload_progress.name', 'session.upload_progress.freq', 'session.upload_progress.min_freq', 'session.use_strict_mode', 'session_pgsql.create_table', 'session_pgsql.db', 'session_pgsql.disable', 'session_pgsql.failover_mode', 'session_pgsql.gc_interval', 'session_pgsql.keep_expired', 'session_pgsql.sem_file_name', 'session_pgsql.serializable', 'session_pgsql.short_circuit', 'session_pgsql.use_app_vars', 'session_pgsql.vacuum_interval', 'short_open_tag', 'simple_cvs.authMethod', 'simple_cvs.compressionLevel', 'simple_cvs.cvsRoot', 'simple_cvs.host', 'simple_cvs.moduleName', 'simple_cvs.userName', 'simple_cvs.workingDir', From d4212d6519b3f1ff5d0f96fec422851c0e41492f Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:11:52 +0200 Subject: [PATCH 348/419] Mark compareDocumentPosition as removed since 8.0 This was never implemented in PHP, and got removed as a consequence in PHP 8.0. This might be introduced later, but for now the stubs shouldn't contain a method that isn't there. --- dom/dom_c.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dom/dom_c.php b/dom/dom_c.php index 9622a4ef6..96318e0e4 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -254,6 +254,7 @@ public function hasAttributes(): bool {} /** * @param DOMNode $other + * @removed 8.0 */ public function compareDocumentPosition(DOMNode $other) {} From c9fda7c71636a795484a6142c00004c45fa49331 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Tue, 11 Jul 2023 16:14:13 +0800 Subject: [PATCH 349/419] Parameter and return of `DOMNode::lookupNamespaceURI` are both nullable --- dom/dom_c.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/dom_c.php b/dom/dom_c.php index 96318e0e4..4bf64209f 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -298,7 +298,7 @@ public function isDefaultNamespace(#[LanguageLevelTypeAware(['8.0' => 'string'], * @param string|null $prefix

    * The prefix of the namespace. *

    - * @return string The namespace URI of the node. + * @return string|null The namespace URI of the node. */ #[PhpStormStubsElementAvailable(from: '8.0')] #[TentativeType] @@ -307,10 +307,10 @@ public function lookupNamespaceURI(?string $prefix): ?string {} /** * Gets the namespace URI of the node based on the prefix * @link https://php.net/manual/en/domnode.lookupnamespaceuri.php - * @param string $prefix

    + * @param string|null $prefix

    * The prefix of the namespace. *

    - * @return string The namespace URI of the node. + * @return string|null The namespace URI of the node. */ #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] public function lookupNamespaceUri($prefix) {} From 71588c847f5aba549289b48ba8619027cc268540 Mon Sep 17 00:00:00 2001 From: Thomas Schulz Date: Tue, 6 Jun 2023 12:14:01 +0200 Subject: [PATCH 350/419] idate and gmdate functions: added descriptions for $timestamp parameter --- date/date.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/date/date.php b/date/date.php index 36e1766ec..7e328bacf 100644 --- a/date/date.php +++ b/date/date.php @@ -382,7 +382,8 @@ function date(string $format, ?int $timestamp) {} * * *

    - * @param int|null $timestamp [optional] + * @param int|null $timestamp [optional] Default value: time(). The optional timestamp parameter is an integer Unix timestamp + * that defaults to the current local time if a timestamp is not given. * @return int|false an integer. *

    * As idate always returns an integer and @@ -400,7 +401,8 @@ function idate(string $format, ?int $timestamp): int|false {} * The format of the outputted date string. See the formatting * options for the date function. *

    - * @param int|null $timestamp [optional] + * @param int|null $timestamp [optional] Default value: time(). The optional timestamp parameter is an integer Unix timestamp + * that defaults to the current local time if a timestamp is not given. * @return string|false a formatted date string. If a non-numeric value is used for * timestamp, false is returned and an * E_WARNING level error is emitted. From 4f769af59f2ba8137965c1784192dbd4c9ac44b6 Mon Sep 17 00:00:00 2001 From: Tim Bond Date: Mon, 29 May 2023 16:00:36 -0700 Subject: [PATCH 351/419] GD: Add docs for font param to imagestring --- gd/gd.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gd/gd.php b/gd/gd.php index 08537aeb2..3e9ee1114 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1445,7 +1445,9 @@ function imagesetpixel(GdImage $image, int $x, int $y, int $color): bool {} * Draw a string horizontally * @link https://php.net/manual/en/function.imagestring.php * @param resource|GdImage $image - * @param int $font + * @param int $font

    + * Can be 1, 2, 3, 4, 5 for built-in fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or (since 8.1) GdFont instance + *

    * @param int $x

    * x-coordinate of the upper left corner. *

    From df7d6e1ea32ec849b0b35eeb47fad13dcbe6047b Mon Sep 17 00:00:00 2001 From: Muqsit Date: Mon, 29 May 2023 15:03:55 +0000 Subject: [PATCH 352/419] Fix return type of SplMinHeap::insert(): void -> true --- SPL/SPL_c1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 010b8dcda..2498758e1 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -1531,7 +1531,7 @@ public function extract() {} * @param TValue $value

    * The value to insert. *

    - * @return void + * @return true */ public function insert($value) {} From 6d1accb78b0e67e4d4196a48d5c79535f555d84e Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Sun, 11 Jun 2023 22:47:14 +0300 Subject: [PATCH 353/419] Added PhpStormStubsMap::DIR constant to simplify integration --- PhpStormStubsMap.php | 2 ++ tests/Tools/generate-stub-map | 2 ++ 2 files changed, 4 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index cd5a94c45..1d5d1597d 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -9,6 +9,8 @@ */ final class PhpStormStubsMap { +const DIR = __DIR__; + const CLASSES = array ( 'AMQPBasicProperties' => 'amqp/amqp.php', 'AMQPChannel' => 'amqp/amqp.php', diff --git a/tests/Tools/generate-stub-map b/tests/Tools/generate-stub-map index c1e406d46..e3a528233 100644 --- a/tests/Tools/generate-stub-map +++ b/tests/Tools/generate-stub-map @@ -271,6 +271,8 @@ namespace JetBrains\PHPStormStub; */ final class PhpStormStubsMap { +const DIR = __DIR__; + const CLASSES = {$exportedClasses}; const FUNCTIONS = {$exportedFunctions}; From 31d97be3dd36cda1097fb5ee78ac07d939ac0285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Tue, 9 May 2023 09:56:03 -0700 Subject: [PATCH 354/419] sync with Relay v0.6.4 --- relay/Relay.php | 82 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/relay/Relay.php b/relay/Relay.php index 2cca4c6a5..184b5d908 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -108,6 +108,16 @@ class Relay */ public const MULTI = 0x01; + /** + * Integer representing we're SUBSCRIBED. Note that this constant can + * only really be accessed when `true` is passed to `getMask()` telling + * relay to return the complete bitmasked mode. + * + * @see \Relay\Relay::getMode() + * @var int + **/ + public const SUBSCRIBED = 0x04; + /** * Integer representing the prefix option. * @@ -801,9 +811,12 @@ public static function license(): array {} * - `stats.empty`: How many times we've run out of free requests (indicating the size of the ring buffers should be increased) * - `stats.oom`: The number of times we've run out of memory * - `stats.ops_per_sec`: The number of commands processed per second - * - `stats.walltime`: The number of microseconds Relay has spent doing work * - `stats.bytes_sent`: The number of bytes Relay has written to the network * - `stats.bytes_received`: The number of bytes Relay has read from the network + * - `stats.command_usec`: The number of microseconds Relay has spent executing commands + * - `stats.rinit_usec`: The number of microseconds Relay has spent in request initialization. + * - `stats.rshutdown_usec`: The number of microseconds Relay has spent in request shutdown. + * - `stats.sigio_usec`: The number of microseconds Relay has spent in its SIGIO handler. * * - `memory.total`: The total bytes of allocated memory * - `memory.limit`: The capped number of bytes Relay has available to use @@ -1564,6 +1577,16 @@ public function psetex(mixed $key, int $milliseconds, mixed $value): Relay|bool #[\Relay\Attributes\RedisCommand] public function publish(string $channel, string $message): Relay|int|false {} + /** + * Posts a message to the given shard channel. + * + * @param string $channel + * @param string $message + * @return Relay|int|false + */ + #[\Relay\Attributes\RedisCommand] + public function spublish(string $channel, string $message): Relay|int|false {} + /** * Set key to hold string value if key does not exist. In that case, it is equal to SET. * When key already holds a value, no operation is performed. @@ -2314,6 +2337,63 @@ public function sunion(mixed $key, mixed ...$other_keys): Relay|array|false {} #[\Relay\Attributes\RedisCommand] public function sunionstore(mixed $key, mixed ...$other_keys): Relay|int|false {} + /** + * Subscribes to the specified channels. + * + * @param array $channels + * @param callable $callback + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function subscribe(array $channels, callable $callback): bool {} + + /** + * Unsubscribes from the given channels, or from all of them if none is given. + * + * @param array $channels + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function unsubscribe(array $channels = []): bool {} + + /** + * Subscribes to the given patterns. + * + * @param array $patterns + * @param callable $callback + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function psubscribe(array $patterns, callable $callback): bool {} + + /** + * Unsubscribes from the given patterns, or from all of them if none is given. + * + * @param array $patterns + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function punsubscribe(array $patterns = []): bool {} + + /** + * Subscribes to the specified shard channels. + * + * @param array $channels + * @param callable $callback + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function ssubscribe(array $channels, callable $callback): bool {} + + /** + * Unsubscribes from the given shard channels, or from all of them if none is given. + * + * @param array $channels + * @return bool + */ + #[\Relay\Attributes\RedisCommand] + public function sunsubscribe(array $channels = []): bool {} + /** * Alters the last access time of a key(s). * From bbf438503eaec39d901fb589a74979ff456fd470 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Fri, 18 Aug 2023 12:21:22 +0200 Subject: [PATCH 355/419] [phpstorm-stubs] Tried to fix tests that used to fail for PHP 8.1 and PHP 8.2. Updated constants, changed return type for WeakMap::getIterator in PHPDoc and added one more parameter to function hash_pbkdf2(). --- Core/Core_c.php | 2 +- curl/curl_d.php | 2 +- hash/hash.php | 13 ++++++++++++- pgsql/pgsql.php | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index 8058f81bb..a297b74b3 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -795,7 +795,7 @@ public function offsetUnset($object): void {} /** * Returns an iterator in the "[object => mixed]" format. * - * @return Traversable + * @return Iterator */ public function getIterator(): Iterator {} diff --git a/curl/curl_d.php b/curl/curl_d.php index 233e564bc..22ed96f49 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -2973,7 +2973,7 @@ /** * @link https://php.net/manual/en/curl.constants.php */ -define("CURLINFO_LASTONE", 62); +define("CURLINFO_LASTONE", 64); /** * An easy handle already added to a multi handle was attempted to get added a second time. * @link https://www.php.net/manual/en/function.curl-multi-exec.php diff --git a/hash/hash.php b/hash/hash.php index 27e87e4dd..f6e9edf6a 100644 --- a/hash/hash.php +++ b/hash/hash.php @@ -280,13 +280,24 @@ function hash_hmac_algos(): array {} * @param bool $binary [optional]

    * When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits. *

    + * @param array $options [optional]

    + * Additional options. This parameter was added for PHP 8.1 only. + *

    * @return string a string containing the derived key as lowercase hexits unless * raw_output is set to TRUE in which case the raw * binary representation of the derived key is returned. * @since 5.5 */ #[Pure] -function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {} +function hash_pbkdf2( + string $algo, + string $password, + string $salt, + int $iterations, + int $length = 0, + bool $binary = false, + #[PhpStormStubsElementAvailable('8.1')] array $options = [] +): string {} /** * Generates a key diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 91f899c0a..c28309a13 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -2066,8 +2066,8 @@ function pg_consume_input(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'] */ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection): int|bool {} -define('PGSQL_LIBPQ_VERSION', "15.3"); -define('PGSQL_LIBPQ_VERSION_STR', "15.3"); +define('PGSQL_LIBPQ_VERSION', "15.4"); +define('PGSQL_LIBPQ_VERSION_STR', "15.4"); /** * Passed to pg_connect to force the creation of a new connection, From 07ab12d8b1d953ad45c70fc1279b4f57308fef62 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Fri, 18 Aug 2023 12:56:56 +0200 Subject: [PATCH 356/419] [phpstorm-stubs] Added to return type in PHPDoc for WeakMap::getIterator() and changed PHP versions interval for parameter in function hash_pbkdf2(). --- Core/Core_c.php | 2 +- hash/hash.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index a297b74b3..37c779d17 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -795,7 +795,7 @@ public function offsetUnset($object): void {} /** * Returns an iterator in the "[object => mixed]" format. * - * @return Iterator + * @return Iterator */ public function getIterator(): Iterator {} diff --git a/hash/hash.php b/hash/hash.php index f6e9edf6a..923bd6744 100644 --- a/hash/hash.php +++ b/hash/hash.php @@ -296,7 +296,7 @@ function hash_pbkdf2( int $iterations, int $length = 0, bool $binary = false, - #[PhpStormStubsElementAvailable('8.1')] array $options = [] + #[PhpStormStubsElementAvailable(from: '8.1', to: '8.1')] array $options = [] ): string {} /** From e053fc3efc54652abb8d158346d8d07bbabbb1dc Mon Sep 17 00:00:00 2001 From: szutoutou Date: Thu, 13 Jul 2023 18:24:53 +0800 Subject: [PATCH 357/419] Fix RedisCluster::hSet parameter $value type --- redis/RedisCluster.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index 3fb316e14..6d2b30649 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -1538,7 +1538,7 @@ public function hIncrBy($key, $hashKey, $value) {} * * @param string $key * @param string $hashKey - * @param string $value + * @param mixed $value * * @return int * 1 if value didn't exist and was added successfully, From 47bb35c2d474304438938bcbd4588ab48703cd4c Mon Sep 17 00:00:00 2001 From: szutoutou Date: Wed, 19 Jul 2023 14:36:38 +0800 Subject: [PATCH 358/419] Update RedisCluster.php --- redis/RedisCluster.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index 6d2b30649..802c6e203 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -246,7 +246,7 @@ public function del($key1, ...$otherKeys) {} * * @param string $key * @param int $ttl - * @param string $value + * @param mix $value * * @return bool TRUE if the command is successful. * @link https://redis.io/commands/setex From b1d570dd8ec1b68c56a8f093718c3c63436ba504 Mon Sep 17 00:00:00 2001 From: szutoutou Date: Fri, 18 Aug 2023 09:32:12 +0800 Subject: [PATCH 359/419] Update RedisCluster.php --- redis/RedisCluster.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index 802c6e203..cec978cd6 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -246,7 +246,7 @@ public function del($key1, ...$otherKeys) {} * * @param string $key * @param int $ttl - * @param mix $value + * @param mixed $value * * @return bool TRUE if the command is successful. * @link https://redis.io/commands/setex From 760c5f908d92159f8b1586f060d5b942b3dd1057 Mon Sep 17 00:00:00 2001 From: Michael Strelan Date: Thu, 8 Jun 2023 13:18:22 +1000 Subject: [PATCH 360/419] Update RedisCluster constructor --- redis/RedisCluster.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index cec978cd6..f52688865 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -78,10 +78,11 @@ class RedisCluster * * @param string|null $name * @param array $seeds - * @param float $timeout - * @param float $readTimeout + * @param int|float $timeout + * @param int|float $readTimeout * @param bool $persistent - * @param string|null $auth + * @param mixed $auth + * @param array $context * @throws RedisClusterException * * @example @@ -105,7 +106,7 @@ class RedisCluster * $redisClusterDev = new RedisCluster('test'); * */ - public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null) {} + public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null, $context = null) {} /** * Disconnects from the RedisCluster instance, except when pconnect is used. From 2cd46df17a943152fb996df9ca71aceff40688ea Mon Sep 17 00:00:00 2001 From: Michael Strelan Date: Fri, 18 Aug 2023 08:34:42 +1000 Subject: [PATCH 361/419] Update to match upstream --- redis/RedisCluster.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index f52688865..5eee15f8a 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -77,12 +77,12 @@ class RedisCluster * Creates a Redis Cluster client * * @param string|null $name - * @param array $seeds + * @param array|null $seeds * @param int|float $timeout * @param int|float $readTimeout * @param bool $persistent * @param mixed $auth - * @param array $context + * @param array|null $context * @throws RedisClusterException * * @example @@ -106,7 +106,7 @@ class RedisCluster * $redisClusterDev = new RedisCluster('test'); * */ - public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null, $context = null) {} + public function __construct($name, $seeds = null, $timeout = null, $readTimeout = null, $persistent = false, $auth = null, $context = null) {} /** * Disconnects from the RedisCluster instance, except when pconnect is used. From 999f85d061ad500aa542350b39c6bf6963f29be4 Mon Sep 17 00:00:00 2001 From: David Kmenta Date: Mon, 24 Apr 2023 14:21:32 +0200 Subject: [PATCH 362/419] Fix Imagick::scaleImage parameter name According to https://github.com/php/doc-en/pull/2444 --- imagick/imagick.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagick/imagick.php b/imagick/imagick.php index 4c0d5a699..af8db68c1 100644 --- a/imagick/imagick.php +++ b/imagick/imagick.php @@ -1951,7 +1951,7 @@ public function setImageFormat($format) {} * If legacy is true, the calculations are done with the small rounding bug that existed in Imagick before 3.4.0.
    * If false, the calculations should produce the same results as ImageMagick CLI does. * @link https://php.net/manual/en/imagick.scaleimage.php - * @param int $cols + * @param int $columns * @param int $rows * @param bool $bestfit [optional] The behavior of the parameter bestfit changed in Imagick 3.0.0. Before this version given dimensions 400x400 an image of dimensions 200x150 would be left untouched. In Imagick 3.0.0 and later the image would be scaled up to size 400x300 as this is the "best fit" for the given dimensions. If bestfit parameter is used both width and height must be given. * @param bool $legacy [optional] Added since 3.4.0. Default value FALSE @@ -1959,7 +1959,7 @@ public function setImageFormat($format) {} * @throws ImagickException Throws ImagickException on error * @since 2.0.0 */ - public function scaleImage($cols, $rows, $bestfit = false, $legacy = false) {} + public function scaleImage($columns, $rows, $bestfit = false, $legacy = false) {} /** * (PECL imagick 0.9.0-0.9.9)
    From 1f3696c6951c58395bf70e985256255e901767e9 Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Fri, 21 Jul 2023 07:41:15 +0200 Subject: [PATCH 363/419] curl_multi_init: fix return description ref.: https://github.com/php/doc-en/pull/2591 --- curl/curl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curl/curl.php b/curl/curl.php index c3b7db346..346f77a6f 100644 --- a/curl/curl.php +++ b/curl/curl.php @@ -2594,7 +2594,7 @@ function curl_close(#[LanguageLevelTypeAware(['8.0' => 'CurlHandle'], default: ' /** * Returns a new cURL multi handle * @link https://php.net/manual/en/function.curl-multi-init.php - * @return resource|CurlMultiHandle|false a cURL multi handle resource on success, false on failure. + * @return resource|CurlMultiHandle a cURL multi handle resource or object depends on the php version */ #[LanguageLevelTypeAware(['8.0' => 'CurlMultiHandle'], default: 'resource')] function curl_multi_init(): CurlMultiHandle {} From 1be6a79e4592d8e21fb7a8a3b19dd5aedaf57b8d Mon Sep 17 00:00:00 2001 From: Mustafa UZUN Date: Sun, 20 Aug 2023 21:41:08 +0300 Subject: [PATCH 364/419] fix: include typo --- meta/.phpstorm.meta.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 99575c37e..f2218004d 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -172,7 +172,7 @@ function argumentsSet($setName) { expectedArguments(\Event::pending(), 0, \Event::READ|\Event::WRITE|\Event::TIMEOUT|\Event::SIGNAL); expectedArguments(\EventBase::loop(), 0, \EventBase::LOOP_ONCE, \EventBase::LOOP_NONBLOCK, \EventBase::NOLOCK, \EventBase::STARTUP_IOCP, \EventBase::NO_CACHE_TIME, \EventBase::EPOLL_USE_CHANGELIST); - expectedArguments(\extension_loaded(), 0, 'amqp', 'apache', 'apc', 'apd', 'bbcode', 'bcmath', 'bcompiler', 'bz2', 'cairo', 'calendar', 'chdb', 'classkit', 'com', 'crack', 'ctype', 'cubrid', 'curl', 'cyrus', 'dba', 'dbase', 'dbplus', 'dbx', 'dio', 'dom', 'dotnet', 'eio', 'enchant', 'ev', 'event', 'exif', 'expect', 'fam', 'fbsql', 'fdf', 'fileinfo', 'filepro', 'filter', 'fribidi', 'ftp', 'gearman', 'gender', 'geoip', 'gettext', 'gmagick', 'gmp', 'gnupg', 'gupnp', 'haru', 'htscanner', 'pecl_http', 'hyperwave', 'hwapi', 'interbase', 'ibm_db2', 'iconv', 'id3', 'informix', 'iisfunc', 'gd', 'imagick', 'imap', 'inclued', 'ingres', 'inotify', 'intl', 'java', 'json', 'judy', 'kadm5', 'ktaglib', 'lapack', 'ldap', 'libevent', 'libxml', 'lua', 'lzf', 'mailparse', 'maxdb', 'mbstring', 'mcrypt', 'mcve', 'memcache', 'memcached', 'memtrack', 'mhash', 'ming', 'mnogosearch', 'mongo', 'mqseries', 'msession', 'msql', 'mssql', 'mysql', 'mysqli', 'mysqlnd', 'mysqlnd_memcache', 'mysqlnd_ms', 'mysqlnd_mux', 'mysqlnd_qc', 'mysqlnd_uh', 'ncurses', 'net_gopher', 'newt', 'notes', 'nsapi', 'oauth', 'oci8', 'oggvorbis', 'openal', 'openssl', 'ovrimos', 'paradox', 'parsekit', 'pcntl', 'pcre', 'pdflib', 'pdo', 'pdo_4d', 'pdo_cubrid', 'pdo_dblib', 'pdo_firebird', 'pdo_ibm', 'pdo_informix', 'pdo_mysql', 'pdo_oci', 'pdo_odbc', 'pdo_pgsql', 'pdo_sqlite', 'pdo_sqlsrv', 'pdo_pgsql', 'phar', 'posix', 'printer', 'proctitle', 'ps', 'pspell', 'pthreads', 'qtdom', 'quickhash', 'radius', 'rar', 'readline', 'recode', 'rpmreader', 'rrd', 'runkit', 'sam', 'sca', 'scream', 'sca_sdo', 'sysvmsg', 'session', 'session_pgsql', 'shmop', 'simplexml', 'snmp', 'soap', 'sockets', 'solr', 'sphinx', 'spl_types', 'spplus', 'sqlite', 'sqlite3', 'sqlsrv', 'ssdeep', 'ssh2', 'stats', 'stomp', 'svm', 'svn', 'swf', 'swish', 'sybase', 'taint', 'tcpwrap', 'tidy', 'tokenizer', 'tokyo_tyrant', 'trader', 'odbc', 'v8js', 'varnish', 'vpopmail', 'w32api', 'wddx', 'weakref', 'win32ps', 'win32service', 'wincache', 'xattr', 'xdiff', 'xhprof', 'xml', 'xmlreader', 'xmlrpc', 'xmlwriter', 'xsl', 'xslt', 'yaf', 'yaml', 'yaz', 'zip', 'zlib'); + expectedArguments(\extension_loaded(), 0, 'amqp', 'apache', 'apc', 'apd', 'bbcode', 'bcmath', 'bcompiler', 'bz2', 'cairo', 'calendar', 'chdb', 'classkit', 'com', 'crack', 'ctype', 'cubrid', 'curl', 'cyrus', 'dba', 'dbase', 'dbplus', 'dbx', 'dio', 'dom', 'dotnet', 'eio', 'enchant', 'ev', 'event', 'exif', 'expect', 'fam', 'fbsql', 'fdf', 'fileinfo', 'filepro', 'filter', 'fribidi', 'ftp', 'gearman', 'gender', 'geoip', 'gettext', 'gmagick', 'gmp', 'gnupg', 'gupnp', 'haru', 'htscanner', 'pecl_http', 'hyperwave', 'hwapi', 'interbase', 'ibm_db2', 'iconv', 'id3', 'informix', 'iisfunc', 'gd', 'imagick', 'imap', 'include', 'ingres', 'inotify', 'intl', 'java', 'json', 'judy', 'kadm5', 'ktaglib', 'lapack', 'ldap', 'libevent', 'libxml', 'lua', 'lzf', 'mailparse', 'maxdb', 'mbstring', 'mcrypt', 'mcve', 'memcache', 'memcached', 'memtrack', 'mhash', 'ming', 'mnogosearch', 'mongo', 'mqseries', 'msession', 'msql', 'mssql', 'mysql', 'mysqli', 'mysqlnd', 'mysqlnd_memcache', 'mysqlnd_ms', 'mysqlnd_mux', 'mysqlnd_qc', 'mysqlnd_uh', 'ncurses', 'net_gopher', 'newt', 'notes', 'nsapi', 'oauth', 'oci8', 'oggvorbis', 'openal', 'openssl', 'ovrimos', 'paradox', 'parsekit', 'pcntl', 'pcre', 'pdflib', 'pdo', 'pdo_4d', 'pdo_cubrid', 'pdo_dblib', 'pdo_firebird', 'pdo_ibm', 'pdo_informix', 'pdo_mysql', 'pdo_oci', 'pdo_odbc', 'pdo_pgsql', 'pdo_sqlite', 'pdo_sqlsrv', 'pdo_pgsql', 'phar', 'posix', 'printer', 'proctitle', 'ps', 'pspell', 'pthreads', 'qtdom', 'quickhash', 'radius', 'rar', 'readline', 'recode', 'rpmreader', 'rrd', 'runkit', 'sam', 'sca', 'scream', 'sca_sdo', 'sysvmsg', 'session', 'session_pgsql', 'shmop', 'simplexml', 'snmp', 'soap', 'sockets', 'solr', 'sphinx', 'spl_types', 'spplus', 'sqlite', 'sqlite3', 'sqlsrv', 'ssdeep', 'ssh2', 'stats', 'stomp', 'svm', 'svn', 'swf', 'swish', 'sybase', 'taint', 'tcpwrap', 'tidy', 'tokenizer', 'tokyo_tyrant', 'trader', 'odbc', 'v8js', 'varnish', 'vpopmail', 'w32api', 'wddx', 'weakref', 'win32ps', 'win32service', 'wincache', 'xattr', 'xdiff', 'xhprof', 'xml', 'xmlreader', 'xmlrpc', 'xmlwriter', 'xsl', 'xslt', 'yaf', 'yaml', 'yaz', 'zip', 'zlib'); registerArgumentsSet('error_levels', E_ALL|E_ERROR|E_WARNING|E_PARSE|E_NOTICE|E_STRICT|E_RECOVERABLE_ERROR|E_DEPRECATED|E_CORE_ERROR|E_CORE_WARNING|E_COMPILE_ERROR|E_COMPILE_WARNING|E_USER_ERROR|E_USER_WARNING|E_USER_NOTICE|E_USER_DEPRECATED); expectedArguments(\error_reporting(), 0, argumentsSet('error_levels')); From 8bd70a80ddddba3f52aa88841c6635c48201d9e9 Mon Sep 17 00:00:00 2001 From: Mustafa UZUN Date: Sun, 20 Aug 2023 21:44:43 +0300 Subject: [PATCH 365/419] fix: other include typos --- meta/.phpstorm.meta.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index f2218004d..63a56fe32 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -617,7 +617,7 @@ function expectedReturnValues($functionReference, $values) { expectedArguments(\pg_select(), 4, argumentsSet('pgResultTypes')); expectedReturnValues(\php_sapi_name(), 'aolserver', 'apache', 'apache2filter', 'apache2handler', 'caudium', 'cgi-fcgi', 'cli', 'cli-server', 'continuity', 'embed', 'fpm-fcgi', 'isapi', 'litespeed', 'milter', 'nsapi', 'phpdbg', 'phttpd', 'pi3web', 'roxen', 'thttpd', 'tux', 'webjames'); - expectedArguments(\phpversion(), 0, 'amqp', 'apache', 'apc', 'apd', 'bbcode', 'bcmath', 'bcompiler', 'bz2', 'cairo', 'calendar', 'chdb', 'classkit', 'com', 'crack', 'ctype', 'cubrid', 'curl', 'cyrus', 'dba', 'dbase', 'dbplus', 'dbx', 'dio', 'dom', 'dotnet', 'eio', 'enchant', 'ev', 'event', 'exif', 'expect', 'fam', 'fbsql', 'fdf', 'fileinfo', 'filepro', 'filter', 'fribidi', 'ftp', 'gearman', 'gender', 'geoip', 'gettext', 'gmagick', 'gmp', 'gnupg', 'gupnp', 'haru', 'htscanner', 'pecl_http', 'hyperwave', 'hwapi', 'interbase', 'ibm_db2', 'iconv', 'id3', 'informix', 'iisfunc', 'gd', 'imagick', 'imap', 'inclued', 'ingres', 'inotify', 'intl', 'java', 'json', 'judy', 'kadm5', 'ktaglib', 'lapack', 'ldap', 'libevent', 'libxml', 'lua', 'lzf', 'mailparse', 'maxdb', 'mbstring', 'mcrypt', 'mcve', 'memcache', 'memcached', 'memtrack', 'mhash', 'ming', 'mnogosearch', 'mongo', 'mqseries', 'msession', 'msql', 'mssql', 'mysql', 'mysqli', 'mysqlnd', 'mysqlnd_memcache', 'mysqlnd_ms', 'mysqlnd_mux', 'mysqlnd_qc', 'mysqlnd_uh', 'ncurses', 'net_gopher', 'newt', 'notes', 'nsapi', 'oauth', 'oci8', 'oggvorbis', 'openal', 'openssl', 'ovrimos', 'paradox', 'parsekit', 'pcntl', 'pcre', 'pdflib', 'pdo', 'pdo_4d', 'pdo_cubrid', 'pdo_dblib', 'pdo_firebird', 'pdo_ibm', 'pdo_informix', 'pdo_mysql', 'pdo_oci', 'pdo_odbc', 'pdo_pgsql', 'pdo_sqlite', 'pdo_sqlsrv', 'pdo_pgsql', 'phar', 'posix', 'printer', 'proctitle', 'ps', 'pspell', 'pthreads', 'qtdom', 'quickhash', 'radius', 'rar', 'readline', 'recode', 'rpmreader', 'rrd', 'runkit', 'sam', 'sca', 'scream', 'sca_sdo', 'sysvmsg', 'session', 'session_pgsql', 'shmop', 'simplexml', 'snmp', 'soap', 'sockets', 'solr', 'sphinx', 'spl_types', 'spplus', 'sqlite', 'sqlite3', 'sqlsrv', 'ssdeep', 'ssh2', 'stats', 'stomp', 'svm', 'svn', 'swf', 'swish', 'sybase', 'taint', 'tcpwrap', 'tidy', 'tokenizer', 'tokyo_tyrant', 'trader', 'odbc', 'v8js', 'varnish', 'vpopmail', 'w32api', 'wddx', 'weakref', 'win32ps', 'win32service', 'wincache', 'xattr', 'xdiff', 'xhprof', 'xml', 'xmlreader', 'xmlrpc', 'xmlwriter', 'xsl', 'xslt', 'yaf', 'yaml', 'yaz', 'zip', 'zlib'); + expectedArguments(\phpversion(), 0, 'amqp', 'apache', 'apc', 'apd', 'bbcode', 'bcmath', 'bcompiler', 'bz2', 'cairo', 'calendar', 'chdb', 'classkit', 'com', 'crack', 'ctype', 'cubrid', 'curl', 'cyrus', 'dba', 'dbase', 'dbplus', 'dbx', 'dio', 'dom', 'dotnet', 'eio', 'enchant', 'ev', 'event', 'exif', 'expect', 'fam', 'fbsql', 'fdf', 'fileinfo', 'filepro', 'filter', 'fribidi', 'ftp', 'gearman', 'gender', 'geoip', 'gettext', 'gmagick', 'gmp', 'gnupg', 'gupnp', 'haru', 'htscanner', 'pecl_http', 'hyperwave', 'hwapi', 'interbase', 'ibm_db2', 'iconv', 'id3', 'informix', 'iisfunc', 'gd', 'imagick', 'imap', 'include', 'ingres', 'inotify', 'intl', 'java', 'json', 'judy', 'kadm5', 'ktaglib', 'lapack', 'ldap', 'libevent', 'libxml', 'lua', 'lzf', 'mailparse', 'maxdb', 'mbstring', 'mcrypt', 'mcve', 'memcache', 'memcached', 'memtrack', 'mhash', 'ming', 'mnogosearch', 'mongo', 'mqseries', 'msession', 'msql', 'mssql', 'mysql', 'mysqli', 'mysqlnd', 'mysqlnd_memcache', 'mysqlnd_ms', 'mysqlnd_mux', 'mysqlnd_qc', 'mysqlnd_uh', 'ncurses', 'net_gopher', 'newt', 'notes', 'nsapi', 'oauth', 'oci8', 'oggvorbis', 'openal', 'openssl', 'ovrimos', 'paradox', 'parsekit', 'pcntl', 'pcre', 'pdflib', 'pdo', 'pdo_4d', 'pdo_cubrid', 'pdo_dblib', 'pdo_firebird', 'pdo_ibm', 'pdo_informix', 'pdo_mysql', 'pdo_oci', 'pdo_odbc', 'pdo_pgsql', 'pdo_sqlite', 'pdo_sqlsrv', 'pdo_pgsql', 'phar', 'posix', 'printer', 'proctitle', 'ps', 'pspell', 'pthreads', 'qtdom', 'quickhash', 'radius', 'rar', 'readline', 'recode', 'rpmreader', 'rrd', 'runkit', 'sam', 'sca', 'scream', 'sca_sdo', 'sysvmsg', 'session', 'session_pgsql', 'shmop', 'simplexml', 'snmp', 'soap', 'sockets', 'solr', 'sphinx', 'spl_types', 'spplus', 'sqlite', 'sqlite3', 'sqlsrv', 'ssdeep', 'ssh2', 'stats', 'stomp', 'svm', 'svn', 'swf', 'swish', 'sybase', 'taint', 'tcpwrap', 'tidy', 'tokenizer', 'tokyo_tyrant', 'trader', 'odbc', 'v8js', 'varnish', 'vpopmail', 'w32api', 'wddx', 'weakref', 'win32ps', 'win32service', 'wincache', 'xattr', 'xdiff', 'xhprof', 'xml', 'xmlreader', 'xmlrpc', 'xmlwriter', 'xsl', 'xslt', 'yaf', 'yaml', 'yaz', 'zip', 'zlib'); registerArgumentsSet('session_cache_limiters', 'public', 'private_no_expire', 'private', 'nocache'); expectedArguments(\session_cache_limiter(), 0, argumentsSet('session_cache_limiters')); From 76e6d9d00d11aa6a2e4980e773e6ae1fff13eda9 Mon Sep 17 00:00:00 2001 From: Luke Arms Date: Sun, 13 Aug 2023 01:12:03 +1000 Subject: [PATCH 366/419] WI-73896: Fix T_BAD_CHARACTER annotation --- tokenizer/tokenizer.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/tokenizer/tokenizer.php b/tokenizer/tokenizer.php index d4aaf82c9..b67d2c50f 100644 --- a/tokenizer/tokenizer.php +++ b/tokenizer/tokenizer.php @@ -190,9 +190,6 @@ function token_name(int $id): string {} * @since 7.4 */ define('T_FN', 311); -/** - * @removed 7.0 - */ define('T_BAD_CHARACTER', 405); /** From 7adcba2bc4825e02886061391c1be205197c1264 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 23 Aug 2023 18:04:05 +0200 Subject: [PATCH 367/419] [phpstorm-stub] WI-73537 Added @throws PDOException for PDO::lastInsertId() --- PDO/PDO.php | 1 + 1 file changed, 1 insertion(+) diff --git a/PDO/PDO.php b/PDO/PDO.php index 98c06135a..bab566d70 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1146,6 +1146,7 @@ public function query( * If the PDO driver does not support this capability, * PDO::lastInsertId triggers an * IM001 SQLSTATE. + * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true. */ #[TentativeType] public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string|false {} From de0f584c6c12d201ab89f9891fef68ba21c7ab19 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Thu, 24 Aug 2023 16:45:41 +0200 Subject: [PATCH 368/419] [phpstorm-stub] WI-73637 Added NumberFormatter::CURRENCY to method's NumberFormatter::create() signature. --- intl/intl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intl/intl.php b/intl/intl.php index 587a55a84..55b956ba7 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -957,7 +957,7 @@ public function __construct( #[TentativeType] public static function create( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED])] $style, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY])] $style, #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null ): ?NumberFormatter {} From c5a4b925667b9b165f490cb54070bd50e9bc3261 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Thu, 24 Aug 2023 17:22:01 +0200 Subject: [PATCH 369/419] [phpstorm-stub] WI-73637 Also added expected values to NumberFormatter constructor. --- intl/intl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intl/intl.php b/intl/intl.php index 55b956ba7..0474a42cf 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -926,7 +926,7 @@ class NumberFormatter #[Pure] public function __construct( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] $style, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY])] $style, #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null ) {} From a92e83f3496f0f237934c7725d3195025fe724f0 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Thu, 24 Aug 2023 17:54:29 +0200 Subject: [PATCH 370/419] [phpstorm-stub] WI-73637 Added all the expected values to NumberFormatter::create() and NumberFormatter::__constructor(). --- intl/intl.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/intl/intl.php b/intl/intl.php index 0474a42cf..33957ac21 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -926,7 +926,11 @@ class NumberFormatter #[Pure] public function __construct( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY])] $style, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, + NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY, NumberFormatter::PERCENT, + NumberFormatter::SCIENTIFIC, NumberFormatter::SPELLOUT, NumberFormatter::ORDINAL, + NumberFormatter::DURATION, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY_ACCOUNTING, + NumberFormatter::DEFAULT_STYLE, NumberFormatter::IGNORE])] $style, #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null ) {} @@ -957,7 +961,11 @@ public function __construct( #[TentativeType] public static function create( #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY])] $style, + #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, + NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY, NumberFormatter::PERCENT, + NumberFormatter::SCIENTIFIC, NumberFormatter::SPELLOUT, NumberFormatter::ORDINAL, + NumberFormatter::DURATION, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY_ACCOUNTING, + NumberFormatter::DEFAULT_STYLE, NumberFormatter::IGNORE])] $style, #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null ): ?NumberFormatter {} From bdf6680c5f36aa814a777360ddddb6027799fb41 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Fri, 25 Aug 2023 14:02:03 +0200 Subject: [PATCH 371/419] [phpstorm-stub] WI-73041 Fixed return type in PHPDoc for substr(). --- standard/standard_1.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/standard/standard_1.php b/standard/standard_1.php index 79b579cfe..592e90438 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -499,7 +499,7 @@ function strcoll(string $string1, string $string2): int {} function money_format(string $format, float $number): ?string {} /** - * Return part of a string + * Return part of a string or false on failure. For PHP8.0+ only string is returned * @link https://php.net/manual/en/function.substr.php * @param string $string

    * The input string. @@ -559,7 +559,6 @@ function money_format(string $format, float $number): ?string {} * $rest = substr("abcdef", -3, -1); // returns "de" * ?> * - * @return string|false the extracted part of string or false on failure. */ #[Pure] #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] From ef2dad0e42afd479a5079e5a8532ba5accfba716 Mon Sep 17 00:00:00 2001 From: szutoutou Date: Mon, 28 Aug 2023 18:10:36 +0800 Subject: [PATCH 372/419] Update RedisCluster.php fix sAdd params $value type --- redis/RedisCluster.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redis/RedisCluster.php b/redis/RedisCluster.php index 5eee15f8a..9737026ef 100644 --- a/redis/RedisCluster.php +++ b/redis/RedisCluster.php @@ -878,9 +878,9 @@ public function sIsMember($key, $value) {} * If this value is already in the set, FALSE is returned. * * @param string $key Required key - * @param string $value1 Required value - * @param string $value2 Optional value - * @param string $valueN Optional value + * @param mixed $value1 Required value + * @param mixed $value2 Optional value + * @param mixed $valueN Optional value * * @return int|false The number of elements added to the set * @link https://redis.io/commands/sadd From 24c80bebffe88c86f312c008b65a99cc8aa8cd01 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 24 Aug 2023 12:49:45 +0200 Subject: [PATCH 373/419] [phpstorm-stubs] update for PHP 8.3 --- .github/workflows/main.yml | 4 +- Core/Core.php | 10 + PhpStormStubsMap.php | 79 +++ Reflection/ReflectionClass.php | 3 +- Reflection/ReflectionClassConstant.php | 10 + Reflection/ReflectionMethod.php | 5 + SPL/SPL.php | 52 +- curl/curl_d.php | 77 +++ date/date_c.php | 50 ++ dom/dom_c.php | 90 +++- gd/gd.php | 11 +- hash/hash.php | 2 +- imap/imap.php | 21 +- intl/IntlChar.php | 3 +- intl/intl.php | 472 ++++++++++-------- json/json.php | 5 + ldap/ldap.php | 5 + mbstring/mbstring.php | 5 + meta/attributes/Deprecated.php | 3 +- mysqli/mysqli.php | 8 +- openssl/openssl.php | 10 + pgsql/pgsql.php | 52 +- phpunit.xml.dist | 10 + posix/posix.php | 28 +- random/random.php | 39 +- sockets/sockets.php | 28 ++ sqlite3/sqlite3.php | 5 + standard/standard_4.php | 4 +- standard/standard_6.php | 5 + standard/standard_8.php | 35 +- standard/standard_9.php | 1 + tests/AbstractBaseStubsTestCase.php | 10 +- tests/BaseClassesTest.php | 23 +- tests/DockerImages/8.3/Dockerfile | 14 + tests/DockerImages/testRunner/Dockerfile | 22 +- tests/Model/BasePHPClass.php | 17 + tests/Model/PHPConst.php | 12 +- tests/Model/PHPEnum.php | 111 ++++ tests/Model/PHPEnumCase.php | 45 ++ tests/Model/PhpVersions.php | 2 +- tests/Model/StubsContainer.php | 62 +++ tests/Parsers/PHPReflectionParser.php | 13 +- tests/Parsers/ParserUtils.php | 10 +- tests/Parsers/Visitors/ASTVisitor.php | 26 +- .../StubsConstantsAndParametersValuesTest.php | 5 +- tests/StubsTypeHintsTest.php | 5 +- .../Reflection/ReflectionMethodsProvider.php | 9 +- tests/TestData/mutedProblems.json | 23 +- xml/xml.php | 5 +- 49 files changed, 1201 insertions(+), 345 deletions(-) create mode 100644 tests/DockerImages/8.3/Dockerfile create mode 100644 tests/Model/PHPEnum.php create mode 100644 tests/Model/PHPEnumCase.php diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 679d22906..473dddb81 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] name: Run tests against php ${{matrix.php}} steps: - name: Checkout @@ -50,4 +50,4 @@ jobs: run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Structure - name: run cs fixer - run: docker-compose -f docker-compose.yml run test_runner composer cs + run: docker-compose -f docker-compose.yml run -e PHP_CS_FIXER_IGNORE_ENV=true test_runner composer cs diff --git a/Core/Core.php b/Core/Core.php index 7e4d5b5ac..6cdbecb38 100755 --- a/Core/Core.php +++ b/Core/Core.php @@ -166,6 +166,16 @@ function str_ends_with(string $haystack, string $needle): bool {} #[Pure] function str_contains(string $haystack, string $needle): bool {} +/** + * @since 8.3 + */ +function str_decrement(string $string): string {} + +/** + * @since 8.3 + */ +function str_increment(string $string): string {} + /** * Return the current key and value pair from an array and advance the array cursor * @link https://php.net/manual/en/function.each.php diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 1d5d1597d..69270a021 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -418,8 +418,17 @@ final class PhpStormStubsMap 'DOMUserDataHandler' => 'dom/dom_c.php', 'DOMXPath' => 'dom/dom_c.php', 'DOTNET' => 'com_dotnet/com_dotnet.php', + 'DateError' => 'date/date_c.php', + 'DateException' => 'date/date_c.php', 'DateInterval' => 'date/date_c.php', + 'DateInvalidOperationException' => 'date/date_c.php', + 'DateInvalidTimeZoneException' => 'date/date_c.php', + 'DateMalformedIntervalStringException' => 'date/date_c.php', + 'DateMalformedPeriodStringException' => 'date/date_c.php', + 'DateMalformedStringException' => 'date/date_c.php', + 'DateObjectError' => 'date/date_c.php', 'DatePeriod' => 'date/date_c.php', + 'DateRangeError' => 'date/date_c.php', 'DateTime' => 'date/date_c.php', 'DateTimeImmutable' => 'date/date_c.php', 'DateTimeInterface' => 'date/date_c.php', @@ -789,6 +798,7 @@ final class PhpStormStubsMap 'Random\\Engine\\PcgOneseq128XslRr64' => 'random/random.php', 'Random\\Engine\\Secure' => 'random/random.php', 'Random\\Engine\\Xoshiro256StarStar' => 'random/random.php', + 'Random\\IntervalBoundary' => 'random/random.php', 'Random\\RandomError' => 'random/random.php', 'Random\\RandomException' => 'random/random.php', 'Random\\Randomizer' => 'random/random.php', @@ -868,6 +878,7 @@ final class PhpStormStubsMap 'SNMP' => 'snmp/snmp.php', 'SNMPException' => 'snmp/snmp.php', 'SQLite3' => 'sqlite3/sqlite3.php', + 'SQLite3Exception' => 'sqlite3/sqlite3.php', 'SQLite3Result' => 'sqlite3/sqlite3.php', 'SQLite3Stmt' => 'sqlite3/sqlite3.php', 'SQLiteDatabase' => 'SQLite/SQLite.php', @@ -3352,6 +3363,7 @@ final class PhpStormStubsMap 'json_encode' => 'json/json.php', 'json_last_error' => 'json/json.php', 'json_last_error_msg' => 'json/json.php', + 'json_validate' => 'json/json.php', 'juliantojd' => 'calendar/calendar.php', 'kafka_err2name' => 'simple_kafka_client/functions.php', 'kafka_err2str' => 'simple_kafka_client/functions.php', @@ -3388,6 +3400,7 @@ final class PhpStormStubsMap 'ldap_exop' => 'ldap/ldap.php', 'ldap_exop_passwd' => 'ldap/ldap.php', 'ldap_exop_refresh' => 'ldap/ldap.php', + 'ldap_exop_sync' => 'ldap/ldap.php', 'ldap_exop_whoami' => 'ldap/ldap.php', 'ldap_explode_dn' => 'ldap/ldap.php', 'ldap_first_attribute' => 'ldap/ldap.php', @@ -3713,6 +3726,7 @@ final class PhpStormStubsMap 'mb_scrub' => 'mbstring/mbstring.php', 'mb_send_mail' => 'mbstring/mbstring.php', 'mb_split' => 'mbstring/mbstring.php', + 'mb_str_pad' => 'mbstring/mbstring.php', 'mb_str_split' => 'mbstring/mbstring.php', 'mb_strcut' => 'mbstring/mbstring.php', 'mb_strimwidth' => 'mbstring/mbstring.php', @@ -4635,6 +4649,7 @@ final class PhpStormStubsMap 'pg_dbname' => 'pgsql/pgsql.php', 'pg_delete' => 'pgsql/pgsql.php', 'pg_end_copy' => 'pgsql/pgsql.php', + 'pg_enter_pipeline_mode' => 'pgsql/pgsql.php', 'pg_errormessage' => 'pgsql/pgsql.php', 'pg_escape_bytea' => 'pgsql/pgsql.php', 'pg_escape_identifier' => 'pgsql/pgsql.php', @@ -4642,6 +4657,7 @@ final class PhpStormStubsMap 'pg_escape_string' => 'pgsql/pgsql.php', 'pg_exec' => 'pgsql/pgsql.php', 'pg_execute' => 'pgsql/pgsql.php', + 'pg_exit_pipeline_mode' => 'pgsql/pgsql.php', 'pg_fetch_all' => 'pgsql/pgsql.php', 'pg_fetch_all_columns' => 'pgsql/pgsql.php', 'pg_fetch_array' => 'pgsql/pgsql.php', @@ -4705,6 +4721,8 @@ final class PhpStormStubsMap 'pg_parameter_status' => 'pgsql/pgsql.php', 'pg_pconnect' => 'pgsql/pgsql.php', 'pg_ping' => 'pgsql/pgsql.php', + 'pg_pipeline_status' => 'pgsql/pgsql.php', + 'pg_pipeline_sync' => 'pgsql/pgsql.php', 'pg_port' => 'pgsql/pgsql.php', 'pg_prepare' => 'pgsql/pgsql.php', 'pg_put_line' => 'pgsql/pgsql.php', @@ -4721,6 +4739,7 @@ final class PhpStormStubsMap 'pg_send_query' => 'pgsql/pgsql.php', 'pg_send_query_params' => 'pgsql/pgsql.php', 'pg_set_client_encoding' => 'pgsql/pgsql.php', + 'pg_set_error_context_visibility' => 'pgsql/pgsql.php', 'pg_set_error_verbosity' => 'pgsql/pgsql.php', 'pg_setclientencoding' => 'pgsql/pgsql.php', 'pg_socket' => 'pgsql/pgsql.php', @@ -4759,6 +4778,7 @@ final class PhpStormStubsMap 'pos' => 'standard/standard_9.php', 'posix_access' => 'posix/posix.php', 'posix_ctermid' => 'posix/posix.php', + 'posix_eaccess' => 'posix/posix.php', 'posix_errno' => 'posix/posix.php', 'posix_get_last_error' => 'posix/posix.php', 'posix_getcwd' => 'posix/posix.php', @@ -4791,6 +4811,7 @@ final class PhpStormStubsMap 'posix_setsid' => 'posix/posix.php', 'posix_setuid' => 'posix/posix.php', 'posix_strerror' => 'posix/posix.php', + 'posix_sysconf' => 'posix/posix.php', 'posix_times' => 'posix/posix.php', 'posix_ttyname' => 'posix/posix.php', 'posix_uname' => 'posix/posix.php', @@ -5028,6 +5049,7 @@ final class PhpStormStubsMap 'socket_addrinfo_connect' => 'sockets/sockets.php', 'socket_addrinfo_explain' => 'sockets/sockets.php', 'socket_addrinfo_lookup' => 'sockets/sockets.php', + 'socket_atmark' => 'sockets/sockets.php', 'socket_bind' => 'sockets/sockets.php', 'socket_clear_error' => 'sockets/sockets.php', 'socket_close' => 'sockets/sockets.php', @@ -5379,8 +5401,10 @@ final class PhpStormStubsMap 'stomp_unsubscribe' => 'stomp/stomp.php', 'stomp_version' => 'stomp/stomp.php', 'str_contains' => 'Core/Core.php', + 'str_decrement' => 'Core/Core.php', 'str_ends_with' => 'Core/Core.php', 'str_getcsv' => 'standard/standard_2.php', + 'str_increment' => 'Core/Core.php', 'str_ireplace' => 'standard/standard_1.php', 'str_pad' => 'standard/standard_2.php', 'str_repeat' => 'standard/standard_1.php', @@ -5405,6 +5429,7 @@ final class PhpStormStubsMap 'stream_context_get_params' => 'standard/standard_6.php', 'stream_context_set_default' => 'standard/standard_6.php', 'stream_context_set_option' => 'standard/standard_6.php', + 'stream_context_set_options' => 'standard/standard_6.php', 'stream_context_set_params' => 'standard/standard_6.php', 'stream_copy_to_stream' => 'standard/standard_6.php', 'stream_filter_append' => 'standard/standard_6.php', @@ -6586,6 +6611,8 @@ final class PhpStormStubsMap 'CURLHSTS_READONLYFILE' => 'curl/curl_d.php', 'CURLINFO_APPCONNECT_TIME' => 'curl/curl_d.php', 'CURLINFO_APPCONNECT_TIME_T' => 'curl/curl_d.php', + 'CURLINFO_CAINFO' => 'curl/curl_d.php', + 'CURLINFO_CAPATH' => 'curl/curl_d.php', 'CURLINFO_CERTINFO' => 'curl/curl_d.php', 'CURLINFO_CONDITION_UNMET' => 'curl/curl_d.php', 'CURLINFO_CONNECT_TIME' => 'curl/curl_d.php', @@ -6650,6 +6677,11 @@ final class PhpStormStubsMap 'CURLINFO_STARTTRANSFER_TIME_T' => 'curl/curl_d.php', 'CURLINFO_TOTAL_TIME' => 'curl/curl_d.php', 'CURLINFO_TOTAL_TIME_T' => 'curl/curl_d.php', + 'CURLKHMATCH_LAST' => 'curl/curl_d.php', + 'CURLKHMATCH_MISMATCH' => 'curl/curl_d.php', + 'CURLKHMATCH_MISSING' => 'curl/curl_d.php', + 'CURLKHMATCH_OK' => 'curl/curl_d.php', + 'CURLMIMEOPT_FORMESCAPE' => 'curl/curl_d.php', 'CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE' => 'curl/curl_d.php', 'CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE' => 'curl/curl_d.php', 'CURLMOPT_MAXCONNECTS' => 'curl/curl_d.php', @@ -6681,6 +6713,7 @@ final class PhpStormStubsMap 'CURLOPT_CAINFO' => 'curl/curl_d.php', 'CURLOPT_CAINFO_BLOB' => 'curl/curl_d.php', 'CURLOPT_CAPATH' => 'curl/curl_d.php', + 'CURLOPT_CA_CACHE_TIMEOUT' => 'curl/curl_d.php', 'CURLOPT_CERTINFO' => 'curl/curl_d.php', 'CURLOPT_CLOSEPOLICY' => 'curl/curl_d.php', 'CURLOPT_CONNECTTIMEOUT' => 'curl/curl_d.php', @@ -6780,6 +6813,7 @@ final class PhpStormStubsMap 'CURLOPT_MAXREDIRS' => 'curl/curl_d.php', 'CURLOPT_MAX_RECV_SPEED_LARGE' => 'curl/curl_d.php', 'CURLOPT_MAX_SEND_SPEED_LARGE' => 'curl/curl_d.php', + 'CURLOPT_MIME_OPTIONS' => 'curl/curl_d.php', 'CURLOPT_MUTE' => 'curl/curl_d.php', 'CURLOPT_NETRC' => 'curl/curl_d.php', 'CURLOPT_NETRC_FILE' => 'curl/curl_d.php', @@ -6804,6 +6838,7 @@ final class PhpStormStubsMap 'CURLOPT_PRIVATE' => 'curl/curl_d.php', 'CURLOPT_PROGRESSFUNCTION' => 'curl/curl_d.php', 'CURLOPT_PROTOCOLS' => 'curl/curl_d.php', + 'CURLOPT_PROTOCOLS_STR' => 'curl/curl_d.php', 'CURLOPT_PROXY' => 'curl/curl_d.php', 'CURLOPT_PROXYAUTH' => 'curl/curl_d.php', 'CURLOPT_PROXYHEADER' => 'curl/curl_d.php', @@ -6838,12 +6873,14 @@ final class PhpStormStubsMap 'CURLOPT_PROXY_TLSAUTH_USERNAME' => 'curl/curl_d.php', 'CURLOPT_PROXY_TRANSFER_MODE' => 'curl/curl_d.php', 'CURLOPT_PUT' => 'curl/curl_d.php', + 'CURLOPT_QUICK_EXIT' => 'curl/curl_d.php', 'CURLOPT_QUOTE' => 'curl/curl_d.php', 'CURLOPT_RANDOM_FILE' => 'curl/curl_d.php', 'CURLOPT_RANGE' => 'curl/curl_d.php', 'CURLOPT_READDATA' => 'curl/curl_d.php', 'CURLOPT_READFUNCTION' => 'curl/curl_d.php', 'CURLOPT_REDIR_PROTOCOLS' => 'curl/curl_d.php', + 'CURLOPT_REDIR_PROTOCOLS_STR' => 'curl/curl_d.php', 'CURLOPT_REFERER' => 'curl/curl_d.php', 'CURLOPT_REQUEST_TARGET' => 'curl/curl_d.php', 'CURLOPT_RESOLVE' => 'curl/curl_d.php', @@ -6865,6 +6902,7 @@ final class PhpStormStubsMap 'CURLOPT_SOCKS5_GSSAPI_SERVICE' => 'curl/curl_d.php', 'CURLOPT_SSH_AUTH_TYPES' => 'curl/curl_d.php', 'CURLOPT_SSH_COMPRESSION' => 'curl/curl_d.php', + 'CURLOPT_SSH_HOSTKEYFUNCTION' => 'curl/curl_d.php', 'CURLOPT_SSH_HOST_PUBLIC_KEY_MD5' => 'curl/curl_d.php', 'CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256' => 'curl/curl_d.php', 'CURLOPT_SSH_KNOWNHOSTS' => 'curl/curl_d.php', @@ -6927,6 +6965,7 @@ final class PhpStormStubsMap 'CURLOPT_WILDCARDMATCH' => 'curl/curl_d.php', 'CURLOPT_WRITEFUNCTION' => 'curl/curl_d.php', 'CURLOPT_WRITEHEADER' => 'curl/curl_d.php', + 'CURLOPT_WS_OPTIONS' => 'curl/curl_d.php', 'CURLOPT_XFERINFOFUNCTION' => 'curl/curl_d.php', 'CURLOPT_XOAUTH2_BEARER' => 'curl/curl_d.php', 'CURLPAUSE_ALL' => 'curl/curl_d.php', @@ -7032,6 +7071,7 @@ final class PhpStormStubsMap 'CURLUSESSL_NONE' => 'curl/curl_d.php', 'CURLUSESSL_TRY' => 'curl/curl_d.php', 'CURLVERSION_NOW' => 'curl/curl_d.php', + 'CURLWS_RAW_MODE' => 'curl/curl_d.php', 'CURL_FNMATCHFUNC_FAIL' => 'curl/curl_d.php', 'CURL_FNMATCHFUNC_MATCH' => 'curl/curl_d.php', 'CURL_FNMATCHFUNC_NOMATCH' => 'curl/curl_d.php', @@ -8218,9 +8258,17 @@ final class PhpStormStubsMap 'IPV6_TCLASS' => 'sockets/sockets.php', 'IPV6_UNICAST_HOPS' => 'sockets/sockets.php', 'IPV6_V6ONLY' => 'sockets/sockets.php', + 'IP_BIND_ADDRESS_NO_PORT' => 'sockets/sockets.php', + 'IP_MTU_DISCOVER' => 'sockets/sockets.php', 'IP_MULTICAST_IF' => 'sockets/sockets.php', 'IP_MULTICAST_LOOP' => 'sockets/sockets.php', 'IP_MULTICAST_TTL' => 'sockets/sockets.php', + 'IP_PMTUDISC_DO' => 'sockets/sockets.php', + 'IP_PMTUDISC_DONT' => 'sockets/sockets.php', + 'IP_PMTUDISC_INTERFACE' => 'sockets/sockets.php', + 'IP_PMTUDISC_OMIT' => 'sockets/sockets.php', + 'IP_PMTUDISC_PROBE' => 'sockets/sockets.php', + 'IP_PMTUDISC_WANT' => 'sockets/sockets.php', 'ImageButton' => 'winbinder/winbinder.php', 'InvisibleArea' => 'winbinder/winbinder.php', 'JOB_QUEUE_PRIORITY_HIGH' => 'zend/zend_d.php', @@ -10512,6 +10560,7 @@ final class PhpStormStubsMap 'OPENSSL_CMS_NOINTERN' => 'openssl/openssl.php', 'OPENSSL_CMS_NOSIGS' => 'openssl/openssl.php', 'OPENSSL_CMS_NOVERIFY' => 'openssl/openssl.php', + 'OPENSSL_CMS_OLDMIMETYPE' => 'openssl/openssl.php', 'OPENSSL_CMS_TEXT' => 'openssl/openssl.php', 'OPENSSL_DEFAULT_STREAM_CIPHERS' => 'openssl/openssl.php', 'OPENSSL_DONT_ZERO_PAD_KEY' => 'openssl/openssl.php', @@ -10639,6 +10688,7 @@ final class PhpStormStubsMap 'PGSQL_DML_STRING' => 'pgsql/pgsql.php', 'PGSQL_EMPTY_QUERY' => 'pgsql/pgsql.php', 'PGSQL_ERRORS_DEFAULT' => 'pgsql/pgsql.php', + 'PGSQL_ERRORS_SQLSTATE' => 'pgsql/pgsql.php', 'PGSQL_ERRORS_TERSE' => 'pgsql/pgsql.php', 'PGSQL_ERRORS_VERBOSE' => 'pgsql/pgsql.php', 'PGSQL_FATAL_ERROR' => 'pgsql/pgsql.php', @@ -10649,6 +10699,10 @@ final class PhpStormStubsMap 'PGSQL_NOTICE_CLEAR' => 'pgsql/pgsql.php', 'PGSQL_NOTICE_LAST' => 'pgsql/pgsql.php', 'PGSQL_NUM' => 'pgsql/pgsql.php', + 'PGSQL_PIPELINE_ABORTED' => 'pgsql/pgsql.php', + 'PGSQL_PIPELINE_OFF' => 'pgsql/pgsql.php', + 'PGSQL_PIPELINE_ON' => 'pgsql/pgsql.php', + 'PGSQL_PIPELINE_SYNC' => 'pgsql/pgsql.php', 'PGSQL_POLLING_ACTIVE' => 'pgsql/pgsql.php', 'PGSQL_POLLING_FAILED' => 'pgsql/pgsql.php', 'PGSQL_POLLING_OK' => 'pgsql/pgsql.php', @@ -10657,8 +10711,12 @@ final class PhpStormStubsMap 'PGSQL_SEEK_CUR' => 'pgsql/pgsql.php', 'PGSQL_SEEK_END' => 'pgsql/pgsql.php', 'PGSQL_SEEK_SET' => 'pgsql/pgsql.php', + 'PGSQL_SHOW_CONTEXT_ALWAYS' => 'pgsql/pgsql.php', + 'PGSQL_SHOW_CONTEXT_ERRORS' => 'pgsql/pgsql.php', + 'PGSQL_SHOW_CONTEXT_NEVER' => 'pgsql/pgsql.php', 'PGSQL_STATUS_LONG' => 'pgsql/pgsql.php', 'PGSQL_STATUS_STRING' => 'pgsql/pgsql.php', + 'PGSQL_TRACE_REGRESS_MODE' => 'pgsql/pgsql.php', 'PGSQL_TRANSACTION_ACTIVE' => 'pgsql/pgsql.php', 'PGSQL_TRANSACTION_IDLE' => 'pgsql/pgsql.php', 'PGSQL_TRANSACTION_INERROR' => 'pgsql/pgsql.php', @@ -10752,6 +10810,7 @@ final class PhpStormStubsMap 'PKCS7_NOCERTS' => 'openssl/openssl.php', 'PKCS7_NOCHAIN' => 'openssl/openssl.php', 'PKCS7_NOINTERN' => 'openssl/openssl.php', + 'PKCS7_NOOLDMIMETYPE' => 'openssl/openssl.php', 'PKCS7_NOSIGS' => 'openssl/openssl.php', 'PKCS7_NOVERIFY' => 'openssl/openssl.php', 'PKCS7_TEXT' => 'openssl/openssl.php', @@ -10771,6 +10830,16 @@ final class PhpStormStubsMap 'POLL_PRI' => 'pcntl/pcntl.php', 'POSITIVE_SIGN' => 'standard/standard_defines.php', 'POSIX_F_OK' => 'posix/posix.php', + 'POSIX_PC_ALLOC_SIZE_MIN' => 'posix/posix.php', + 'POSIX_PC_CHOWN_RESTRICTED' => 'posix/posix.php', + 'POSIX_PC_LINK_MAX' => 'posix/posix.php', + 'POSIX_PC_MAX_CANON' => 'posix/posix.php', + 'POSIX_PC_MAX_INPUT' => 'posix/posix.php', + 'POSIX_PC_NAME_MAX' => 'posix/posix.php', + 'POSIX_PC_NO_TRUNC' => 'posix/posix.php', + 'POSIX_PC_PATH_MAX' => 'posix/posix.php', + 'POSIX_PC_PIPE_BUF' => 'posix/posix.php', + 'POSIX_PC_SYMLINK_MAX' => 'posix/posix.php', 'POSIX_RLIMIT_AS' => 'posix/posix.php', 'POSIX_RLIMIT_CORE' => 'posix/posix.php', 'POSIX_RLIMIT_CPU' => 'posix/posix.php', @@ -10789,6 +10858,10 @@ final class PhpStormStubsMap 'POSIX_RLIMIT_SIGPENDING' => 'posix/posix.php', 'POSIX_RLIMIT_STACK' => 'posix/posix.php', 'POSIX_R_OK' => 'posix/posix.php', + 'POSIX_SC_ARG_MAX' => 'posix/posix.php', + 'POSIX_SC_NPROCESSORS_CONF' => 'posix/posix.php', + 'POSIX_SC_NPROCESSORS_ONLN' => 'posix/posix.php', + 'POSIX_SC_PAGESIZE' => 'posix/posix.php', 'POSIX_S_IFBLK' => 'posix/posix.php', 'POSIX_S_IFCHR' => 'posix/posix.php', 'POSIX_S_IFIFO' => 'posix/posix.php', @@ -11847,6 +11920,7 @@ final class PhpStormStubsMap 'SOL_SOCKET' => 'sockets/sockets.php', 'SOL_TCP' => 'sockets/sockets.php', 'SOL_UDP' => 'sockets/sockets.php', + 'SOL_UDPLITE' => 'sockets/sockets.php', 'SOMAXCONN' => 'sockets/sockets.php', 'SORTARRIVAL' => 'imap/imap.php', 'SORTCC' => 'imap/imap.php', @@ -11863,10 +11937,13 @@ final class PhpStormStubsMap 'SORT_NUMERIC' => 'standard/standard_defines.php', 'SORT_REGULAR' => 'standard/standard_defines.php', 'SORT_STRING' => 'standard/standard_defines.php', + 'SO_ATTACH_REUSEPORT_CBPF' => 'sockets/sockets.php', 'SO_BINDTODEVICE' => 'sockets/sockets.php', 'SO_BPF_EXTENSIONS' => 'sockets/sockets.php', 'SO_BROADCAST' => 'sockets/sockets.php', 'SO_DEBUG' => 'sockets/sockets.php', + 'SO_DETACH_BPF' => 'sockets/sockets.php', + 'SO_DETACH_FILTER' => 'sockets/sockets.php', 'SO_DONTROUTE' => 'sockets/sockets.php', 'SO_ERROR' => 'sockets/sockets.php', 'SO_FREE' => 'imap/imap.php', @@ -12770,6 +12847,8 @@ final class PhpStormStubsMap 'TCP_KEEPINTVL' => 'sockets/sockets.php', 'TCP_NODELAY' => 'sockets/sockets.php', 'TCP_NOTSENT_LOWAT' => 'sockets/sockets.php', + 'TCP_QUICKACK' => 'sockets/sockets.php', + 'TCP_REPAIR' => 'sockets/sockets.php', 'THOUSANDS_SEP' => 'standard/standard_defines.php', 'THOUSEP' => 'standard/standard_defines.php', 'TIDY_NODETYPE_ASP' => 'tidy/tidy.php', diff --git a/Reflection/ReflectionClass.php b/Reflection/ReflectionClass.php index 554c1fa92..71a8a25a9 100644 --- a/Reflection/ReflectionClass.php +++ b/Reflection/ReflectionClass.php @@ -525,7 +525,8 @@ public function isSubclassOf(#[LanguageLevelTypeAware(['8.0' => 'ReflectionClass */ #[Pure] #[TentativeType] - public function getStaticProperties(): ?array {} + #[LanguageLevelTypeAware(['8.3' => 'array'], default: 'array|null')] + public function getStaticProperties() {} /** * Gets static property value diff --git a/Reflection/ReflectionClassConstant.php b/Reflection/ReflectionClassConstant.php index d2f3d3c4c..a75bda616 100644 --- a/Reflection/ReflectionClassConstant.php +++ b/Reflection/ReflectionClassConstant.php @@ -220,4 +220,14 @@ public function isEnumCase(): bool {} * @since 8.1 */ public function isFinal(): bool {} + + /** + * @since 8.3 + */ + public function hasType(): bool {} + + /** + * @since 8.3 + */ + public function getType(): ?ReflectionType {} } diff --git a/Reflection/ReflectionMethod.php b/Reflection/ReflectionMethod.php index da59e0338..72da0035b 100644 --- a/Reflection/ReflectionMethod.php +++ b/Reflection/ReflectionMethod.php @@ -301,4 +301,9 @@ public function setAccessible(bool $accessible): void {} #[PhpStormStubsElementAvailable(from: '8.2')] public function hasPrototype(): bool {} + + /** + * @since 8.3 + */ + public static function createFromMethodName(string $method): static {} } diff --git a/SPL/SPL.php b/SPL/SPL.php index 4353bb7d4..73b351d50 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -1683,20 +1683,18 @@ public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '') /** * Sort the entries by value * @link https://php.net/manual/en/arrayobject.asort.php - * @param int $flags [optional] - * @return bool */ #[TentativeType] - public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} /** * Sort the entries by key * @link https://php.net/manual/en/arrayobject.ksort.php - * @param int $flags [optional] - * @return bool */ #[TentativeType] - public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} /** * Sort the entries with a user-defined comparison function and maintain key association @@ -1709,10 +1707,10 @@ public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = * be respectively less than, equal to, or greater than the * second. *

    - * @return bool */ #[TentativeType] - public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} /** * Sort the entries by keys using a user-defined comparison function @@ -1728,26 +1726,26 @@ public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: * be respectively less than, equal to, or greater than the * second. *

    - * @return bool */ #[TentativeType] - public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} /** * Sort entries using a "natural order" algorithm * @link https://php.net/manual/en/arrayobject.natsort.php - * @return bool */ #[TentativeType] - public function natsort(): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function natsort() {} /** * Sort an array using a case insensitive "natural order" algorithm * @link https://php.net/manual/en/arrayobject.natcasesort.php - * @return bool */ #[TentativeType] - public function natcasesort(): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function natcasesort() {} /** * Unserialize an ArrayObject @@ -1955,20 +1953,18 @@ public function setFlags(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '') /** * Sort array by values * @link https://php.net/manual/en/arrayiterator.asort.php - * @param int $flags [optional] - * @return bool */ #[TentativeType] - public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function asort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} /** * Sort array by keys * @link https://php.net/manual/en/arrayiterator.ksort.php - * @param int $flags [optional] - * @return bool */ #[TentativeType] - public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = SORT_REGULAR) {} /** * User defined sort @@ -1976,10 +1972,10 @@ public function ksort(#[PhpStormStubsElementAvailable(from: '8.0')] int $flags = * @param callable $callback

    * The compare function used for the sort. *

    - * @return void */ #[TentativeType] - public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} /** * User defined sort @@ -1987,26 +1983,26 @@ public function uasort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: * @param callable $callback

    * The compare function used for the sort. *

    - * @return void */ #[TentativeType] - public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function uksort(#[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback) {} /** * Sort an array naturally * @link https://php.net/manual/en/arrayiterator.natsort.php - * @return bool */ #[TentativeType] - public function natsort(): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function natsort() {} /** * Sort an array naturally, case insensitive * @link https://php.net/manual/en/arrayiterator.natcasesort.php - * @return bool */ #[TentativeType] - public function natcasesort(): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function natcasesort() {} /** * Unserialize diff --git a/curl/curl_d.php b/curl/curl_d.php index 22ed96f49..52b15e8cf 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -1120,6 +1120,17 @@ * @since 5.2.4 */ define('CURLINFO_PRIVATE', 1048597); + +/** + * @since 8.3 + */ +define('CURLINFO_CAPATH', 1048638); + +/** + * @since 8.3 + */ +define('CURLINFO_CAINFO', 1048637); + /** * Supports IPv6 * @link https://php.net/manual/en/curl.constants.php @@ -1151,6 +1162,37 @@ * @link https://curl.haxx.se/libcurl/c/libcurl-errors.html */ define('CURLE_OK', 0); + +/** + * @since 8.3 + */ +define('CURLKHMATCH_OK', 0); + +/** + * @since 8.3 + */ +define('CURLKHMATCH_MISMATCH', 1); + +/** + * @since 8.3 + */ +define('CURLKHMATCH_MISSING', 2); + +/** + * @since 8.3 + */ +define('CURLKHMATCH_LAST', 3); + +/** + * @since 8.3 + */ +define('CURLOPT_MIME_OPTIONS', 315); + +/** + * @since 8.3 + */ +define('CURLMIMEOPT_FORMESCAPE', 1); + /** * The URL you passed to libcurl used a protocol that this libcurl does not support. * The support might be a compile-time option that you didn't use, @@ -2061,6 +2103,41 @@ */ define('CURLOPT_SERVICE_NAME', 10236); +/** + * @since 8.3 + */ +define('CURLOPT_SSH_HOSTKEYFUNCTION', 20316); + +/** + * @since 8.3 + */ +define('CURLOPT_PROTOCOLS_STR', 10318); + +/** + * @since 8.3 + */ +define('CURLOPT_REDIR_PROTOCOLS_STR', 10319); + +/** + * @since 8.3 + */ +define('CURLOPT_WS_OPTIONS', 320); + +/** + * @since 8.3 + */ +define('CURLWS_RAW_MODE', 1); + +/** + * @since 8.3 + */ +define('CURLOPT_CA_CACHE_TIMEOUT', 321); + +/** + * @since 8.3 + */ +define('CURLOPT_QUICK_EXIT', 322); + /** * Value for the CURLOPT_SSH_AUTH_TYPES option. * libcurl attempts to connect to ssh-agent or pageant and let the agent attempt the authentication. diff --git a/date/date_c.php b/date/date_c.php index d6db7e837..c297e6ca0 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -1100,4 +1100,54 @@ public function __serialize(): array {} #[PhpStormStubsElementAvailable(from: '8.2')] public function __unserialize(array $data): void {} + + /** + * @since 8.3 + */ + public static function createFromISO8601String(string $specification, int $options = 0): static {} } + +/** + * @since 8.3 + */ +class DateError extends Error {} + +/** + * @since 8.3 + */ +class DateObjectError extends DateError {} + +/** + * @since 8.3 + */ +class DateRangeError extends DateError {} + +/** + * @since 8.3 + */ +class DateException extends Exception {} + +/** + * @since 8.3 + */ +class DateInvalidTimeZoneException extends DateException {} + +/** + * @since 8.3 + */ +class DateInvalidOperationException extends DateException {} + +/** + * @since 8.3 + */ +class DateMalformedStringException extends DateException {} + +/** + * @since 8.3 + */ +class DateMalformedIntervalStringException extends DateException {} + +/** + * @since 8.3 + */ +class DateMalformedPeriodStringException extends DateException {} diff --git a/dom/dom_c.php b/dom/dom_c.php index 4bf64209f..099399e40 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -142,6 +142,8 @@ class DOMNode */ #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] public $textContent; + public bool $isConnected; + public ?DOMElement $parentElement; /** * Adds a new child before a reference node @@ -318,9 +320,15 @@ public function lookupNamespaceUri($prefix) {} /** * @param DOMNode $arg * @return bool + * @removed 8.0 */ public function isEqualNode(DOMNode $arg) {} + /** + * @since 8.3 + */ + public function isEqualNode(?DOMNode $otherNode): bool {} + /** * @param $feature * @param $version @@ -391,6 +399,16 @@ public function C14NFile( #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: 'array')] $xpath = null, #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: 'array')] $nsPrefixes = null ): int|false {} + + /** + * @since 8.3 + */ + public function contains(DOMNode|DOMNameSpaceNode|null $other): bool {} + + /** + * @since 8.3 + */ + public function getRootNode(?array $options = []): DOMNode {} } /** @@ -577,6 +595,8 @@ class DOMNameSpaceNode #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] public $nodeName; + public ?DOMElement $parentElement; + public bool $isConnected; } /** @@ -616,6 +636,12 @@ public function append(...$nodes): void {} * {@inheritDoc} */ public function prepend(...$nodes): void {} + + /** + * @since 8.3 + * {@inheritDoc} + */ + public function replaceChildren(...$nodes): void {} } /** @@ -1001,9 +1027,8 @@ public function getElementsByTagNameNS( #[TentativeType] public function getElementById(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $elementId): ?DOMElement {} - /** - * @param DOMNode $node - */ + #[TentativeType] + #[LanguageLevelTypeAware(['8.3' => 'DOMNode|false'], default: '')] public function adoptNode(DOMNode $node) {} /** @@ -1016,6 +1041,12 @@ public function append(...$nodes): void {} */ public function prepend(...$nodes): void {} + /** + * @since 8.3 + * {@inheritDoc} + */ + public function replaceChildren(...$nodes): void {} + /** * Normalizes the document * @link https://php.net/manual/en/domdocument.normalizedocument.php @@ -1041,10 +1072,12 @@ public function renameNode(DOMNode $node, $namespace, $qualifiedName) {} * Bitwise OR * of the libxml option constants. *

    - * @return DOMDocument|bool true on success or false on failure. If called statically, returns a + * @return DOMDocument|bool true on success or false on failure. Prior to PHP 8.3 if called statically, returns a * DOMDocument and issues E_STRICT * warning. */ + #[TentativeType] + #[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')] public function load( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null @@ -1073,10 +1106,12 @@ public function save($filename, $options = null) {} * Bitwise OR * of the libxml option constants. *

    - * @return DOMDocument|bool true on success or false on failure. If called statically, returns a + * @return DOMDocument|bool true on success or false on failure. Prior to PHP 8.3 if called statically, returns a * DOMDocument and issues E_STRICT * warning. */ + #[TentativeType] + #[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')] public function loadXML( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $source, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null @@ -1142,10 +1177,12 @@ public function xinclude(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '') * Since PHP 5.4.0 and Libxml 2.6.0, you may also * use the options parameter to specify additional Libxml parameters. *

    - * @return DOMDocument|bool true on success or false on failure. If called statically, returns a + * @return DOMDocument|bool true on success or false on failure. Prior to PHP 8.3 if called statically, returns a * DOMDocument and issues E_STRICT * warning. */ + #[TentativeType] + #[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')] public function loadHTML( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $source, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0 @@ -1161,10 +1198,12 @@ public function loadHTML( * Since PHP 5.4.0 and Libxml 2.6.0, you may also * use the options parameter to specify additional Libxml parameters. *

    - * @return DOMDocument|bool true on success or false on failure. If called statically, returns a + * @return DOMDocument|bool true on success or false on failure. Prior to PHP 8.3 if called statically, returns a * DOMDocument and issues E_STRICT * warning. */ + #[TentativeType] + #[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')] public function loadHTMLFile( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0 @@ -1443,10 +1482,10 @@ public function substringData( * @param string $data

    * The string to append. *

    - * @return void */ #[TentativeType] - public function appendData(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function appendData(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} /** * Insert a string at the specified 16-bit unit offset @@ -1679,6 +1718,8 @@ class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode #[LanguageLevelTypeAware(['8.1' => 'DOMElement|null'], default: '')] public $nextElementSibling; + public string $id; + public string $className; /** * Returns value of attribute @@ -1976,6 +2017,12 @@ public function append(...$nodes): void {} */ public function prepend(...$nodes): void {} + /** + * @since 8.3 + * {@inheritDoc} + */ + public function replaceChildren(...$nodes): void {} + /** * Creates a new DOMElement object * @link https://php.net/manual/en/domelement.construct.php @@ -1989,6 +2036,26 @@ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $value = null, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace = null ) {} + + /** + * @since 8.3 + */ + public function getAttributeNames(): array {} + + /** + * @since 8.3 + */ + public function toggleAttribute(string $qualifiedName, ?bool $force = false): bool {} + + /** + * @since 8.3 + */ + public function insertAdjacentElement(string $where, DOMElement $element): ?DOMElement {} + + /** + * @since 8.3 + */ + public function insertAdjacentText(string $where, string $data): void {} } /** @@ -2455,6 +2522,11 @@ public function append(...$nodes): void; * @since 8.0 */ public function prepend(...$nodes): void; + + /** + * @since 8.3 + */ + public function replaceChildren(...$nodes): void; } /** diff --git a/gd/gd.php b/gd/gd.php index 3e9ee1114..a35700fdb 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -818,11 +818,16 @@ function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, * Specifies the color of the uncovered zone after the rotation *

    * @param bool $ignore_transparent [optional]

    - * If set and non-zero, transparent colors are ignored (otherwise kept). + * Prior to PHP 8.3 if set and non-zero, transparent colors are ignored (otherwise kept). *

    * @return resource|GdImage|false the rotated image or FALSE on failure */ -function imagerotate(GdImage $image, float $angle, int $background_color, bool $ignore_transparent = false): GdImage|false {} +function imagerotate( + GdImage $image, + float $angle, + int $background_color, + #[PhpStormStubsElementAvailable(to: '8.2')] bool $ignore_transparent = false +): GdImage|false {} /** * Should antialias functions be used or not.
    @@ -1116,7 +1121,7 @@ function imagegd(GdImage $image, ?string $file = null): bool {} *

    * @return bool true on success or false on failure. */ -function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = null, int $mode = null): bool {} +function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = 128, int $mode = 1): bool {} /** * Destroy an image diff --git a/hash/hash.php b/hash/hash.php index 923bd6744..1ba1003c7 100644 --- a/hash/hash.php +++ b/hash/hash.php @@ -296,7 +296,7 @@ function hash_pbkdf2( int $iterations, int $length = 0, bool $binary = false, - #[PhpStormStubsElementAvailable(from: '8.1', to: '8.1')] array $options = [] + #[PhpStormStubsElementAvailable(from: '8.1')] array $options = [] ): string {} /** diff --git a/imap/imap.php b/imap/imap.php index 7f92a91a3..9a64c233e 100644 --- a/imap/imap.php +++ b/imap/imap.php @@ -86,9 +86,10 @@ function imap_reopen( * deletion. You can achieve the same thing by using * imap_expunge *

    - * @return bool TRUE on success or FALSE on failure. + * @return bool|true TRUE on success or FALSE on failure. Since PHP 8.3 always true */ -function imap_close(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, int $flags = 0): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function imap_close(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, int $flags = 0) {} /** * Gets the number of messages in the current mailbox @@ -491,21 +492,21 @@ function imap_fetchstructure(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection * IMAP_GC_ENV (enveloppe and bodies), * IMAP_GC_TEXTS (texts). *

    - * @return bool TRUE on success or FALSE on failure. */ +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] function imap_gc( #[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] int $flags = 0, #[PhpStormStubsElementAvailable(from: '8.0')] int $flags -): bool {} +) {} /** * Delete all messages marked for deletion * @link https://php.net/manual/en/function.imap-expunge.php * @param resource $imap - * @return bool TRUE. */ -function imap_expunge(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function imap_expunge(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap) {} /** * Mark a message for deletion from current mailbox @@ -519,8 +520,8 @@ function imap_expunge(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], def * to treat the msg_number argument as an * UID. *

    - * @return bool TRUE. */ +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] function imap_delete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $message_nums, int $flags = 0): bool {} /** @@ -531,8 +532,8 @@ function imap_delete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], defa * The message number *

    * @param int $flags [optional] - * @return bool TRUE on success or FALSE on failure. */ +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] function imap_undelete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $message_nums, int $flags = 0): bool {} /** @@ -886,8 +887,8 @@ function imap_mailboxmsginfo(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection * A bit mask that may contain the single option: * ST_UID - The sequence argument contains UIDs * instead of sequence numbers

    - * @return bool TRUE on success or FALSE on failure. */ +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] function imap_setflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $sequence, string $flag, int $options = NIL): bool {} /** @@ -908,8 +909,8 @@ function imap_setflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'] * the single option: * ST_UID - The sequence argument contains UIDs * instead of sequence numbers

    - * @return bool TRUE on success or FALSE on failure. */ +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] function imap_clearflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $sequence, string $flag, int $options = 0): bool {} /** diff --git a/intl/IntlChar.php b/intl/IntlChar.php index c5775d583..25fc91199 100644 --- a/intl/IntlChar.php +++ b/intl/IntlChar.php @@ -902,12 +902,13 @@ public static function digit( * @since 7.0 */ #[TentativeType] + #[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'bool|null')] public static function enumCharNames( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $start, #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $end, #[LanguageLevelTypeAware(['8.0' => 'callable'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = IntlChar::UNICODE_CHAR_NAME - ): ?bool {} + ) {} /** * Enumerate all code points with their Unicode general categories diff --git a/intl/intl.php b/intl/intl.php index 33957ac21..7d72ddec0 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -4,7 +4,7 @@ use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\ExpectedValues as EV; -use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware as TypeAware; +use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware as LanguageAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable as ElementAvailable; use JetBrains\PhpStorm\Internal\TentativeType; use JetBrains\PhpStorm\Pure; @@ -248,7 +248,7 @@ class Collator * @param string $locale */ #[Pure] - public function __construct(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} + public function __construct(#[LanguageAware(['8.0' => 'string'], default: '')] $locale) {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -264,7 +264,7 @@ public function __construct(#[TypeAware(['8.0' => 'string'], default: '')] $loca * on error. */ #[TentativeType] - public static function create(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?Collator {} + public static function create(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): ?Collator {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -298,8 +298,8 @@ public static function create(#[TypeAware(['8.0' => 'string'], default: '')] $lo #[Pure] #[TentativeType] public function compare( - #[TypeAware(['8.0' => 'string'], default: '')] $string1, - #[TypeAware(['8.0' => 'string'], default: '')] $string2 + #[LanguageAware(['8.0' => 'string'], default: '')] $string1, + #[LanguageAware(['8.0' => 'string'], default: '')] $string2 ): int|false {} /** @@ -321,7 +321,7 @@ public function compare( #[TentativeType] public function sort( array &$array, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null ): bool {} /** @@ -352,7 +352,7 @@ public function sortWithSortKeys( #[TentativeType] public function asort( array &$array, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null ): bool {} /** @@ -366,7 +366,7 @@ public function asort( */ #[Pure] #[TentativeType] - public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute): int|false {} + public function getAttribute(#[LanguageAware(['8.0' => 'int'], default: '')] $attribute): int|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -380,8 +380,8 @@ public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attrib */ #[TentativeType] public function setAttribute( - #[TypeAware(['8.0' => 'int'], default: '')] $attribute, - #[TypeAware(['8.0' => 'int'], default: '')] $value + #[LanguageAware(['8.0' => 'int'], default: '')] $attribute, + #[LanguageAware(['8.0' => 'int'], default: '')] $value ): bool {} /** @@ -405,7 +405,7 @@ public function getStrength(): int {} *

    * @return bool TRUE on success or FALSE on failure. */ - public function setStrength(#[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::PRIMARY])] $strength) {} + public function setStrength(#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::PRIMARY])] $strength) {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -434,7 +434,7 @@ public function getErrorCode(): int|false {} #[Pure] #[TentativeType] public function getLocale( - #[TypeAware(['8.0' => 'int'], default: '')] + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type ): string|false {} @@ -461,7 +461,7 @@ public function getErrorMessage(): string|false {} #[Pure] #[TentativeType] public function getSortKey( - #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[LanguageAware(['8.0' => 'string'], default: '')] $string, #[ElementAvailable(from: '5.3', to: '5.6')] $arg2 ): string|false {} } @@ -925,13 +925,13 @@ class NumberFormatter */ #[Pure] public function __construct( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY, NumberFormatter::PERCENT, NumberFormatter::SCIENTIFIC, NumberFormatter::SPELLOUT, NumberFormatter::ORDINAL, NumberFormatter::DURATION, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY_ACCOUNTING, NumberFormatter::DEFAULT_STYLE, NumberFormatter::IGNORE])] $style, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null + #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = null ) {} /** @@ -960,13 +960,13 @@ public function __construct( */ #[TentativeType] public static function create( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY, NumberFormatter::PERCENT, NumberFormatter::SCIENTIFIC, NumberFormatter::SPELLOUT, NumberFormatter::ORDINAL, NumberFormatter::DURATION, NumberFormatter::PATTERN_RULEBASED, NumberFormatter::CURRENCY_ACCOUNTING, NumberFormatter::DEFAULT_STYLE, NumberFormatter::IGNORE])] $style, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null + #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = null ): ?NumberFormatter {} /** @@ -986,8 +986,8 @@ public static function create( #[Pure] #[TentativeType] public function format( - #[TypeAware(['8.0' => 'int|float'], default: '')] $num, - #[TypeAware(['8.0' => 'int'], default: '')] $type = null + #[LanguageAware(['8.0' => 'int|float'], default: '')] $num, + #[LanguageAware(['8.0' => 'int'], default: '')] $type = null ): string|false {} /** @@ -1008,8 +1008,8 @@ public function format( */ #[TentativeType] public function parse( - #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $type = NumberFormatter::TYPE_DOUBLE, + #[LanguageAware(['8.0' => 'string'], default: '')] $string, + #[LanguageAware(['8.0' => 'int'], default: '')] $type = NumberFormatter::TYPE_DOUBLE, &$offset = null ): int|float|false {} @@ -1028,8 +1028,8 @@ public function parse( #[Pure] #[TentativeType] public function formatCurrency( - #[TypeAware(['8.0' => 'float'], default: '')] $amount, - #[TypeAware(['8.0' => 'string'], default: '')] $currency + #[LanguageAware(['8.0' => 'float'], default: '')] $amount, + #[LanguageAware(['8.0' => 'string'], default: '')] $currency ): string|false {} /** @@ -1048,7 +1048,7 @@ public function formatCurrency( * @return float|false The parsed numeric value or FALSE on error. */ #[TentativeType] - public function parseCurrency(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$currency, &$offset = null): float|false {} + public function parseCurrency(#[LanguageAware(['8.0' => 'string'], default: '')] $string, &$currency, &$offset = null): float|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1065,8 +1065,8 @@ public function parseCurrency(#[TypeAware(['8.0' => 'string'], default: '')] $st */ #[TentativeType] public function setAttribute( - #[TypeAware(['8.0' => 'int'], default: '')] $attribute, - #[TypeAware(['8.0' => 'int|float'], default: '')] $value + #[LanguageAware(['8.0' => 'int'], default: '')] $attribute, + #[LanguageAware(['8.0' => 'int|float'], default: '')] $value ): bool {} /** @@ -1081,7 +1081,7 @@ public function setAttribute( */ #[Pure] #[TentativeType] - public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute): int|float|false {} + public function getAttribute(#[LanguageAware(['8.0' => 'int'], default: '')] $attribute): int|float|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1099,8 +1099,8 @@ public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attrib */ #[TentativeType] public function setTextAttribute( - #[TypeAware(['8.0' => 'int'], default: '')] $attribute, - #[TypeAware(['8.0' => 'string'], default: '')] $value + #[LanguageAware(['8.0' => 'int'], default: '')] $attribute, + #[LanguageAware(['8.0' => 'string'], default: '')] $value ): bool {} /** @@ -1115,7 +1115,7 @@ public function setTextAttribute( */ #[Pure] #[TentativeType] - public function getTextAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute): string|false {} + public function getTextAttribute(#[LanguageAware(['8.0' => 'int'], default: '')] $attribute): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1132,8 +1132,8 @@ public function getTextAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $at */ #[TentativeType] public function setSymbol( - #[TypeAware(['8.0' => 'int'], default: '')] $symbol, - #[TypeAware(['8.0' => 'string'], default: '')] $value + #[LanguageAware(['8.0' => 'int'], default: '')] $symbol, + #[LanguageAware(['8.0' => 'string'], default: '')] $value ): bool {} /** @@ -1148,7 +1148,7 @@ public function setSymbol( */ #[Pure] #[TentativeType] - public function getSymbol(#[TypeAware(['8.0' => 'int'], default: '')] $symbol): string|false {} + public function getSymbol(#[LanguageAware(['8.0' => 'int'], default: '')] $symbol): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1162,7 +1162,7 @@ public function getSymbol(#[TypeAware(['8.0' => 'int'], default: '')] $symbol): * @return bool TRUE on success or FALSE on failure. */ #[TentativeType] - public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern): bool {} + public function setPattern(#[LanguageAware(['8.0' => 'string'], default: '')] $pattern): bool {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1189,7 +1189,7 @@ public function getPattern(): string|false {} #[Pure] #[TentativeType] public function getLocale( - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = null ): string|false {} /** @@ -1271,9 +1271,9 @@ class Normalizer */ #[TentativeType] public static function normalize( - #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[LanguageAware(['8.0' => 'string'], default: '')] $string, #[ElementAvailable(from: '5.3', to: '5.6')] $form, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C, + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C, #[ElementAvailable(from: '5.3', to: '5.6')] $arg3 ): string|false {} @@ -1289,9 +1289,9 @@ public static function normalize( */ #[TentativeType] public static function isNormalized( - #[TypeAware(['8.0' => 'string'], default: '')] $string, + #[LanguageAware(['8.0' => 'string'], default: '')] $string, #[ElementAvailable(from: '5.3', to: '5.6')] $form, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C, + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'int'], default: '')] $form = Normalizer::FORM_C, #[ElementAvailable(from: '5.3', to: '5.6')] $arg3 ): bool {} @@ -1392,7 +1392,7 @@ public static function getDefault(): string {} *

    * @return bool TRUE on success or FALSE on failure. */ - public static function setDefault(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {} + public static function setDefault(#[LanguageAware(['8.0' => 'string'], default: '')] $locale) {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1404,7 +1404,7 @@ public static function setDefault(#[TypeAware(['8.0' => 'string'], default: '')] * @return string|null The language code associated with the language or NULL in case of error. */ #[TentativeType] - public static function getPrimaryLanguage(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + public static function getPrimaryLanguage(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): ?string {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1416,7 +1416,7 @@ public static function getPrimaryLanguage(#[TypeAware(['8.0' => 'string'], defau * @return string|null The script subtag for the locale or NULL if not present */ #[TentativeType] - public static function getScript(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + public static function getScript(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): ?string {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1428,7 +1428,7 @@ public static function getScript(#[TypeAware(['8.0' => 'string'], default: '')] * @return string|null The region subtag for the locale or NULL if not present */ #[TentativeType] - public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + public static function getRegion(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): ?string {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1440,7 +1440,7 @@ public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] * @return array|false|null Associative array containing the keyword-value pairs for this locale */ #[TentativeType] - public static function getKeywords(#[TypeAware(['8.0' => 'string'], default: '')] $locale): array|false|null {} + public static function getKeywords(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): array|false|null {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1457,9 +1457,9 @@ public static function getKeywords(#[TypeAware(['8.0' => 'string'], default: '') */ #[TentativeType] public static function getDisplayScript( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1477,9 +1477,9 @@ public static function getDisplayScript( */ #[TentativeType] public static function getDisplayRegion( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1494,9 +1494,9 @@ public static function getDisplayRegion( */ #[TentativeType] public static function getDisplayName( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1514,9 +1514,9 @@ public static function getDisplayName( */ #[TentativeType] public static function getDisplayLanguage( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1534,9 +1534,9 @@ public static function getDisplayLanguage( */ #[TentativeType] public static function getDisplayVariant( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, #[ElementAvailable(from: '5.3', to: '5.6')] $displayLocale, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $displayLocale = null + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'string|null'], default: '')] $displayLocale = null ): string|false {} /** @@ -1583,7 +1583,7 @@ public static function composeLocale(array $subtags): string|false {} * variant2=>varZ */ #[TentativeType] - public static function parseLocale(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?array {} + public static function parseLocale(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): ?array {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1596,7 +1596,7 @@ public static function parseLocale(#[TypeAware(['8.0' => 'string'], default: '') * or NULL if not present */ #[TentativeType] - public static function getAllVariants(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?array {} + public static function getAllVariants(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): ?array {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1616,10 +1616,10 @@ public static function getAllVariants(#[TypeAware(['8.0' => 'string'], default: */ #[TentativeType] public static function filterMatches( - #[TypeAware(['8.0' => 'string'], default: '')] $languageTag, - #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $languageTag, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, #[ElementAvailable(from: '5.3', to: '5.6')] $canonicalize, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'bool'], default: '')] $canonicalize = false ): ?bool {} /** @@ -1645,11 +1645,11 @@ public static function filterMatches( #[TentativeType] public static function lookup( array $languageTag, - #[TypeAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, #[ElementAvailable(from: '5.3', to: '5.6')] $canonicalize, #[ElementAvailable(from: '5.3', to: '5.6')] $defaultLocale, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'bool'], default: '')] $canonicalize = false, - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string|null'], default: '')] $defaultLocale = null + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'bool'], default: '')] $canonicalize = false, + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'string|null'], default: '')] $defaultLocale = null ): ?string {} /** @@ -1658,7 +1658,7 @@ public static function lookup( * @return string|null */ #[TentativeType] - public static function canonicalize(#[TypeAware(['8.0' => 'string'], default: '')] $locale): ?string {} + public static function canonicalize(#[LanguageAware(['8.0' => 'string'], default: '')] $locale): ?string {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1670,7 +1670,7 @@ public static function canonicalize(#[TypeAware(['8.0' => 'string'], default: '' * @return string|false The corresponding locale identifier. */ #[TentativeType] - public static function acceptFromHttp(#[TypeAware(['8.0' => 'string'], default: '')] $header): string|false {} + public static function acceptFromHttp(#[LanguageAware(['8.0' => 'string'], default: '')] $header): string|false {} } class MessageFormatter @@ -1692,8 +1692,8 @@ class MessageFormatter */ #[Pure] public function __construct( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $pattern ) {} /** @@ -1713,8 +1713,8 @@ public function __construct( */ #[TentativeType] public static function create( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $pattern ): ?MessageFormatter {} /** @@ -1750,8 +1750,8 @@ public function format(array $values): string|false {} */ #[TentativeType] public static function formatMessage( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $pattern, array $values ): string|false {} @@ -1766,7 +1766,7 @@ public static function formatMessage( */ #[Pure] #[TentativeType] - public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string): array|false {} + public function parse(#[LanguageAware(['8.0' => 'string'], default: '')] $string): array|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1785,9 +1785,9 @@ public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string): a */ #[TentativeType] public static function parseMessage( - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'string'], default: '')] $pattern, - #[TypeAware(['8.0' => 'string'], default: '')] $message + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string'], default: '')] $pattern, + #[LanguageAware(['8.0' => 'string'], default: '')] $message ): array|false {} /** @@ -1803,7 +1803,7 @@ public static function parseMessage( * @return bool TRUE on success or FALSE on failure. */ #[TentativeType] - public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern): bool {} + public function setPattern(#[LanguageAware(['8.0' => 'string'], default: '')] $pattern): bool {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -1904,14 +1904,14 @@ class IntlDateFormatter */ #[Pure] public function __construct( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[ElementAvailable(from: '5.3', to: '8.0')] #[TypeAware(['8.0' => 'int'], default: '')] $dateType, - #[ElementAvailable(from: '5.3', to: '8.0')] #[TypeAware(['8.0' => 'int'], default: '')] $timeType, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $locale, + #[ElementAvailable(from: '5.3', to: '8.0')] #[LanguageAware(['8.0' => 'int'], default: '')] $dateType, + #[ElementAvailable(from: '5.3', to: '8.0')] #[LanguageAware(['8.0' => 'int'], default: '')] $timeType, #[ElementAvailable(from: '8.1')] int $dateType = 0, #[ElementAvailable(from: '8.1')] int $timeType = 0, $timezone = null, $calendar = null, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = '' + #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = '' ) {} /** @@ -1951,14 +1951,14 @@ public function __construct( */ #[TentativeType] public static function create( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[ElementAvailable(from: '5.3', to: '8.0')] #[TypeAware(['8.0' => 'int'], default: '')] $dateType, - #[ElementAvailable(from: '5.3', to: '8.0')] #[TypeAware(['8.0' => 'int'], default: '')] $timeType, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $locale, + #[ElementAvailable(from: '5.3', to: '8.0')] #[LanguageAware(['8.0' => 'int'], default: '')] $dateType, + #[ElementAvailable(from: '5.3', to: '8.0')] #[LanguageAware(['8.0' => 'int'], default: '')] $timeType, #[ElementAvailable(from: '8.1')] int $dateType = 0, #[ElementAvailable(from: '8.1')] int $timeType = 0, $timezone = null, - #[TypeAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar = null, - #[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = '' + #[LanguageAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar = null, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = '' ): ?IntlDateFormatter {} /** @@ -2002,7 +2002,7 @@ public function getCalendar(): int|false {} * @return bool TRUE on success or FALSE on failure. */ #[TentativeType] - public function setCalendar(#[TypeAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar): bool {} + public function setCalendar(#[LanguageAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar): bool {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -2088,7 +2088,8 @@ public function setTimeZoneId($zone) {} * @return bool|null TRUE on success or FALSE on failure. */ #[TentativeType] - public function setTimeZone($timezone): ?bool {} + #[LanguageAware(['8.3' => 'bool'], default: 'bool|null')] + public function setTimeZone($timezone) {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -2102,7 +2103,7 @@ public function setTimeZone($timezone): ?bool {} * Bad formatstrings are usually the cause of the failure. */ #[TentativeType] - public function setPattern(#[TypeAware(['8.0' => 'string'], default: '')] $pattern): bool {} + public function setPattern(#[LanguageAware(['8.0' => 'string'], default: '')] $pattern): bool {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -2125,7 +2126,7 @@ public function getPattern(): string|false {} #[TentativeType] public function getLocale( #[ElementAvailable(from: '8.0')] - #[TypeAware(['8.0' => 'int'], default: '')] + #[LanguageAware(['8.0' => 'int'], default: '')] $type = null ): string|false {} @@ -2139,7 +2140,7 @@ public function getLocale( * @return void */ #[TentativeType] - public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient): void {} + public function setLenient(#[LanguageAware(['8.0' => 'bool'], default: '')] $lenient): void {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -2195,7 +2196,7 @@ public function format( * @return string|false A string with result or FALSE on failure. */ #[TentativeType] - public static function formatObject($datetime, $format = null, #[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null): string|false {} + public static function formatObject($datetime, $format = null, #[LanguageAware(['8.0' => 'string|null'], default: '')] $locale = null): string|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -2214,7 +2215,7 @@ public static function formatObject($datetime, $format = null, #[TypeAware(['8.0 * @return int|float|false timestamp parsed value */ #[TentativeType] - public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$offset = null): int|float|false {} + public function parse(#[LanguageAware(['8.0' => 'string'], default: '')] $string, &$offset = null): int|float|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -2232,7 +2233,7 @@ public function parse(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$ * @return array|false Localtime compatible array of integers : contains 24 hour clock value in tm_hour field */ #[TentativeType] - public function localtime(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$offset = null): array|false {} + public function localtime(#[LanguageAware(['8.0' => 'string'], default: '')] $string, &$offset = null): array|false {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -2265,9 +2266,9 @@ class ResourceBundle implements IteratorAggregate, Countable */ #[Pure] public function __construct( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $bundle, - #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true + #[LanguageAware(['8.0' => 'string|null'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $bundle, + #[LanguageAware(['8.0' => 'bool'], default: '')] $fallback = true ) {} /** @@ -2287,9 +2288,9 @@ public function __construct( */ #[TentativeType] public static function create( - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale, - #[TypeAware(['8.0' => 'string|null'], default: '')] $bundle, - #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true + #[LanguageAware(['8.0' => 'string|null'], default: '')] $locale, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $bundle, + #[LanguageAware(['8.0' => 'bool'], default: '')] $fallback = true ): ?ResourceBundle {} /** @@ -2306,7 +2307,7 @@ public static function create( */ #[Pure] #[TentativeType] - public function get($index, #[TypeAware(['8.0' => 'bool'], default: '')] $fallback = true): mixed {} + public function get($index, #[LanguageAware(['8.0' => 'bool'], default: '')] $fallback = true): mixed {} /** * (PHP >= 5.3.2, PECL intl >= 2.0.0)
    @@ -2329,7 +2330,7 @@ public function count(): int {} * @return array|false the list of locales supported by the bundle. */ #[TentativeType] - public static function getLocales(#[TypeAware(['8.0' => 'string'], default: '')] $bundle): array|false {} + public static function getLocales(#[LanguageAware(['8.0' => 'string'], default: '')] $bundle): array|false {} /** * (PHP >= 5.3.2, PECL intl >= 2.0.0)
    @@ -2370,8 +2371,8 @@ class Transliterator /** * Starting 8.2 $id is readonly to unlock subclassing it */ - #[TypeAware(['8.1' => 'string'], default: '')] - public $id; + #[LanguageAware(['8.1' => 'string'], default: '')] + public readonly string $id; /** * (PHP >= 5.4.0, PECL intl >= 2.0.0)
    @@ -2398,8 +2399,8 @@ final private function __construct() {} */ #[TentativeType] public static function create( - #[TypeAware(['8.0' => 'string'], default: '')] $id, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null + #[LanguageAware(['8.0' => 'string'], default: '')] $id, + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null ): ?Transliterator {} /** @@ -2420,8 +2421,8 @@ public static function create( */ #[TentativeType] public static function createFromRules( - #[TypeAware(['8.0' => 'string'], default: '')] $rules, - #[TypeAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null + #[LanguageAware(['8.0' => 'string'], default: '')] $rules, + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null ): ?Transliterator {} /** @@ -2467,9 +2468,9 @@ public static function listIDs(): array|false {} #[Pure] #[TentativeType] public function transliterate( - #[TypeAware(['8.0' => 'string'], default: '')] $string, - #[TypeAware(['8.0' => 'int'], default: '')] $start = null, - #[TypeAware(['8.0' => 'int'], default: '')] $end = -1 + #[LanguageAware(['8.0' => 'string'], default: '')] $string, + #[LanguageAware(['8.0' => 'int'], default: '')] $start = null, + #[LanguageAware(['8.0' => 'int'], default: '')] $end = -1 ): string|false {} /** @@ -2513,6 +2514,8 @@ class Spoofchecker public const MINIMALLY_RESTRICTIVE = 1342177280; public const UNRESTRICTIVE = 1610612736; public const SINGLE_SCRIPT_RESTRICTIVE = 536870912; + public const MIXED_NUMBERS = 1; + public const HIDDEN_OVERLAY = 2; /** * (PHP >= 5.4.0, PECL intl >= 2.0.0)
    @@ -2533,7 +2536,7 @@ public function __construct() {} * @return bool */ #[TentativeType] - public function isSuspicious(#[TypeAware(['8.0' => 'string'], default: '')] $string, &$errorCode = null): bool {} + public function isSuspicious(#[LanguageAware(['8.0' => 'string'], default: '')] $string, &$errorCode = null): bool {} /** * (PHP >= 5.4.0, PECL intl >= 2.0.0)
    @@ -2549,8 +2552,8 @@ public function isSuspicious(#[TypeAware(['8.0' => 'string'], default: '')] $str */ #[TentativeType] public function areConfusable( - #[TypeAware(['8.0' => 'string'], default: '')] $string1, - #[TypeAware(['8.0' => 'string'], default: '')] $string2, + #[LanguageAware(['8.0' => 'string'], default: '')] $string1, + #[LanguageAware(['8.0' => 'string'], default: '')] $string2, &$errorCode = null ): bool {} @@ -2563,7 +2566,7 @@ public function areConfusable( * @return void */ #[TentativeType] - public function setAllowedLocales(#[TypeAware(['8.0' => 'string'], default: '')] $locales): void {} + public function setAllowedLocales(#[LanguageAware(['8.0' => 'string'], default: '')] $locales): void {} /** * (PHP >= 5.4.0, PECL intl >= 2.0.0)
    @@ -2574,7 +2577,7 @@ public function setAllowedLocales(#[TypeAware(['8.0' => 'string'], default: '')] * @return void */ #[TentativeType] - public function setChecks(#[TypeAware(['8.0' => 'int'], default: '')] $checks): void {} + public function setChecks(#[LanguageAware(['8.0' => 'int'], default: '')] $checks): void {} #[TentativeType] public function setRestrictionLevel(int $level): void {} @@ -2608,7 +2611,7 @@ public static function createInstance($timeZone = null, $locale = null) {} * @param float $timestamp */ #[TentativeType] - public function setGregorianChange(#[TypeAware(['8.0' => 'float'], default: '')] $timestamp): bool {} + public function setGregorianChange(#[LanguageAware(['8.0' => 'float'], default: '')] $timestamp): bool {} /** * @return float @@ -2623,7 +2626,17 @@ public function getGregorianChange(): float {} */ #[Pure] #[TentativeType] - public function isLeapYear(#[TypeAware(['8.0' => 'int'], default: '')] $year): bool {} + public function isLeapYear(#[LanguageAware(['8.0' => 'int'], default: '')] $year): bool {} + + /** + * @since 8.3 + */ + public static function createFromDate(int $year, int $month, int $dayOfMonth): static {} + + /** + * @since 8.3 + */ + public static function createFromDateTime(int $year, int $month, int $dayOfMonth, int $hour, int $minute, ?int $second = null): static {} } /** @@ -2689,8 +2702,8 @@ class IntlCalendar */ #[TentativeType] public function add( - #[TypeAware(['8.0' => 'int'], default: '')] $field, - #[TypeAware(['8.0' => 'int'], default: '')] $value + #[LanguageAware(['8.0' => 'int'], default: '')] $field, + #[LanguageAware(['8.0' => 'int'], default: '')] $value ): bool {} /** @@ -2734,7 +2747,7 @@ public function before(IntlCalendar $other): bool {} *

    * @return bool Returns TRUE on success or FALSE on failure. Failure can only occur is invalid arguments are provided. */ - public function clear(#[TypeAware(['8.0' => 'int|null'], default: '')] $field = null) {} + public function clear(#[LanguageAware(['8.0' => 'int|null'], default: '')] $field = null) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -2789,7 +2802,7 @@ private function __construct() {} * failure. */ #[TentativeType] - public static function createInstance($timezone = null, #[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null): ?IntlCalendar {} + public static function createInstance($timezone = null, #[LanguageAware(['8.0' => 'string|null'], default: '')] $locale = null): ?IntlCalendar {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -2806,7 +2819,7 @@ public static function createInstance($timezone = null, #[TypeAware(['8.0' => 's */ #[Pure] #[TentativeType] - public function equals(#[TypeAware(['8.0' => 'IntlCalendar'], default: '')] $other): bool {} + public function equals(#[LanguageAware(['8.0' => 'IntlCalendar'], default: '')] $other): bool {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -2833,8 +2846,8 @@ public function equals(#[TypeAware(['8.0' => 'IntlCalendar'], default: '')] $oth #[Pure] #[TentativeType] public function fieldDifference( - #[TypeAware(['8.0' => 'float'], default: '')] $timestamp, - #[TypeAware(['8.0' => 'int'], default: '')] $field + #[LanguageAware(['8.0' => 'float'], default: '')] $timestamp, + #[LanguageAware(['8.0' => 'int'], default: '')] $field ): int|false {} /** @@ -2853,8 +2866,8 @@ public function fieldDifference( */ #[TentativeType] public static function fromDateTime( - #[TypeAware(['8.0' => 'DateTime|string'], default: '')] $datetime, - #[TypeAware(['8.0' => 'string|null'], default: '')] #[ElementAvailable(from: '8.0')] $locale + #[LanguageAware(['8.0' => 'DateTime|string'], default: '')] $datetime, + #[LanguageAware(['8.0' => 'string|null'], default: '')] #[ElementAvailable(from: '8.0')] $locale ): ?IntlCalendar {} /** @@ -2870,7 +2883,7 @@ public static function fromDateTime( */ #[Pure] #[TentativeType] - public function get(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + public function get(#[LanguageAware(['8.0' => 'int'], default: '')] $field): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -2887,7 +2900,7 @@ public function get(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|fal */ #[Pure] #[TentativeType] - public function getActualMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + public function getActualMaximum(#[LanguageAware(['8.0' => 'int'], default: '')] $field): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -2904,7 +2917,7 @@ public function getActualMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $fi */ #[Pure] #[TentativeType] - public function getActualMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + public function getActualMinimum(#[LanguageAware(['8.0' => 'int'], default: '')] $field): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -2932,7 +2945,7 @@ public static function getAvailableLocales(): array {} */ #[Pure] #[TentativeType] - public function getDayOfWeekType(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek): int|false {} + public function getDayOfWeekType(#[LanguageAware(['8.0' => 'int'], default: '')] $dayOfWeek): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -2981,7 +2994,7 @@ public function getFirstDayOfWeek(): int|false {} */ #[Pure] #[TentativeType] - public function getGreatestMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + public function getGreatestMinimum(#[LanguageAware(['8.0' => 'int'], default: '')] $field): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3001,9 +3014,9 @@ public function getGreatestMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $ */ #[TentativeType] public static function getKeywordValuesForLocale( - #[TypeAware(['8.0' => 'string'], default: '')] $keyword, - #[TypeAware(['8.0' => 'string'], default: '')] $locale, - #[TypeAware(['8.0' => 'bool'], default: '')] $onlyCommon + #[LanguageAware(['8.0' => 'string'], default: '')] $keyword, + #[LanguageAware(['8.0' => 'string'], default: '')] $locale, + #[LanguageAware(['8.0' => 'bool'], default: '')] $onlyCommon ): IntlIterator|false {} /** @@ -3021,7 +3034,7 @@ public static function getKeywordValuesForLocale( */ #[Pure] #[TentativeType] - public function getLeastMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + public function getLeastMaximum(#[LanguageAware(['8.0' => 'int'], default: '')] $field): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3039,7 +3052,7 @@ public function getLeastMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $fie */ #[Pure] #[TentativeType] - public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type): string|false {} + public function getLocale(#[LanguageAware(['8.0' => 'int'], default: '')] $type): string|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3054,7 +3067,7 @@ public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type): st */ #[Pure] #[TentativeType] - public function getMaximum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + public function getMaximum(#[LanguageAware(['8.0' => 'int'], default: '')] $field): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3081,7 +3094,7 @@ public function getMinimalDaysInFirstWeek(): int|false {} */ #[Pure] #[TentativeType] - public function getMinimum(#[TypeAware(['8.0' => 'int'], default: '')] $field): int|false {} + public function getMinimum(#[LanguageAware(['8.0' => 'int'], default: '')] $field): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3166,7 +3179,7 @@ public function getType(): string {} */ #[Pure] #[TentativeType] - public function getWeekendTransition(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek): int|false {} + public function getWeekendTransition(#[LanguageAware(['8.0' => 'int'], default: '')] $dayOfWeek): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3225,7 +3238,7 @@ public function isLenient(): bool {} */ #[Pure] #[TentativeType] - public function isWeekend(#[TypeAware(['8.0' => 'float|null'], default: '')] $timestamp = null): bool {} + public function isWeekend(#[LanguageAware(['8.0' => 'float|null'], default: '')] $timestamp = null): bool {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3245,7 +3258,7 @@ public function isWeekend(#[TypeAware(['8.0' => 'float|null'], default: '')] $ti * @return bool Returns TRUE on success or FALSE on failure. */ #[TentativeType] - public function roll(#[TypeAware(['8.0' => 'int'], default: '')] $field, $value): bool {} + public function roll(#[LanguageAware(['8.0' => 'int'], default: '')] $field, $value): bool {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3260,7 +3273,7 @@ public function roll(#[TypeAware(['8.0' => 'int'], default: '')] $field, $value) * @return bool Assuming there are no argument errors, returns TRUE iif the field is set. */ #[TentativeType] - public function PS_UNRESERVE_PREFIX_isSet(#[TypeAware(['8.0' => 'int'], default: '')] $field): bool {} + public function PS_UNRESERVE_PREFIX_isSet(#[LanguageAware(['8.0' => 'int'], default: '')] $field): bool {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3317,7 +3330,7 @@ public function set($field, $value) {} *

    * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. */ - public function setFirstDayOfWeek(#[TypeAware(['8.0' => 'int'], default: '')] $dayOfWeek) {} + public function setFirstDayOfWeek(#[LanguageAware(['8.0' => 'int'], default: '')] $dayOfWeek) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3328,7 +3341,7 @@ public function setFirstDayOfWeek(#[TypeAware(['8.0' => 'int'], default: '')] $d *

    * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. */ - public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient) {} + public function setLenient(#[LanguageAware(['8.0' => 'bool'], default: '')] $lenient) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3341,7 +3354,7 @@ public function setLenient(#[TypeAware(['8.0' => 'bool'], default: '')] $lenient * @return bool * Returns TRUE on success. Failure can only happen due to invalid parameters. */ - public function setRepeatedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: '')] $option) {} + public function setRepeatedWallTimeOption(#[LanguageAware(['8.0' => 'int'], default: '')] $option) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3357,7 +3370,7 @@ public function setRepeatedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: * Returns TRUE on success. Failure can only happen due to invalid parameters. *

    */ - public function setSkippedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: '')] $option) {} + public function setSkippedWallTimeOption(#[LanguageAware(['8.0' => 'int'], default: '')] $option) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3371,7 +3384,7 @@ public function setSkippedWallTimeOption(#[TypeAware(['8.0' => 'int'], default: * Returns TRUE on success and FALSE on failure. */ #[TentativeType] - public function setTime(#[TypeAware(['8.0' => 'float'], default: '')] $timestamp): bool {} + public function setTime(#[LanguageAware(['8.0' => 'float'], default: '')] $timestamp): bool {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3434,7 +3447,17 @@ public function toDateTime(): DateTime|false {} * @param int $days * @return bool */ - public function setMinimalDaysInFirstWeek(#[TypeAware(['8.0' => 'int'], default: '')] $days) {} + public function setMinimalDaysInFirstWeek(#[LanguageAware(['8.0' => 'int'], default: '')] $days) {} + + /** + * @since 8.3 + */ + public function setDate(int $year, int $month, int $dayOfMonth): void {} + + /** + * @since 8.3 + */ + public function setDateTime(int $year, int $month, int $dayOfMonth, int $hour, int $minute, ?int $second = null): void {} } /** @@ -3493,7 +3516,7 @@ private function __construct() {} * @return int|false number of IDs or FALSE on failure */ #[TentativeType] - public static function countEquivalentIDs(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId): int|false {} + public static function countEquivalentIDs(#[LanguageAware(['8.0' => 'string'], default: '')] $timezoneId): int|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3522,7 +3545,7 @@ public static function createEnumeration($countryOrRawOffset): IntlIterator|fals * @return IntlTimeZone|null a timezone object or NULL on failure */ #[TentativeType] - public static function createTimeZone(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId): ?IntlTimeZone {} + public static function createTimeZone(#[LanguageAware(['8.0' => 'string'], default: '')] $timezoneId): ?IntlTimeZone {} /** * (PHP 5 >=5.5.0)
    @@ -3535,9 +3558,9 @@ public static function createTimeZone(#[TypeAware(['8.0' => 'string'], default: */ #[TentativeType] public static function createTimeZoneIDEnumeration( - #[TypeAware(['8.0' => 'int'], default: '')] $type, - #[TypeAware(['8.0' => 'string|null'], default: '')] $region = null, - #[TypeAware(['8.0' => 'int|null'], default: '')] $rawOffset = 0 + #[LanguageAware(['8.0' => 'int'], default: '')] $type, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $region = null, + #[LanguageAware(['8.0' => 'int|null'], default: '')] $rawOffset = 0 ): IntlIterator|false {} /** @@ -3548,7 +3571,7 @@ public static function createTimeZoneIDEnumeration( * @return IntlTimeZone|null a timezone object or NULL on failure */ #[TentativeType] - public static function fromDateTimeZone(#[TypeAware(['8.0' => 'DateTimeZone'], default: '')] $timezone): ?IntlTimeZone {} + public static function fromDateTimeZone(#[LanguageAware(['8.0' => 'DateTimeZone'], default: '')] $timezone): ?IntlTimeZone {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3559,7 +3582,7 @@ public static function fromDateTimeZone(#[TypeAware(['8.0' => 'DateTimeZone'], d * @return string|false the timezone ID or FALSE on failure */ #[TentativeType] - public static function getCanonicalID(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId, &$isSystemId): string|false {} + public static function getCanonicalID(#[LanguageAware(['8.0' => 'string'], default: '')] $timezoneId, &$isSystemId): string|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3572,9 +3595,9 @@ public static function getCanonicalID(#[TypeAware(['8.0' => 'string'], default: #[Pure] #[TentativeType] public function getDisplayName( - #[TypeAware(['8.0' => 'bool'], default: '')] $dst = false, - #[TypeAware(['8.0' => 'int'], default: '')] $style = 2, - #[TypeAware(['8.0' => 'string|null'], default: '')] $locale + #[LanguageAware(['8.0' => 'bool'], default: '')] $dst = false, + #[LanguageAware(['8.0' => 'int'], default: '')] $style = 2, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $locale ): string|false {} /** @@ -3597,8 +3620,8 @@ public function getDSTSavings(): int {} */ #[TentativeType] public static function getEquivalentID( - #[TypeAware(['8.0' => 'string'], default: '')] $timezoneId, - #[TypeAware(['8.0' => 'int'], default: '')] $offset + #[LanguageAware(['8.0' => 'string'], default: '')] $timezoneId, + #[LanguageAware(['8.0' => 'int'], default: '')] $offset ): string|false {} /** @@ -3661,8 +3684,8 @@ public function getID(): string|false {} */ #[TentativeType] public function getOffset( - #[TypeAware(['8.0' => 'float'], default: '')] $timestamp, - #[TypeAware(['8.0' => 'bool'], default: '')] $local, + #[LanguageAware(['8.0' => 'float'], default: '')] $timestamp, + #[LanguageAware(['8.0' => 'bool'], default: '')] $local, &$rawOffset, &$dstOffset ): bool {} @@ -3685,7 +3708,7 @@ public function getRawOffset(): int {} * @return string|false region or FALSE on failure */ #[TentativeType] - public static function getRegion(#[TypeAware(['8.0' => 'string'], default: '')] $timezoneId): string|false {} + public static function getRegion(#[LanguageAware(['8.0' => 'string'], default: '')] $timezoneId): string|false {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -3985,7 +4008,7 @@ function collator_get_sort_key( * @return NumberFormatter|null NumberFormatter object or NULL on error. */ #[Pure] -function numfmt_create(string $locale, int $style, #[TypeAware(['8.0' => 'string|null'], default: 'string')] $pattern = null): ?NumberFormatter {} +function numfmt_create(string $locale, int $style, #[LanguageAware(['8.0' => 'string|null'], default: 'string')] $pattern = null): ?NumberFormatter {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -4707,7 +4730,7 @@ function datefmt_create( #[ElementAvailable(from: '8.1')] int $timeType = 0, $timezone = null, IntlCalendar|int|null $calendar = null, - #[TypeAware(['8.0' => 'string|null'], default: 'string')] $pattern = null + #[LanguageAware(['8.0' => 'string|null'], default: 'string')] $pattern = null ): ?IntlDateFormatter {} /** @@ -4852,7 +4875,8 @@ function datefmt_set_timezone_id(MessageFormatter $mf, $zone) {} *

    * @return bool|null TRUE on success or FALSE on failure. */ -function datefmt_set_timezone(IntlDateFormatter $formatter, $timezone): ?bool {} +#[LanguageAware(['8.3' => 'bool'], default: 'bool|null')] +function datefmt_set_timezone(IntlDateFormatter $formatter, $timezone) {} /** * (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
    @@ -4918,8 +4942,8 @@ function datefmt_set_lenient( */ #[Pure] function datefmt_format( - #[TypeAware(['8.0' => 'IntlDateFormatter'], default: '')] #[ElementAvailable(from: '5.3', to: '7.4')] $formatter = null, - #[TypeAware(['8.0' => 'IntlDateFormatter'], default: '')] #[ElementAvailable(from: '8.0')] $formatter, + #[LanguageAware(['8.0' => 'IntlDateFormatter'], default: '')] #[ElementAvailable(from: '5.3', to: '7.4')] $formatter = null, + #[LanguageAware(['8.0' => 'IntlDateFormatter'], default: '')] #[ElementAvailable(from: '8.0')] $formatter, #[ElementAvailable(from: '5.3', to: '7.4')] $datetime = null, #[ElementAvailable(from: '8.0')] $datetime ): string|false {} @@ -5381,7 +5405,7 @@ function intl_get($calendar, $field) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'float|false'], default: 'float')] +#[LanguageAware(['8.0' => 'float|false'], default: 'float')] function intlcal_get_time(IntlCalendar $calendar) {} /** @@ -5538,7 +5562,8 @@ function intlcal_before(IntlCalendar $calendar, IntlCalendar $other): bool {} * @return bool Returns TRUE on success and FALSE on failure. * @since 5.5 */ -function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = null, int $hour = null, int $minute = null, int $second = null): bool {} +#[LanguageAware(['8.3' => 'true'], default: 'bool')] +function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = null, int $hour = null, int $minute = null, int $second = null) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -5583,6 +5608,7 @@ function intlcal_roll( * @return bool Returns TRUE on success or FALSE on failure. Failure can only occur is invalid arguments are provided. * @since 5.5 */ +#[LanguageAware(['8.3' => 'true'], default: 'bool')] function intlcal_clear(IntlCalendar $calendar, ?int $field = null): bool {} /** @@ -5612,7 +5638,7 @@ function intlcal_clear(IntlCalendar $calendar, ?int $field = null): bool {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_field_difference(IntlCalendar $calendar, float $timestamp, int $field) {} /** @@ -5633,7 +5659,7 @@ function intlcal_field_difference(IntlCalendar $calendar, float $timestamp, int * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_actual_maximum(IntlCalendar $calendar, int $field) {} /** @@ -5654,7 +5680,7 @@ function intlcal_get_actual_maximum(IntlCalendar $calendar, int $field) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_actual_minimum(IntlCalendar $calendar, int $field) {} /** @@ -5678,7 +5704,7 @@ function intlcal_get_actual_minimum(IntlCalendar $calendar, int $field) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_day_of_week_type(IntlCalendar $calendar, int $dayOfWeek) {} /** @@ -5695,7 +5721,7 @@ function intlcal_get_day_of_week_type(IntlCalendar $calendar, int $dayOfWeek) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_first_day_of_week(IntlCalendar $calendar) {} /** @@ -5730,7 +5756,7 @@ function intlcal_greates_minimum($calendar, $field) {} * @return int An integer with the value of the time field. */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get(IntlCalendar $calendar, int $field) {} /** @@ -5752,7 +5778,7 @@ function intlcal_get(IntlCalendar $calendar, int $field) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_least_maximum(IntlCalendar $calendar, int $field) {} /** @@ -5772,7 +5798,7 @@ function intlcal_get_least_maximum(IntlCalendar $calendar, int $field) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_greatest_minimum(IntlCalendar $calendar, int $field) {} /** @@ -5795,7 +5821,7 @@ function intlcal_get_greatest_minimum(IntlCalendar $calendar, int $field) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'string|false'], default: 'string')] +#[LanguageAware(['8.0' => 'string|false'], default: 'string')] function intlcal_get_locale(IntlCalendar $calendar, int $type) {} /** @@ -5828,7 +5854,7 @@ function intcal_get_maximum($calendar, $field) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_minimal_days_in_first_week(IntlCalendar $calendar) {} /** @@ -5848,7 +5874,7 @@ function intlcal_get_minimal_days_in_first_week(IntlCalendar $calendar) {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_minimum(IntlCalendar $calendar, int $field) {} /** @@ -5899,7 +5925,7 @@ function intlcal_get_type(IntlCalendar $calendar): string {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_weekend_transition(IntlCalendar $calendar, int $dayOfWeek) {} /** @@ -5967,7 +5993,7 @@ function intlcal_is_set(IntlCalendar $calendar, int $field): bool {} * @since 5.5 */ #[Pure] -#[TypeAware(['8.0' => 'int|false'], default: 'int')] +#[LanguageAware(['8.0' => 'int|false'], default: 'int')] function intlcal_get_maximum(IntlCalendar $calendar, int $field) {} /** @@ -6025,7 +6051,8 @@ function intlcal_is_weekend(IntlCalendar $calendar, ?float $timestamp = null): b * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. * @since 5.5 */ -function intlcal_set_first_day_of_week(IntlCalendar $calendar, int $dayOfWeek): bool {} +#[LanguageAware(['8.3' => 'true'], default: 'bool')] +function intlcal_set_first_day_of_week(IntlCalendar $calendar, int $dayOfWeek) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -6040,7 +6067,8 @@ function intlcal_set_first_day_of_week(IntlCalendar $calendar, int $dayOfWeek): * @return bool Returns TRUE on success. Failure can only happen due to invalid parameters. * @since 5.5 */ -function intlcal_set_lenient(IntlCalendar $calendar, bool $lenient): bool {} +#[LanguageAware(['8.3' => 'true'], default: 'bool')] +function intlcal_set_lenient(IntlCalendar $calendar, bool $lenient) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -6108,7 +6136,8 @@ function intlcal_get_skipped_wall_time_option(IntlCalendar $calendar): int {} * Returns TRUE on success. Failure can only happen due to invalid parameters. * @since 5.5 */ -function intlcal_set_repeated_wall_time_option(IntlCalendar $calendar, int $option): bool {} +#[LanguageAware(['8.3' => 'true'], default: 'bool')] +function intlcal_set_repeated_wall_time_option(IntlCalendar $calendar, int $option) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -6128,7 +6157,8 @@ function intlcal_set_repeated_wall_time_option(IntlCalendar $calendar, int $opti *

    * @since 5.5 */ -function intlcal_set_skipped_wall_time_option(IntlCalendar $calendar, int $option): bool {} +#[LanguageAware(['8.3' => 'true'], default: 'bool')] +function intlcal_set_skipped_wall_time_option(IntlCalendar $calendar, int $option) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a2)
    @@ -6750,7 +6780,8 @@ function intltz_get_region(string $timezoneId): string|false {} * * @since 5.5.1 */ -function intlcal_set_minimal_days_in_first_week(IntlCalendar $calendar, int $days): bool {} +#[LanguageAware(['8.3' => 'true'], default: 'bool')] +function intlcal_set_minimal_days_in_first_week(IntlCalendar $calendar, int $days) {} function intltz_get_windows_id(string $timezoneId): string|false {} @@ -7084,7 +7115,7 @@ private function __construct() {} * @return IntlBreakIterator|null */ #[TentativeType] - public static function createCharacterInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale = null): ?IntlBreakIterator {} + public static function createCharacterInstance(#[LanguageAware(['8.0' => 'string|null'], default: '')] $locale = null): ?IntlBreakIterator {} /** * (PHP 5 >=5.5.0)
    @@ -7103,7 +7134,7 @@ public static function createCodePointInstance(): IntlCodePointBreakIterator {} * @return IntlBreakIterator|null */ #[TentativeType] - public static function createLineInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + public static function createLineInstance(#[LanguageAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} /** * (PHP 5 >=5.5.0)
    @@ -7113,7 +7144,7 @@ public static function createLineInstance(#[TypeAware(['8.0' => 'string|null'], * @return IntlBreakIterator|null */ #[TentativeType] - public static function createSentenceInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + public static function createSentenceInstance(#[LanguageAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} /** * (PHP 5 >=5.5.0)
    @@ -7123,7 +7154,7 @@ public static function createSentenceInstance(#[TypeAware(['8.0' => 'string|null * @return IntlBreakIterator|null */ #[TentativeType] - public static function createTitleInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + public static function createTitleInstance(#[LanguageAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} /** * (PHP 5 >=5.5.0)
    @@ -7133,7 +7164,7 @@ public static function createTitleInstance(#[TypeAware(['8.0' => 'string|null'], * @return IntlBreakIterator|null */ #[TentativeType] - public static function createWordInstance(#[TypeAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} + public static function createWordInstance(#[LanguageAware(['8.0' => 'string|null'], default: '')] $locale): ?IntlBreakIterator {} /** * (PHP 5 >=5.5.0)
    @@ -7160,7 +7191,7 @@ public function first(): int {} * @param int $offset */ #[TentativeType] - public function following(#[TypeAware(['8.0' => 'int'], default: '')] $offset): int {} + public function following(#[LanguageAware(['8.0' => 'int'], default: '')] $offset): int {} /** * (PHP 5 >=5.5.0)
    @@ -7190,7 +7221,7 @@ public function getErrorMessage(): string {} */ #[Pure] #[TentativeType] - public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type): string|false {} + public function getLocale(#[LanguageAware(['8.0' => 'int'], default: '')] $type): string|false {} /** * (PHP 5 >=5.5.0)
    @@ -7217,7 +7248,7 @@ public function getLocale(#[TypeAware(['8.0' => 'int'], default: '')] $type): st #[Pure] #[TentativeType] public function getPartsIterator( - #[TypeAware(['8.0' => 'int'], default: '')] + #[LanguageAware(['8.3' => 'string', '8.0' => 'int'], default: '')] #[EV([IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, IntlPartsIterator::KEY_RIGHT])] $type = IntlPartsIterator::KEY_SEQUENTIAL ): IntlPartsIterator {} @@ -7239,7 +7270,7 @@ public function getText(): ?string {} */ #[Pure] #[TentativeType] - public function isBoundary(#[TypeAware(['8.0' => 'int'], default: '')] $offset): bool {} + public function isBoundary(#[LanguageAware(['8.0' => 'int'], default: '')] $offset): bool {} /** * (PHP 5 >=5.5.0)
    @@ -7257,7 +7288,7 @@ public function last(): int {} * @return int */ #[TentativeType] - public function next(#[TypeAware(['8.0' => 'int|null'], default: '')] $offset = null): int {} + public function next(#[LanguageAware(['8.0' => 'int|null'], default: '')] $offset = null): int {} /** * (PHP 5 >=5.5.0)
    @@ -7265,7 +7296,7 @@ public function next(#[TypeAware(['8.0' => 'int|null'], default: '')] $offset = * @param int $offset */ #[TentativeType] - public function preceding(#[TypeAware(['8.0' => 'int'], default: '')] $offset): int {} + public function preceding(#[LanguageAware(['8.0' => 'int'], default: '')] $offset): int {} /** * (PHP 5 >=5.5.0)
    @@ -7283,7 +7314,8 @@ public function previous(): int {} * @param string $text */ #[TentativeType] - public function setText(#[TypeAware(['8.0' => 'string'], default: '')] $text): ?bool {} + #[LanguageAware(['8.3' => 'bool'], default: 'bool|null')] + public function setText(#[LanguageAware(['8.0' => 'string'], default: '')] $text) {} /** * @since 8.0 @@ -7304,8 +7336,8 @@ class IntlRuleBasedBreakIterator extends IntlBreakIterator implements Traversabl */ #[Pure] public function __construct( - #[TypeAware(['8.0' => 'string'], default: '')] $rules, - #[TypeAware(['8.0' => 'bool'], default: '')] $compiled = false + #[LanguageAware(['8.0' => 'string'], default: '')] $rules, + #[LanguageAware(['8.0' => 'bool'], default: '')] $compiled = false ) {} /** @@ -7494,8 +7526,8 @@ class UConverter */ #[Pure] public function __construct( - #[TypeAware(['8.0' => 'string|null'], default: '')] $destination_encoding = null, - #[TypeAware(['8.0' => 'string|null'], default: '')] $source_encoding = null + #[LanguageAware(['8.0' => 'string|null'], default: '')] $destination_encoding = null, + #[LanguageAware(['8.0' => 'string|null'], default: '')] $source_encoding = null ) {} /** @@ -7509,8 +7541,8 @@ public function __construct( #[Pure] #[TentativeType] public function convert( - #[TypeAware(['8.0' => 'string'], default: '')] $str, - #[TypeAware(['8.0' => 'bool'], default: '')] $reverse = false + #[LanguageAware(['8.0' => 'string'], default: '')] $str, + #[LanguageAware(['8.0' => 'bool'], default: '')] $reverse = false ): string|false {} /** @@ -7525,9 +7557,9 @@ public function convert( */ #[TentativeType] public function fromUCallback( - #[TypeAware(['8.0' => 'int'], default: '')] $reason, - #[TypeAware(['8.0' => 'array'], default: '')] $source, - #[TypeAware(['8.0' => 'int'], default: '')] $codePoint, + #[LanguageAware(['8.0' => 'int'], default: '')] $reason, + #[LanguageAware(['8.0' => 'array'], default: '')] $source, + #[LanguageAware(['8.0' => 'int'], default: '')] $codePoint, &$error ): array|string|int|null {} @@ -7541,7 +7573,7 @@ public function fromUCallback( #[TentativeType] public static function getAliases( #[ElementAvailable(from: '5.5', to: '5.6')] $name = '', - #[ElementAvailable(from: '7.0')] #[TypeAware(['8.0' => 'string'], default: '')] $name + #[ElementAvailable(from: '7.0')] #[LanguageAware(['8.0' => 'string'], default: '')] $name ): array|false|null {} /** @@ -7655,7 +7687,7 @@ public static function reasonText( * @return bool */ #[TentativeType] - public function setDestinationEncoding(#[TypeAware(['8.0' => 'string'], default: '')] $encoding): bool {} + public function setDestinationEncoding(#[LanguageAware(['8.0' => 'string'], default: '')] $encoding): bool {} /** * (PHP 5 >=5.5.0)
    @@ -7665,7 +7697,7 @@ public function setDestinationEncoding(#[TypeAware(['8.0' => 'string'], default: * @return bool */ #[TentativeType] - public function setSourceEncoding(#[TypeAware(['8.0' => 'string'], default: '')] $encoding): bool {} + public function setSourceEncoding(#[LanguageAware(['8.0' => 'string'], default: '')] $encoding): bool {} /** * (PHP 5 >=5.5.0)
    @@ -7675,7 +7707,7 @@ public function setSourceEncoding(#[TypeAware(['8.0' => 'string'], default: '')] * @return bool */ #[TentativeType] - public function setSubstChars(#[TypeAware(['8.0' => 'string'], default: '')] $chars): bool {} + public function setSubstChars(#[LanguageAware(['8.0' => 'string'], default: '')] $chars): bool {} /** * (PHP 5 >=5.5.0)
    @@ -7689,9 +7721,9 @@ public function setSubstChars(#[TypeAware(['8.0' => 'string'], default: '')] $ch */ #[TentativeType] public function toUCallback( - #[TypeAware(['8.0' => 'int'], default: '')] $reason, - #[TypeAware(['8.0' => 'string'], default: '')] $source, - #[TypeAware(['8.0' => 'string'], default: '')] $codeUnits, + #[LanguageAware(['8.0' => 'int'], default: '')] $reason, + #[LanguageAware(['8.0' => 'string'], default: '')] $source, + #[LanguageAware(['8.0' => 'string'], default: '')] $codeUnits, &$error ): array|string|int|null {} @@ -7707,9 +7739,9 @@ public function toUCallback( */ #[TentativeType] public static function transcode( - #[TypeAware(['8.0' => 'string'], default: '')] $str, - #[TypeAware(['8.0' => 'string'], default: '')] $toEncoding, - #[TypeAware(['8.0' => 'string'], default: '')] $fromEncoding, + #[LanguageAware(['8.0' => 'string'], default: '')] $str, + #[LanguageAware(['8.0' => 'string'], default: '')] $toEncoding, + #[LanguageAware(['8.0' => 'string'], default: '')] $fromEncoding, ?array $options = [] ): string|false {} } diff --git a/json/json.php b/json/json.php index 5019eb5f1..a5eecacc6 100644 --- a/json/json.php +++ b/json/json.php @@ -235,6 +235,11 @@ function json_last_error(): int {} #[Pure] function json_last_error_msg(): string {} +/** + * @since 8.3 + */ +function json_validate(string $json, int $depth = 512, int $flags = 0): bool {} + /** * All < and > are converted to \u003C and \u003E. * @link https://php.net/manual/en/json.constants.php diff --git a/ldap/ldap.php b/ldap/ldap.php index 2fbe26406..2d7eb4810 100644 --- a/ldap/ldap.php +++ b/ldap/ldap.php @@ -1422,6 +1422,11 @@ function ldap_count_references( #[PhpVersionAware(['8.1' => 'LDAP\Result'], default: 'resource')] $result ): int {} +/** + * @since 8.3 + */ +function ldap_exop_sync(LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): LDAP\Result|bool {} + define('LDAP_ESCAPE_FILTER', 1); define('LDAP_ESCAPE_DN', 2); define('LDAP_DEREF_NEVER', 0); diff --git a/mbstring/mbstring.php b/mbstring/mbstring.php index b7a755bed..fb4be1ec1 100644 --- a/mbstring/mbstring.php +++ b/mbstring/mbstring.php @@ -1416,6 +1416,11 @@ function mbereg_search_setpos($position) {} #[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] function mb_str_split(string $string, int $length = 1, ?string $encoding) {} +/** + * @since 8.3 + */ +function mb_str_pad(string $string, int $length, string $pad_string = " ", int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string {} + /** * @removed 8.0 */ diff --git a/meta/attributes/Deprecated.php b/meta/attributes/Deprecated.php index 16cf71b6f..38b6fbe99 100644 --- a/meta/attributes/Deprecated.php +++ b/meta/attributes/Deprecated.php @@ -19,7 +19,8 @@ class Deprecated "7.4", "8.0", "8.1", - "8.2" + "8.2", + "8.3" ]; /** diff --git a/mysqli/mysqli.php b/mysqli/mysqli.php index 98068a61c..21709609e 100644 --- a/mysqli/mysqli.php +++ b/mysqli/mysqli.php @@ -1323,10 +1323,10 @@ public function fetch_column(int $column = 0): string|int|float|false|null {} * The field number. This value must be in the range from * 0 to number of fields - 1. *

    - * @return bool true on success or false on failure. */ #[TentativeType] - public function field_seek(int $index): bool {} + #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] + public function field_seek(int $index) {} /** * Frees the memory associated with a result @@ -2010,9 +2010,9 @@ function mysqli_field_count(mysqli $mysql): int {} * @param mysqli_result $result A mysqli_result object returned by mysqli_query(), * mysqli_store_result(), mysqli_use_result() or mysqli_stmt_get_result(). * @param int $index The field number. This value must be in the range from 0 to number of fields - 1. - * @return bool */ -function mysqli_field_seek(mysqli_result $result, int $index): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function mysqli_field_seek(mysqli_result $result, int $index) {} /** * Get current field offset of a result pointer diff --git a/openssl/openssl.php b/openssl/openssl.php index 7dc000984..e17494e57 100644 --- a/openssl/openssl.php +++ b/openssl/openssl.php @@ -1387,6 +1387,11 @@ function openssl_cms_read(string $input_filename, &$certificates): bool {} */ define('PKCS7_BINARY', 128); +/** + * @since 8.3 + */ +define('PKCS7_NOOLDMIMETYPE', 1024); + /** * Don't try and verify the signatures on a message * @link https://php.net/manual/en/openssl.constants.php @@ -1477,6 +1482,11 @@ function openssl_cms_read(string $input_filename, &$certificates): bool {} "DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:" . "AES256-GCM-SHA384:AES128:AES256:HIGH:!SSLv2:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!RC4:!ADH"); +/** + * @since 8.3 + */ +define('OPENSSL_CMS_OLDMIMETYPE', 1024); + /** * @since 8.0 */ diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index c28309a13..9b2411bc4 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -99,9 +99,9 @@ function pg_pconnect( * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @return bool TRUE on success or FALSE on failure. */ -function pg_close(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], default: 'resource')] $connection = null): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function pg_close(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], default: 'resource')] $connection = null) {} /** * Poll the status of an in-progress asynchronous PostgreSQL connection attempt. @@ -1230,9 +1230,15 @@ function pg_copy_from( * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    + * @param int $trace_mode Since PHP 8.3 optional trace mode * @return bool TRUE on success or FALSE on failure. */ -function pg_trace(string $filename, string $mode = "w", #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], default: 'resource')] $connection = null): bool {} +function pg_trace( + string $filename, + string $mode = "w", + #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], default: 'resource')] $connection = null, + #[PhpStormStubsElementAvailable(from: '8.3')] int $trace_mode = 0 +): bool {} /** * Disable tracing of a PostgreSQL connection @@ -1243,9 +1249,9 @@ function pg_trace(string $filename, string $mode = "w", #[LanguageLevelTypeAware * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @return bool Always returns TRUE. */ -function pg_untrace(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], default: 'resource')] $connection = null): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function pg_untrace(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], default: 'resource')] $connection = null) {} /** * Create a large object @@ -2066,6 +2072,31 @@ function pg_consume_input(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'] */ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection): int|bool {} +/** + * @since 8.3 + */ +function pg_set_error_context_visibility(PgSql\Connection $connection, int $visibility): int {} + +/** + * @since 8.3 + */ +function pg_pipeline_status(PgSql\Connection $connection): int {} + +/** + * @since 8.3 + */ +function pg_pipeline_sync(PgSql\Connection $connection): bool {} + +/** + * @since 8.3 + */ +function pg_exit_pipeline_mode(PgSql\Connection $connection): bool {} + +/** + * @since 8.3 + */ +function pg_enter_pipeline_mode(PgSql\Connection $connection): bool {} + define('PGSQL_LIBPQ_VERSION', "15.4"); define('PGSQL_LIBPQ_VERSION_STR', "15.4"); @@ -2426,4 +2457,15 @@ function pg_flush(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], defaul const PGSQL_DIAG_DATATYPE_NAME = 100; const PGSQL_DIAG_CONSTRAINT_NAME = 110; const PGSQL_DIAG_SEVERITY_NONLOCALIZED = 86; + +const PGSQL_ERRORS_SQLSTATE = 0; +const PGSQL_TRACE_REGRESS_MODE = 2; +const PGSQL_PIPELINE_SYNC = 10; +const PGSQL_PIPELINE_ON = 1; +const PGSQL_PIPELINE_OFF = 0; +const PGSQL_PIPELINE_ABORTED = 2; +const PGSQL_SHOW_CONTEXT_NEVER = 0; +const PGSQL_SHOW_CONTEXT_ERRORS = 1; +const PGSQL_SHOW_CONTEXT_ALWAYS = 2; + // End of pgsql v. diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2f1b27673..9ade31f1d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -69,6 +69,16 @@ tests/StubsPhp81Tests.php + tests/BaseClassesTest.php + tests/BaseConstantsTest.php + tests/BaseFunctionsTest.php + tests/StubsMetaExpectedArgumentsTest.php + tests/StubsMetaInternalTagTest.php + tests/StubsParameterNamesTest.php + tests/StubsTypeHintsTest.php + tests/StubsForbiddenTypeHintsTest.php + + tests/BaseClassesTest.php tests/BaseConstantsTest.php tests/BaseFunctionsTest.php diff --git a/posix/posix.php b/posix/posix.php index cde825d4f..f6129e648 100644 --- a/posix/posix.php +++ b/posix/posix.php @@ -2,6 +2,7 @@ // Start of posix v. use JetBrains\PhpStorm\ArrayShape; +use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; use JetBrains\PhpStorm\Pure; /** @@ -700,7 +701,7 @@ function posix_getpwuid(int $user_id): array|false {} * */ #[Pure] -function posix_getrlimit(): array|false {} +function posix_getrlimit(#[PhpStormStubsElementAvailable(from: '8.3')] ?int $resource = null): array|false {} /** * Retrieve the error number set by the last posix function that failed @@ -745,6 +746,16 @@ function posix_strerror(int $error_code): string {} #[Pure] function posix_initgroups(string $username, int $group_id): bool {} +/** + * @since 8.3 + */ +function posix_sysconf(int $conf_id): int {} + +/** + * @since 8.3 + */ +function posix_eaccess(string $filename, int $flags = 0): bool {} + /** * Check whether the file exists. * @link https://php.net/manual/en/posix.constants.php @@ -910,4 +921,19 @@ function posix_initgroups(string $username, int $group_id): bool {} */ define('POSIX_RLIMIT_INFINITY', 9223372036854775807); +define('POSIX_SC_ARG_MAX', 0); +define('POSIX_SC_PAGESIZE', 30); +define('POSIX_SC_NPROCESSORS_CONF', 83); +define('POSIX_SC_NPROCESSORS_ONLN', 84); +define('POSIX_PC_LINK_MAX', 0); +define('POSIX_PC_MAX_CANON', 1); +define('POSIX_PC_MAX_INPUT', 2); +define('POSIX_PC_NAME_MAX', 3); +define('POSIX_PC_PATH_MAX', 4); +define('POSIX_PC_PIPE_BUF', 5); +define('POSIX_PC_CHOWN_RESTRICTED', 6); +define('POSIX_PC_NO_TRUNC', 7); +define('POSIX_PC_ALLOC_SIZE_MIN', 18); +define('POSIX_PC_SYMLINK_MAX', 19); + // End of posix v. diff --git a/random/random.php b/random/random.php index c63c8e3dc..becbf9c37 100644 --- a/random/random.php +++ b/random/random.php @@ -1,6 +1,7 @@ + * @param int|null $seed

    * An optional seed value *

    * @param int $mode [optional]

    @@ -23,7 +24,7 @@ function lcg_value(): float {} * @return void */ function mt_srand( - int $seed = null, + #[LanguageLevelTypeAware(['8.3' => 'int|null'], default: 'int')] $seed = null, #[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937 ): void {} @@ -33,7 +34,7 @@ function mt_srand( * an alias of {@see mt_srand()}. *

    * @link https://php.net/manual/en/function.srand.php - * @param int $seed

    + * @param int|null $seed

    * Optional seed value *

    * @param int $mode [optional]

    @@ -42,7 +43,7 @@ function mt_srand( * @return void */ function srand( - int $seed = null, + #[LanguageLevelTypeAware(['8.3' => 'int|null'], default: 'int')] $seed = null, #[PhpStormStubsElementAvailable(from: '7.1')] int $mode = MT_RAND_MT19937 ): void {} @@ -214,6 +215,21 @@ public function pickArrayKeys(array $array, int $num): array {} public function __serialize(): array {} public function __unserialize(array $data): void {} + + /** + * @since 8.3 + */ + public function nextFloat(): float {} + + /** + * @since 8.3 + */ + public function getFloat(float $min, float $max, IntervalBoundary $boundary = IntervalBoundary::ClosedOpen): float {} + + /** + * @since 8.3 + */ + public function getBytesFromString(string $string, int $length): string {} } /** @@ -230,4 +246,19 @@ class BrokenRandomEngineError extends RandomError {} * @since 8.2 */ class RandomException extends Exception {} + + /** + * @since 8.3 + */ + enum IntervalBoundary + { + public string $name; + + case ClosedOpen; + case ClosedClosed; + case OpenClosed; + case OpenOpen; + + public static function cases(): array {} + } } diff --git a/sockets/sockets.php b/sockets/sockets.php index 7fa20c9f4..b119c19ad 100644 --- a/sockets/sockets.php +++ b/sockets/sockets.php @@ -1400,6 +1400,11 @@ function socket_wsaprotocol_info_import($info_id) {} */ function socket_wsaprotocol_info_release($info_id) {} +/** + * @since 8.3 + */ +function socket_atmark(Socket $socket): bool {} + define('AF_UNIX', 1); define('AF_INET', 2); @@ -1462,7 +1467,12 @@ function socket_wsaprotocol_info_release($info_id) {} define('SO_TYPE', 3); define('SO_ERROR', 4); define('SO_BINDTODEVICE', 25); +define('SO_ATTACH_REUSEPORT_CBPF', 51); +define('SO_DETACH_FILTER', 27); +define('SO_DETACH_BPF', 27); + define('SOL_SOCKET', 1); +define('SOL_UDPLITE', 136); define('SOMAXCONN', 128); /** * @since 8.1 @@ -1560,6 +1570,14 @@ function socket_wsaprotocol_info_release($info_id) {} */ define('IPV6_MULTICAST_LOOP', 19); define('IPV6_V6ONLY', 26); +define('IP_BIND_ADDRESS_NO_PORT', 24); +define('IP_MTU_DISCOVER', 10); +define('IP_PMTUDISC_DO', 2); +define('IP_PMTUDISC_DONT', 0); +define('IP_PMTUDISC_WANT', 1); +define('IP_PMTUDISC_PROBE', 3); +define('IP_PMTUDISC_INTERFACE', 4); +define('IP_PMTUDISC_OMIT', 5); /** * Operation not permitted. @@ -2326,6 +2344,16 @@ function socket_wsaprotocol_info_release($info_id) {} */ define('TCP_KEEPCNT', 6); +/** + * @since 8.3 + */ +define('TCP_QUICKACK', 12); + +/** + * @since 8.3 + */ +define('TCP_REPAIR', 19); + /** * Socket_set_option for the socket_send* functions. * It avoids copy b/w userland and kernel for both TCP and UDP protocols. diff --git a/sqlite3/sqlite3.php b/sqlite3/sqlite3.php index b26210e46..f4d942d61 100644 --- a/sqlite3/sqlite3.php +++ b/sqlite3/sqlite3.php @@ -6,6 +6,11 @@ use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; use JetBrains\PhpStorm\Internal\TentativeType; +/** + * @since 8.3 + */ +class SQLite3Exception extends \Exception {} + /** * A class that interfaces SQLite 3 databases. * @link https://php.net/manual/en/class.sqlite3.php diff --git a/standard/standard_4.php b/standard/standard_4.php index 0c5e43fe2..ba361c1f1 100644 --- a/standard/standard_4.php +++ b/standard/standard_4.php @@ -244,12 +244,12 @@ function debug_zval_dump( * to true, print_r will return its output, instead of * printing it (which it does by default). *

    - * @return string|true If given a string, integer or float, + * @return string|bool If given a string, integer or float, * the value itself will be printed. If given an array, values * will be presented in a format that shows keys and elements. Similar * notation is used for objects. */ -function print_r(mixed $value, bool $return = false): string|true {} +function print_r(mixed $value, bool $return = false): string|bool {} /** * Returns the amount of memory allocated to PHP diff --git a/standard/standard_6.php b/standard/standard_6.php index 92835dd96..c72bdf2d8 100644 --- a/standard/standard_6.php +++ b/standard/standard_6.php @@ -589,6 +589,11 @@ function stream_get_contents($stream, ?int $length = null, int $offset = -1): st */ function stream_supports_lock($stream): bool {} +/** + * @since 8.3 + */ +function stream_context_set_options($context, array $options): bool {} + /** * Gets line from file pointer and parse for CSV fields * @link https://php.net/manual/en/function.fgetcsv.php diff --git a/standard/standard_8.php b/standard/standard_8.php index 9b316e7ba..643f60961 100644 --- a/standard/standard_8.php +++ b/standard/standard_8.php @@ -59,7 +59,6 @@ * (strerror) corresponding to the present value of * errno. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function syslog(int $priority, string $message): bool {} @@ -67,7 +66,6 @@ function syslog(int $priority, string $message): bool {} /** * Close connection to system logger * @link https://php.net/manual/en/function.closelog.php - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function closelog(): bool {} @@ -140,7 +138,7 @@ function define_syslog_variables() {} */ #[Pure] #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] -function metaphone(string $string, int $max_phonemes = 0): false|string {} +function metaphone(string $string, int $max_phonemes = 0) {} /** * Turn on output buffering @@ -395,7 +393,6 @@ function ob_list_handlers(): array {} * parameter sort_flags, for details * see sort. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function ksort(array &$array, int $flags = SORT_REGULAR): bool {} @@ -411,7 +408,6 @@ function ksort(array &$array, int $flags = SORT_REGULAR): bool {} * sort_flags, for details see * sort. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function krsort(array &$array, int $flags = SORT_REGULAR): bool {} @@ -422,9 +418,9 @@ function krsort(array &$array, int $flags = SORT_REGULAR): bool {} * @param array &$array

    * The input array. *

    - * @return bool true on success or false on failure. */ -function natsort(array &$array): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function natsort(array &$array) {} /** * Sort an array using a case insensitive "natural order" algorithm @@ -432,9 +428,9 @@ function natsort(array &$array): bool {} * @param array &$array

    * The input array. *

    - * @return bool true on success or false on failure. */ -function natcasesort(array &$array): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function natcasesort(array &$array) {} /** * Sort an array and maintain index association @@ -447,10 +443,9 @@ function natcasesort(array &$array): bool {} * parameter sort_flags, for details * see sort. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function asort(array &$array, int $flags = SORT_REGULAR): bool {} +function asort(array &$array, int $flags = SORT_REGULAR) {} /** * Sort an array in reverse order and maintain index association @@ -463,7 +458,6 @@ function asort(array &$array, int $flags = SORT_REGULAR): bool {} * sort_flags, for details see * sort. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function arsort(array &$array, int $flags = SORT_REGULAR): bool {} @@ -482,7 +476,6 @@ function arsort(array &$array, int $flags = SORT_REGULAR): bool {} * Sorting type flags:
    * SORT_REGULAR - compare items normally * (don't change types)

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function sort(array &$array, int $flags = SORT_REGULAR): bool {} @@ -498,9 +491,9 @@ function sort(array &$array, int $flags = SORT_REGULAR): bool {} * parameter sort_flags, for details see * sort. *

    - * @return bool true on success or false on failure. */ -function rsort(array &$array, int $flags = SORT_REGULAR): bool {} +#[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] +function rsort(array &$array, int $flags = SORT_REGULAR) {} /** * Sort an array by values using a user-defined comparison function @@ -513,7 +506,6 @@ function rsort(array &$array, int $flags = SORT_REGULAR): bool {} * greater than zero if the first argument is considered to be * respectively less than, equal to, or greater than the second. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function usort(array &$array, callable $callback): bool {} @@ -528,7 +520,6 @@ function usort(array &$array, callable $callback): bool {} * See usort and uksort for * examples of user-defined comparison functions. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function uasort(array &$array, callable $callback): bool {} @@ -550,7 +541,6 @@ function uasort(array &$array, callable $callback): bool {} * be respectively less than, equal to, or greater than the * second. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function uksort(array &$array, callable $callback): bool {} @@ -561,7 +551,6 @@ function uksort(array &$array, callable $callback): bool {} * @param array &$array

    * The array. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function shuffle(array &$array): bool {} @@ -596,7 +585,6 @@ function shuffle(array &$array): bool {} * it will be passed as the third parameter to the callback * funcname. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function array_walk(object|array &$array, callable $callback, mixed $arg): bool {} @@ -625,7 +613,6 @@ function array_walk(object|array &$array, callable $callback, mixed $arg): bool * it will be passed as the third parameter to the callback * funcname. *

    - * @return bool true on success or false on failure. */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] function array_walk_recursive(object|array &$array, callable $callback, mixed $arg): bool {} @@ -937,7 +924,11 @@ function array_fill_keys(array $keys, mixed $value): array {} * end, inclusive. */ #[Pure] -function range($start, $end, int|float $step = 1): array {} +function range( + #[LanguageLevelTypeAware(['8.3' => 'string|int|float'], default: '')] $start, + #[LanguageLevelTypeAware(['8.3' => 'string|int|float'], default: '')] $end, + int|float $step = 1 +): array {} /** * Sort multiple or multi-dimensional arrays diff --git a/standard/standard_9.php b/standard/standard_9.php index 4a2e1acab..e500a6ffc 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -948,6 +948,7 @@ class AssertionError extends Error {} * An optional new value for the option. *

    * @return mixed The original setting of any option. + * @deprecated */ function assert_options(int $option, mixed $value): mixed {} diff --git a/tests/AbstractBaseStubsTestCase.php b/tests/AbstractBaseStubsTestCase.php index a62e5b8f3..6c4483b52 100644 --- a/tests/AbstractBaseStubsTestCase.php +++ b/tests/AbstractBaseStubsTestCase.php @@ -16,6 +16,7 @@ use RuntimeException; use StubTests\Model\PHPClass; use StubTests\Model\PHPConst; +use StubTests\Model\PHPEnum; use StubTests\Model\PHPFunction; use StubTests\Model\PHPInterface; use StubTests\Parsers\ParserUtils; @@ -75,12 +76,15 @@ public static function getStringRepresentationOfDefaultParameterValue(mixed $def if ($class === 'self' && $contextClass !== null) { $class = $contextClass->name; } - $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($class) ?? + $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($class) ?? + PhpStormStubsSingleton::getPhpStormStubs()->getClass($class) ?? PhpStormStubsSingleton::getPhpStormStubs()->getInterface($class); if ($parentClass === null) { throw new Exception("Class $class not found in stubs"); } - if ((string)$defaultValue->name === 'class') { + if ($parentClass instanceof PHPEnum) { + $value = $parentClass->name . "::" . $defaultValue->name; + } elseif ((string)$defaultValue->name === 'class') { $value = (string)$defaultValue->class; } else { $constant = $parentClass->getConstant((string)$defaultValue->name);; @@ -90,6 +94,8 @@ public static function getStringRepresentationOfDefaultParameterValue(mixed $def $value = "null"; } elseif (is_array($defaultValue) || $defaultValue instanceof Array_) { $value = '[]'; + } elseif ($defaultValue instanceof \UnitEnum){ + $value = get_class($defaultValue) . "::" . $defaultValue->name; } else { $value = strval($defaultValue); } diff --git a/tests/BaseClassesTest.php b/tests/BaseClassesTest.php index b72046f49..d61290a78 100644 --- a/tests/BaseClassesTest.php +++ b/tests/BaseClassesTest.php @@ -6,6 +6,7 @@ use PHPUnit\Framework\Exception; use RuntimeException; use StubTests\Model\PHPClass; +use StubTests\Model\PHPEnum; use StubTests\Model\PHPInterface; use StubTests\Model\PHPMethod; use StubTests\Model\PHPProperty; @@ -45,10 +46,12 @@ public function testClassesParent(PHPClass|PHPInterface $class) * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionMethodsProvider::classMethodsProvider * @throws Exception|RuntimeException */ - public function testClassesMethodsExist(PHPClass|PHPInterface $class, PHPMethod $method) + public function testClassesMethodsExist(PHPClass|PHPInterface|PHPEnum $class, PHPMethod $method) { $className = $class->name; - if ($class instanceof PHPClass) { + if ($class instanceof PHPEnum) { + $stubClass = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($className); + } elseif ($class instanceof PHPClass) { $stubClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($className); } else { $stubClass = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($className); @@ -63,7 +66,9 @@ public function testClassesMethodsExist(PHPClass|PHPInterface $class, PHPMethod public function testClassesFinalMethods(PHPClass|PHPInterface $class, PHPMethod $method) { $className = $class->name; - if ($class instanceof PHPClass) { + if ($class instanceof PHPEnum) { + $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($className)->getMethod($method->name); + } elseif ($class instanceof PHPClass) { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getClass($className)->getMethod($method->name); } else { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($className)->getMethod($method->name); @@ -82,7 +87,9 @@ public function testClassesFinalMethods(PHPClass|PHPInterface $class, PHPMethod public function testClassesStaticMethods(PHPClass|PHPInterface $class, PHPMethod $method) { $className = $class->name; - if ($class instanceof PHPClass) { + if ($class instanceof PHPEnum) { + $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($className)->getMethod($method->name); + } elseif ($class instanceof PHPClass) { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getClass($className)->getMethod($method->name); } else { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($className)->getMethod($method->name); @@ -101,7 +108,9 @@ public function testClassesStaticMethods(PHPClass|PHPInterface $class, PHPMethod public function testClassesMethodsVisibility(PHPClass|PHPInterface $class, PHPMethod $method) { $className = $class->name; - if ($class instanceof PHPClass) { + if ($class instanceof PHPEnum) { + $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($className)->getMethod($method->name); + } elseif ($class instanceof PHPClass) { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getClass($className)->getMethod($method->name); } else { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($className)->getMethod($method->name); @@ -120,7 +129,9 @@ public function testClassesMethodsVisibility(PHPClass|PHPInterface $class, PHPMe public function testClassMethodsParametersCount(PHPClass|PHPInterface $class, PHPMethod $method) { $className = $class->name; - if ($class instanceof PHPClass) { + if ($class instanceof PHPEnum) { + $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($className)->getMethod($method->name); + } elseif ($class instanceof PHPClass) { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getClass($className)->getMethod($method->name); } else { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($className)->getMethod($method->name); diff --git a/tests/DockerImages/8.3/Dockerfile b/tests/DockerImages/8.3/Dockerfile new file mode 100644 index 000000000..766eb15a0 --- /dev/null +++ b/tests/DockerImages/8.3/Dockerfile @@ -0,0 +1,14 @@ +FROM php:8.3.0beta3-alpine + +RUN set -eux; \ + apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community --no-cache --virtual .build-deps \ + bash gcc g++ make autoconf pkgconfig git \ + libmcrypt-dev imap-dev php-imap enchant2 php-enchant bzip2-dev gettext-dev libxml2-dev php82-dev php-gd icu-dev \ + php-zip php-tidy php-intl libffi-dev openssl-dev php82-pear rabbitmq-c rabbitmq-c-dev librrd \ + libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + +RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ + pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell + +WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/DockerImages/testRunner/Dockerfile b/tests/DockerImages/testRunner/Dockerfile index fc6b6ed8c..244e1897c 100644 --- a/tests/DockerImages/testRunner/Dockerfile +++ b/tests/DockerImages/testRunner/Dockerfile @@ -1,8 +1,26 @@ -FROM php:8.1-apache +FROM php:8.3.0beta3-apache RUN echo 'memory_limit = 1024M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini COPY --from=composer /usr/bin/composer /usr/bin/composer RUN apt-get update && apt-get -y install git zip unzip - +RUN apt-get update -y && \ + apt-get install git -y && \ + git clone https://github.com/xdebug/xdebug +WORKDIR xdebug +RUN phpize && \ + chmod +x configure && \ + ./configure --enable-xdebug && \ + make && \ + make install +# Enable xdebug extension +RUN echo "zend_extension=$(php-config --extension-dir)/xdebug.so" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +#RUN pecl install xdebug +#RUN docker-php-ext-enable xdebug +RUN echo "xdebug.mode=develop,debug,coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +#RUN echo "xdebug.remote_host=192.168.178.178" >> /usr/local/etc/php/php.ini +RUN echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/php.ini +RUN echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +RUN echo "xdebug.output_dir=/opt/project/xdebug_snapshots" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +RUN echo "xdebug.log=/opt/project/xdebug_logs/xdebug33php82.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini WORKDIR /opt/project/phpstorm-stubs diff --git a/tests/Model/BasePHPClass.php b/tests/Model/BasePHPClass.php index fc5a593d2..300ec83c3 100644 --- a/tests/Model/BasePHPClass.php +++ b/tests/Model/BasePHPClass.php @@ -36,6 +36,23 @@ function (PHPConst $nextConstant) use ($parsedConstant) { } } + public function addEnumCase(PHPEnumCase $parsedConstant) + { + if (isset($parsedConstant->name)) { + if (array_key_exists($parsedConstant->name, $this->constants)) { + $amount = count(array_filter( + $this->constants, + function (PHPConst $nextConstant) use ($parsedConstant) { + return $nextConstant->name === $parsedConstant->name; + } + )); + $this->constants[$parsedConstant->name . '_duplicated_' . $amount] = $parsedConstant; + } else { + $this->constants[$parsedConstant->name] = $parsedConstant; + } + } + } + /** * @return PHPConst|null * @throws RuntimeException diff --git a/tests/Model/PHPConst.php b/tests/Model/PHPConst.php index 15cc90679..e1f7247e2 100644 --- a/tests/Model/PHPConst.php +++ b/tests/Model/PHPConst.php @@ -8,6 +8,7 @@ use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Expr\UnaryMinus; use PhpParser\Node\Stmt\ClassConst; +use PhpParser\Node\Stmt\Enum_; use PhpParser\Node\Stmt\Namespace_; use PhpParser\NodeAbstract; use ReflectionClassConstant; @@ -107,9 +108,14 @@ protected function getConstValue($node) protected function getConstantFQN(NodeAbstract $node, $nodeName) { $namespace = ''; - $parentParentNode = $node->getAttribute('parent')->getAttribute('parent'); - if ($parentParentNode instanceof Namespace_ && !empty($parentParentNode->name)) { - $namespace = '\\' . implode('\\', $parentParentNode->name->parts) . '\\'; + $parentNode = $node->getAttribute('parent'); + if ($parentNode instanceof Enum_) { + return $nodeName; + } else { + $parentParentNode = $parentNode->getAttribute('parent'); + if ($parentParentNode instanceof Namespace_ && !empty($parentParentNode->name)) { + $namespace = '\\' . implode('\\', $parentParentNode->name->parts) . '\\'; + } } return $namespace . $nodeName; diff --git a/tests/Model/PHPEnum.php b/tests/Model/PHPEnum.php new file mode 100644 index 000000000..0b3096720 --- /dev/null +++ b/tests/Model/PHPEnum.php @@ -0,0 +1,111 @@ +name = $reflectionObject->getName(); + $this->interfaces = $reflectionObject->getInterfaceNames(); + $this->isFinal = $reflectionObject->isFinal(); + if (method_exists($reflectionObject, 'isReadOnly')) { + $this->isReadonly = $reflectionObject->isReadOnly(); + } + foreach ($reflectionObject->getMethods() as $method) { + if ($method->getDeclaringClass()->getName() !== $this->name) { + continue; + } + $parsedMethod = (new PHPMethod())->readObjectFromReflection($method); + $this->addMethod($parsedMethod); + } + + if (method_exists($reflectionObject, 'getReflectionConstants')) { + foreach ($reflectionObject->getReflectionConstants() as $constant) { + if ($constant->getDeclaringClass()->getName() !== $this->name) { + continue; + } + if ($constant->isEnumCase()) { + $enumCase = (new PHPEnumCase())->readObjectFromReflection($constant); + $this->addEnumCase($enumCase); + } else { + $parsedConstant = (new PHPConst())->readObjectFromReflection($constant); + $this->addConstant($parsedConstant); + } + } + } + + foreach ($reflectionObject->getProperties() as $property) { + if ($property->getDeclaringClass()->getName() !== $this->name) { + continue; + } + $parsedProperty = (new PHPProperty())->readObjectFromReflection($property); + $this->addProperty($parsedProperty); + } + + return $this; + } + + /** + * @param Enum_ $node + * @return static + */ + public function readObjectFromStubNode($node) + { + $this->name = self::getFQN($node); + $this->availableVersionsRangeFromAttribute = self::findAvailableVersionsRangeFromAttribute($node->attrGroups); + $this->collectTags($node); + if (!empty($node->extends)) { + $this->parentClass = ''; + foreach ($node->extends->parts as $part) { + $this->parentClass .= "\\$part"; + } + $this->parentClass = ltrim($this->parentClass, "\\"); + } + if (!empty($node->implements)) { + foreach ($node->implements as $interfaceObject) { + $interfaceFQN = ''; + foreach ($interfaceObject->parts as $interface) { + $interfaceFQN .= "\\$interface"; + } + $this->interfaces[] = ltrim($interfaceFQN, "\\"); + } + } + if ($node->getDocComment() !== null) { + $docBlock = DocBlockFactory::createInstance()->create($node->getDocComment()->getText()); + /** @var PropertyRead[] $properties */ + $properties = array_merge( + $docBlock->getTagsByName('property-read'), + $docBlock->getTagsByName('property') + ); + foreach ($properties as $property) { + $propertyName = $property->getVariableName(); + assert($propertyName !== '', "@property name is empty in class $this->name"); + $newProperty = new PHPProperty($this->name); + $newProperty->is_static = false; + $newProperty->access = 'public'; + $newProperty->name = $propertyName; + $newProperty->parentName = $this->name; + $newProperty->typesFromSignature = self::convertParsedTypeToArray($property->getType()); + assert( + !array_key_exists($propertyName, $this->properties), + "Property '$propertyName' is already declared in class '$this->name'" + ); + $this->properties[$propertyName] = $newProperty; + } + } + + return $this; + } + + public function readMutedProblems($jsonData) {} +} diff --git a/tests/Model/PHPEnumCase.php b/tests/Model/PHPEnumCase.php new file mode 100644 index 000000000..ea5bc4e5c --- /dev/null +++ b/tests/Model/PHPEnumCase.php @@ -0,0 +1,45 @@ +name = $reflectionObject->name; + $this->value = $reflectionObject->getValue(); + if ($reflectionObject->isPrivate()) { + $this->visibility = 'private'; + } elseif ($reflectionObject->isProtected()) { + $this->visibility = 'protected'; + } else { + $this->visibility = 'public'; + } + return $this; + } + + /** + * @param EnumCase $node + * @return $this|PHPEnumCase + */ + public function readObjectFromStubNode($node) + { + $this->name = $this->getConstantFQN($node, $node->name->name); + //$this->value = $this->getConstValue($node); + //$this->collectTags($node); + $parentNode = $node->getAttribute('parent'); + if (property_exists($parentNode, 'attrGroups')) { + $this->availableVersionsRangeFromAttribute = self::findAvailableVersionsRangeFromAttribute($parentNode->attrGroups); + } + $this->parentName = self::getFQN($parentNode->namespacedName); + return $this; + } + + public function readMutedProblems($jsonData) {} +} diff --git a/tests/Model/PhpVersions.php b/tests/Model/PhpVersions.php index f5cafc53b..784dc2903 100644 --- a/tests/Model/PhpVersions.php +++ b/tests/Model/PhpVersions.php @@ -10,7 +10,7 @@ class PhpVersions implements ArrayAccess, IteratorAggregate { - private static $versions = [5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2]; + private static $versions = [5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]; public static function getLatest() { diff --git a/tests/Model/StubsContainer.php b/tests/Model/StubsContainer.php index aa93c096c..44d60ef4f 100644 --- a/tests/Model/StubsContainer.php +++ b/tests/Model/StubsContainer.php @@ -28,6 +28,11 @@ class StubsContainer */ private $interfaces = []; + /** + * @var PHPEnum[] + */ + private $enums = []; + /** * @return PHPConst[] */ @@ -188,6 +193,38 @@ public function getClass($name, $sourceFilePath = null, $shouldSuitCurrentPhpVer return null; } + /** + * @param string $name + * @param string|null $sourceFilePath + * @param bool $shouldSuitCurrentPhpVersion + * @return PHPEnum|null + * @throws RuntimeException + */ + public function getEnum($name, $sourceFilePath = null, $shouldSuitCurrentPhpVersion = true) + { + $enums = array_filter($this->enums, function (PHPEnum $enum) use ($shouldSuitCurrentPhpVersion, $name) { + return $enum->name === $name && + (!$shouldSuitCurrentPhpVersion || BasePHPElement::entitySuitsCurrentPhpVersion($enum)); + }); + if (count($enums) === 1) { + return array_pop($enums); + } + + if ($sourceFilePath !== null) { + $enums = array_filter($enums, function (PHPEnum $enum) use ($shouldSuitCurrentPhpVersion, $sourceFilePath) { + return $enum->sourceFilePath === $sourceFilePath && + (!$shouldSuitCurrentPhpVersion || BasePHPElement::entitySuitsCurrentPhpVersion($enum)); + }); + } + if (count($enums) > 1) { + throw new RuntimeException("Multiple enums with name $name found"); + } + if (!empty($enums)) { + return array_pop($enums); + } + return null; + } + /** * @return PHPClass[] */ @@ -255,6 +292,14 @@ public function getInterfaces() return $this->interfaces; } + /** + * @return PHPEnum[] + */ + public function getEnums() + { + return $this->enums; + } + /** * @return PHPInterface[] */ @@ -281,4 +326,21 @@ function (PHPInterface $nextInterface) use ($interface) { } } } + + public function addEnum(PHPEnum $enum) + { + if (isset($enum->name)) { + if (array_key_exists($enum->name, $this->enums)) { + $amount = count(array_filter( + $this->enums, + function (PHPEnum $nextEnum) use ($enum) { + return $nextEnum->name === $enum->name; + } + )); + $this->enums[$enum->name . '_duplicated_' . $amount] = $enum; + } else { + $this->enums[$enum->name] = $enum; + } + } + } } diff --git a/tests/Parsers/PHPReflectionParser.php b/tests/Parsers/PHPReflectionParser.php index dc443b53c..4a6bb9159 100644 --- a/tests/Parsers/PHPReflectionParser.php +++ b/tests/Parsers/PHPReflectionParser.php @@ -7,6 +7,7 @@ use StubTests\Model\CommonUtils; use StubTests\Model\PHPClass; use StubTests\Model\PHPDefineConstant; +use StubTests\Model\PHPEnum; use StubTests\Model\PHPFunction; use StubTests\Model\PHPInterface; use StubTests\Model\StubsContainer; @@ -44,9 +45,15 @@ public static function getStubs() foreach (get_declared_classes() as $clazz) { $reflectionClass = new ReflectionClass($clazz); if ($reflectionClass->isInternal()) { - $class = (new PHPClass())->readObjectFromReflection($reflectionClass); - $class->readMutedProblems($jsonData->classes); - $stubs->addClass($class); + if (method_exists($reflectionClass, 'isEnum') && $reflectionClass->isEnum()) { + $enum = (new PHPEnum())->readObjectFromReflection($reflectionClass); + $enum->readMutedProblems($jsonData->enums); + $stubs->addEnum($enum); + } else { + $class = (new PHPClass())->readObjectFromReflection($reflectionClass); + $class->readMutedProblems($jsonData->classes); + $stubs->addClass($class); + } } } diff --git a/tests/Parsers/ParserUtils.php b/tests/Parsers/ParserUtils.php index c29b1db8c..a2b3b66d3 100644 --- a/tests/Parsers/ParserUtils.php +++ b/tests/Parsers/ParserUtils.php @@ -122,7 +122,10 @@ private static function getLatestAvailableVersionFromPhpDoc(BasePHPElement $elem */ private static function getSinceVersionsFromParentClass(PHPMethod|PHPConst $element): array { - $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($element->parentName, shouldSuitCurrentPhpVersion: false); + $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($element->parentName, shouldSuitCurrentPhpVersion: false); + if ($parentClass === null) { + $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($element->parentName, shouldSuitCurrentPhpVersion: false); + } if ($parentClass === null) { $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($element->parentName, shouldSuitCurrentPhpVersion: false); } @@ -137,7 +140,10 @@ private static function getSinceVersionsFromParentClass(PHPMethod|PHPConst $elem */ public static function getLatestAvailableVersionsFromParentClass(PHPMethod|PHPConst $element): array { - $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($element->parentName, shouldSuitCurrentPhpVersion: false); + $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($element->parentName, shouldSuitCurrentPhpVersion: false); + if ($parentClass === null) { + $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($element->parentName, shouldSuitCurrentPhpVersion: false); + } if ($parentClass === null) { $parentClass = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($element->parentName, shouldSuitCurrentPhpVersion: false); } diff --git a/tests/Parsers/Visitors/ASTVisitor.php b/tests/Parsers/Visitors/ASTVisitor.php index 95ea11494..4a83ef45d 100644 --- a/tests/Parsers/Visitors/ASTVisitor.php +++ b/tests/Parsers/Visitors/ASTVisitor.php @@ -8,6 +8,7 @@ use PhpParser\Node\Const_; use PhpParser\Node\Expr\FuncCall; use PhpParser\Node\Stmt\Class_; +use PhpParser\Node\Stmt\Enum_; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Function_; use PhpParser\Node\Stmt\Interface_; @@ -17,6 +18,8 @@ use StubTests\Model\PHPClass; use StubTests\Model\PHPConst; use StubTests\Model\PHPDefineConstant; +use StubTests\Model\PHPEnum; +use StubTests\Model\PHPEnumCase; use StubTests\Model\PHPFunction; use StubTests\Model\PHPInterface; use StubTests\Model\PHPMethod; @@ -43,6 +46,15 @@ public function enterNode(Node $node): void $function->stubBelongsToCore = true; } $this->stubs->addFunction($function); + } elseif ($node instanceof Node\Stmt\EnumCase) { + $constant = (new PHPEnumCase())->readObjectFromStubNode($node); + $constant->sourceFilePath = $this->sourceFilePath; + if ($this->isStubCore) { + $constant->stubBelongsToCore = true; + } + if ($this->stubs->getEnum($constant->parentName, $this->sourceFilePath, false) !== null) { + $this->stubs->getEnum($constant->parentName, $this->sourceFilePath, false)->addEnumCase($constant); + } } elseif ($node instanceof Const_) { $constant = (new PHPConst())->readObjectFromStubNode($node); $constant->sourceFilePath = $this->sourceFilePath; @@ -51,6 +63,8 @@ public function enterNode(Node $node): void } if ($constant->parentName === null) { $this->stubs->addConstant($constant); + } elseif ($this->stubs->getEnum($constant->parentName, $this->sourceFilePath, false) !== null) { + $this->stubs->getEnum($constant->parentName, $this->sourceFilePath, false)->addConstant($constant); } elseif ($this->stubs->getClass($constant->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getClass($constant->parentName, $this->sourceFilePath, false)->addConstant($constant); } elseif ($this->stubs->getInterface($constant->parentName, $this->sourceFilePath, false) !== null) { @@ -71,7 +85,10 @@ public function enterNode(Node $node): void if ($this->isStubCore) { $method->stubBelongsToCore = true; } - if ($this->stubs->getClass($method->parentName, $this->sourceFilePath, false) !== null) { + if ($this->stubs->getEnum($method->parentName, $this->sourceFilePath, false) !== null) { + $this->stubs->getEnum($method->parentName, $this->sourceFilePath, false)->addMethod($method); + } + elseif ($this->stubs->getClass($method->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getClass($method->parentName, $this->sourceFilePath, false)->addMethod($method); } elseif ($this->stubs->getInterface($method->parentName, $this->sourceFilePath, false) !== null) { $this->stubs->getInterface($method->parentName, $this->sourceFilePath, false)->addMethod($method); @@ -90,6 +107,13 @@ public function enterNode(Node $node): void $class->stubBelongsToCore = true; } $this->stubs->addClass($class); + } elseif ($node instanceof Enum_) { + $enum = (new PHPEnum())->readObjectFromStubNode($node); + $enum->sourceFilePath = $this->sourceFilePath; + if ($this->isStubCore) { + $enum->stubBelongsToCore = true; + } + $this->stubs->addEnum($enum); } elseif ($node instanceof Node\Stmt\Property) { $property = (new PHPProperty())->readObjectFromStubNode($node); $property->sourceFilePath = $this->sourceFilePath; diff --git a/tests/StubsConstantsAndParametersValuesTest.php b/tests/StubsConstantsAndParametersValuesTest.php index 6498e3240..cc2c58135 100644 --- a/tests/StubsConstantsAndParametersValuesTest.php +++ b/tests/StubsConstantsAndParametersValuesTest.php @@ -7,6 +7,7 @@ use RuntimeException; use StubTests\Model\PHPClass; use StubTests\Model\PHPConst; +use StubTests\Model\PHPEnum; use StubTests\Model\PHPFunction; use StubTests\Model\PHPInterface; use StubTests\Model\PHPMethod; @@ -62,7 +63,9 @@ public function testFunctionsDefaultParametersValue(PHPFunction $function, PHPPa */ public function testMethodsDefaultParametersValue(PHPClass|PHPInterface $class, PHPMethod $method, PHPParameter $parameter) { - if ($class instanceof PHPClass) { + if ($class instanceof PHPEnum) { + $phpstormFunction = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($class->name)->getMethod($method->name); + } elseif ($class instanceof PHPClass) { $phpstormFunction = PhpStormStubsSingleton::getPhpStormStubs()->getClass($class->name)->getMethod($method->name); } else { $phpstormFunction = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($class->name)->getMethod($method->name); diff --git a/tests/StubsTypeHintsTest.php b/tests/StubsTypeHintsTest.php index 9b152a395..5b84b6123 100644 --- a/tests/StubsTypeHintsTest.php +++ b/tests/StubsTypeHintsTest.php @@ -6,6 +6,7 @@ use PHPUnit\Framework\Exception; use RuntimeException; use StubTests\Model\PHPClass; +use StubTests\Model\PHPEnum; use StubTests\Model\PHPFunction; use StubTests\Model\PHPInterface; use StubTests\Model\PHPMethod; @@ -85,7 +86,9 @@ public function testFunctionsParametersTypeHints(PHPFunction $function, PHPParam public function testMethodsReturnTypeHints(PHPClass|PHPInterface $class, PHPMethod $method) { $functionName = $method->name; - if ($class instanceof PHPClass) { + if ($class instanceof PHPEnum) { + $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($class->name)->getMethod($method->name); + } elseif ($class instanceof PHPClass) { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getClass($class->name)->getMethod($functionName); } else { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($class->name)->getMethod($functionName); diff --git a/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php b/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php index 0f036174b..56015c4e0 100644 --- a/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php +++ b/tests/TestData/Providers/Reflection/ReflectionMethodsProvider.php @@ -47,7 +47,8 @@ public static function classMethodsWithParametersProvider(): ?Generator public static function classMethodsWithoutTentitiveReturnTypeProvider(): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + - ReflectionStubsSingleton::getReflectionStubs()->getInterfaces(); + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces() + + ReflectionStubsSingleton::getReflectionStubs()->getEnums(); foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { foreach (EntitiesFilter::getFiltered( $class->methods, @@ -64,7 +65,8 @@ public static function classMethodsWithoutTentitiveReturnTypeProvider(): ?Genera public static function classMethodsWithTentitiveReturnTypeProvider(): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + - ReflectionStubsSingleton::getReflectionStubs()->getInterfaces(); + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces() + + ReflectionStubsSingleton::getReflectionStubs()->getEnums(); foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { foreach (EntitiesFilter::getFiltered( $class->methods, @@ -81,7 +83,8 @@ public static function classMethodsWithTentitiveReturnTypeProvider(): ?Generator private static function yieldFilteredMethods(int ...$problemTypes): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + - ReflectionStubsSingleton::getReflectionStubs()->getInterfaces(); + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces() + + ReflectionStubsSingleton::getReflectionStubs()->getEnums(); foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { foreach (EntitiesFilter::getFiltered($class->methods, null, ...$problemTypes) as $method) { yield "Method $class->name::$method->name" => [$class, $method]; diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index afb9962a4..31b8f6385 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -1052,6 +1052,17 @@ ] } ] + }, + { + "name": "hash_pbkdf2", + "problems": [ + { + "description": "parameter mismatch", + "versions": [ + 8.2 + ] + } + ] } ], "classes": [ @@ -1153,7 +1164,8 @@ "versions": [ 8.0, 8.1, - 8.2 + 8.2, + 8.3 ] } ], @@ -3214,7 +3226,8 @@ "versions": [ 8.0, 8.1, - 8.2 + 8.2, + 8.3 ] } ] @@ -3241,7 +3254,8 @@ "versions": [ 8.0, 8.1, - 8.2 + 8.2, + 8.3 ] } ] @@ -3331,5 +3345,6 @@ } ] } - ] + ], + "enums": [] } diff --git a/xml/xml.php b/xml/xml.php index 5d22a2a91..151fa8399 100644 --- a/xml/xml.php +++ b/xml/xml.php @@ -521,13 +521,14 @@ function xml_parser_set_option(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], * @param int $option Which option to fetch. XML_OPTION_CASE_FOLDING * and XML_OPTION_TARGET_ENCODING are available. * See xml_parser_set_option for their description. - * @return string|int This function returns FALSE if parser does + * @return string|int|bool This function returns FALSE if parser does * not refer to a valid parser or if option isn't * valid (generates also a E_WARNING). * Else the option's value is returned. */ #[Pure] -function xml_parser_get_option(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, int $option): string|int {} +#[LanguageLevelTypeAware(["8.3" => "string|int|bool"], default: "string|int")] +function xml_parser_get_option(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, int $option) {} define('XML_ERROR_NONE', 0); define('XML_ERROR_NO_MEMORY', 1); From 026ffd05f5a6c848e7481e21c5d62cc4adcd63ac Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Aug 2023 10:47:10 +0200 Subject: [PATCH 374/419] [phpstorm-stubs] update for PHP 8.3. Remove redundant return types --- imap/imap.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imap/imap.php b/imap/imap.php index 9a64c233e..3425aac10 100644 --- a/imap/imap.php +++ b/imap/imap.php @@ -86,7 +86,6 @@ function imap_reopen( * deletion. You can achieve the same thing by using * imap_expunge *

    - * @return bool|true TRUE on success or FALSE on failure. Since PHP 8.3 always true */ #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] function imap_close(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, int $flags = 0) {} @@ -522,7 +521,7 @@ function imap_expunge(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], def *

    */ #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] -function imap_delete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $message_nums, int $flags = 0): bool {} +function imap_delete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $message_nums, int $flags = 0) {} /** * Unmark the message which is marked deleted @@ -534,7 +533,7 @@ function imap_delete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], defa * @param int $flags [optional] */ #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] -function imap_undelete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $message_nums, int $flags = 0): bool {} +function imap_undelete(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $message_nums, int $flags = 0) {} /** * Check current mailbox From 9a699ed47e71a8a60df76af450644e86c9b2d364 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Aug 2023 10:48:13 +0200 Subject: [PATCH 375/419] [phpstorm-stubs] update for PHP 8.3. imagegd2 fix default value --- gd/gd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gd/gd.php b/gd/gd.php index a35700fdb..a17deb3f5 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1121,7 +1121,7 @@ function imagegd(GdImage $image, ?string $file = null): bool {} *

    * @return bool true on success or false on failure. */ -function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = 128, int $mode = 1): bool {} +function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): bool {} /** * Destroy an image From 2d45cc5639302d6a2973c8dbcde1c1bc377f15c7 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Aug 2023 14:13:40 +0200 Subject: [PATCH 376/419] [phpstorm-stubs] update for PHP 8.3. imap fix return type --- imap/imap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imap/imap.php b/imap/imap.php index 3425aac10..8458a9ed8 100644 --- a/imap/imap.php +++ b/imap/imap.php @@ -888,7 +888,7 @@ function imap_mailboxmsginfo(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection * instead of sequence numbers

    */ #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] -function imap_setflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $sequence, string $flag, int $options = NIL): bool {} +function imap_setflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $sequence, string $flag, int $options = NIL) {} /** * Clears flags on messages @@ -910,7 +910,7 @@ function imap_setflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'] * instead of sequence numbers

    */ #[LanguageLevelTypeAware(['8.3' => 'true'], default: 'bool')] -function imap_clearflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $sequence, string $flag, int $options = 0): bool {} +function imap_clearflag_full(#[LanguageLevelTypeAware(['8.1' => 'IMAP\Connection'], default: 'resource')] $imap, string $sequence, string $flag, int $options = 0) {} /** * Gets and sort messages From d3ad02251af58c9a31ebe0c2dd454c81aac113a0 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Aug 2023 19:43:18 +0200 Subject: [PATCH 377/419] [phpstorm-stubs] add deprecated version for assert_options --- standard/standard_9.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/standard/standard_9.php b/standard/standard_9.php index e500a6ffc..cf0d340de 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -4,6 +4,7 @@ * @since 5.6 */ +use JetBrains\PhpStorm\Deprecated; use JetBrains\PhpStorm\ExpectedValues; use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware; use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable; @@ -948,8 +949,8 @@ class AssertionError extends Error {} * An optional new value for the option. *

    * @return mixed The original setting of any option. - * @deprecated */ +#[Deprecated(since: "8.3")] function assert_options(int $option, mixed $value): mixed {} /** From beac237645ee7cf631f4386d21cffb016c8cde87 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 28 Aug 2023 20:05:50 +0200 Subject: [PATCH 378/419] [phpstorm-stubs] remove redundant typehints and PHPDocs --- dom/dom_c.php | 25 +++---------------------- standard/standard_8.php | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/dom/dom_c.php b/dom/dom_c.php index 099399e40..fbe497b58 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -318,35 +318,16 @@ public function lookupNamespaceURI(?string $prefix): ?string {} public function lookupNamespaceUri($prefix) {} /** - * @param DOMNode $arg + * @param DOMNode|null $arg * @return bool - * @removed 8.0 */ - public function isEqualNode(DOMNode $arg) {} + #[LanguageLevelTypeAware(['8.3' => 'bool'], default: '')] + public function isEqualNode(#[LanguageLevelTypeAware(['8.3' => 'DOMNode|null'], default: 'DOMNode')] $otherNode) {} - /** - * @since 8.3 - */ - public function isEqualNode(?DOMNode $otherNode): bool {} - - /** - * @param $feature - * @param $version - * @return mixed - */ public function getFeature($feature, $version) {} - /** - * @param $key - * @param $data - * @param $handler - */ public function setUserData($key, $data, $handler) {} - /** - * @param $key - * @return mixed - */ public function getUserData($key) {} /** diff --git a/standard/standard_8.php b/standard/standard_8.php index 643f60961..a24464d97 100644 --- a/standard/standard_8.php +++ b/standard/standard_8.php @@ -61,14 +61,14 @@ *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function syslog(int $priority, string $message): bool {} +function syslog(int $priority, string $message) {} /** * Close connection to system logger * @link https://php.net/manual/en/function.closelog.php */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function closelog(): bool {} +function closelog() {} /** * Registers a function that will be called when PHP starts sending output. @@ -395,7 +395,7 @@ function ob_list_handlers(): array {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function ksort(array &$array, int $flags = SORT_REGULAR): bool {} +function ksort(array &$array, int $flags = SORT_REGULAR) {} /** * Sort an array by key in reverse order @@ -410,7 +410,7 @@ function ksort(array &$array, int $flags = SORT_REGULAR): bool {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function krsort(array &$array, int $flags = SORT_REGULAR): bool {} +function krsort(array &$array, int $flags = SORT_REGULAR) {} /** * Sort an array using a "natural order" algorithm @@ -460,7 +460,7 @@ function asort(array &$array, int $flags = SORT_REGULAR) {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function arsort(array &$array, int $flags = SORT_REGULAR): bool {} +function arsort(array &$array, int $flags = SORT_REGULAR) {} /** * Sort an array @@ -478,7 +478,7 @@ function arsort(array &$array, int $flags = SORT_REGULAR): bool {} * (don't change types)

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function sort(array &$array, int $flags = SORT_REGULAR): bool {} +function sort(array &$array, int $flags = SORT_REGULAR) {} /** * Sort an array in reverse order @@ -508,7 +508,7 @@ function rsort(array &$array, int $flags = SORT_REGULAR) {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function usort(array &$array, callable $callback): bool {} +function usort(array &$array, callable $callback) {} /** * Sort an array with a user-defined comparison function and maintain index association @@ -522,7 +522,7 @@ function usort(array &$array, callable $callback): bool {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function uasort(array &$array, callable $callback): bool {} +function uasort(array &$array, callable $callback) {} /** * Sort an array by keys using a user-defined comparison function @@ -543,7 +543,7 @@ function uasort(array &$array, callable $callback): bool {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function uksort(array &$array, callable $callback): bool {} +function uksort(array &$array, callable $callback) {} /** * Shuffle an array @@ -553,7 +553,7 @@ function uksort(array &$array, callable $callback): bool {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function shuffle(array &$array): bool {} +function shuffle(array &$array) {} /** * Apply a user function to every member of an array @@ -587,7 +587,7 @@ function shuffle(array &$array): bool {} *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function array_walk(object|array &$array, callable $callback, mixed $arg): bool {} +function array_walk(object|array &$array, callable $callback, mixed $arg) {} /** * Apply a user function recursively to every member of an array @@ -615,7 +615,7 @@ function array_walk(object|array &$array, callable $callback, mixed $arg): bool *

    */ #[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')] -function array_walk_recursive(object|array &$array, callable $callback, mixed $arg): bool {} +function array_walk_recursive(object|array &$array, callable $callback, mixed $arg) {} /** * Counts all elements in an array, or something in an object. From d0fd8b58da2b441a273518348a9cf5114cd77517 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Tue, 29 Aug 2023 13:40:26 +0200 Subject: [PATCH 379/419] [phpstorm-stubs] Updated parameters for some functions in gd.php, odbc.php and xdebug.php. --- gd/gd.php | 20 +++++++-------- odbc/odbc.php | 62 ++++++++++++++++++++++++++++------------------- xdebug/xdebug.php | 2 +- 3 files changed, 48 insertions(+), 36 deletions(-) diff --git a/gd/gd.php b/gd/gd.php index a17deb3f5..81cfc892e 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1038,7 +1038,7 @@ function imagepng(GdImage $image, $file = null, int $quality = -1, int $filters * @return bool true on success or false on failure. * @since 5.4 */ -function imagewebp($image, $to = null, $quality = 80): bool {} +function imagewebp($image, $to = null, $quality = -1): bool {} /** * Output image to browser or file @@ -1071,7 +1071,7 @@ function imagegif(GdImage $image, $file = null): bool {} *

    * @return bool true on success or false on failure. */ -function imagejpeg($image, $file = null, $quality = null): bool {} +function imagejpeg($image, $file = null, $quality = -1): bool {} /** * Output image to browser or file @@ -1121,7 +1121,7 @@ function imagegd(GdImage $image, ?string $file = null): bool {} *

    * @return bool true on success or false on failure. */ -function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): bool {} +function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = null, int $mode = null): bool {} /** * Destroy an image @@ -1618,7 +1618,7 @@ function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int * corner seeing the text horizontally. */ #[Pure] -function imagettfbbox($size, $angle, $font_filename, $text) {} +function imagettfbbox($size, $angle, $font_filename, $text, array $options = []) {} /** * Write text to the image using TrueType fonts @@ -1729,10 +1729,10 @@ function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, * search for files that do not begin with a leading '/' by appending * '.ttf' to the filename and searching along a library-defined font path. *

    - * @param string $text

    + * @param string $string

    * The string to be measured. *

    - * @param array $extrainfo [optional]

    + * @param array $options [optional]

    * * Possible array indexes for extrainfo * @@ -1790,7 +1790,7 @@ function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, * Returns false on error. */ #[Pure] -function imageftbbox($size, $angle, $font_filename, $text, $extrainfo = null) {} +function imageftbbox($size, $angle, $font_filename, $string, $options = []) {} /** * Write text to the image using fonts using FreeType 2 @@ -1855,10 +1855,10 @@ function imageftbbox($size, $angle, $font_filename, $text, $extrainfo = null) {} * Note: * open_basedir does not apply to font_filename. *

    - * @param string $text

    + * @param string $string

    * Text to be inserted into image. *

    - * @param array $extrainfo [optional]

    + * @param array $options [optional]

    *

    * Possible array indexes for extrainfo * @@ -1908,7 +1908,7 @@ function imageftbbox($size, $angle, $font_filename, $text, $extrainfo = null) {} * * Returns false on error. */ -function imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $text, $extrainfo = null) {} +function imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $string, $options = []) {} /** * Load a PostScript Type 1 font from file diff --git a/odbc/odbc.php b/odbc/odbc.php index 85af5b678..ad8e6ba61 100644 --- a/odbc/odbc.php +++ b/odbc/odbc.php @@ -124,7 +124,7 @@ function odbc_commit($connection_id) {} * @param string $password

    * The password. *

    - * @param int $cursor_type [optional]

    + * @param int $cursor_option [optional]

    * This sets the type of cursor to be used * for this connection. This parameter is not normally needed, but * can be useful for working around problems with some ODBC drivers. @@ -135,7 +135,7 @@ function odbc_commit($connection_id) {} *

    * @return resource|false an ODBC connection or (FALSE) on error. */ -function odbc_connect($dsn, $user, $password, $cursor_type = null) {} +function odbc_connect($dsn, $user, $password, $cursor_option = SQL_CUR_USE_DRIVER) {} /** * Get cursorname @@ -166,10 +166,10 @@ function odbc_data_source($connection_id, $fetch_type) {} /** * Execute a prepared statement * @link https://php.net/manual/en/function.odbc-execute.php - * @param resource $result_id

    + * @param resource $statement

    * The result id resource, from odbc_prepare. *

    - * @param array $parameters_array [optional]

    + * @param array $params [optional]

    * Parameters in parameter_array will be * substituted for placeholders in the prepared statement in order. * Elements of this array will be converted to strings by calling this @@ -189,7 +189,7 @@ function odbc_data_source($connection_id, $fetch_type) {} * executing the query directly with odbc_exec). * @return bool TRUE on success or FALSE on failure. */ -function odbc_execute($result_id, array $parameters_array = null) {} +function odbc_execute($statement, array $params = []) {} /** * Get the last error code @@ -240,30 +240,30 @@ function odbc_exec($connection_id, $query_string, #[PhpStormStubsElementAvailabl /** * Fetch a result row as an associative array * @link https://php.net/manual/en/function.odbc-fetch-array.php - * @param resource $result

    + * @param resource $statement

    * The result resource from odbc_exec. *

    - * @param int $rownumber [optional]

    + * @param int $row [optional]

    * Optionally choose which row number to retrieve. *

    * @return array|false an array that corresponds to the fetched row, or FALSE if there * are no more rows. */ -function odbc_fetch_array($result, $rownumber = null) {} +function odbc_fetch_array($statement, $row = -1) {} /** * Fetch a result row as an object * @link https://php.net/manual/en/function.odbc-fetch-object.php - * @param resource $result

    + * @param resource $statement

    * The result resource from odbc_exec. *

    - * @param int $rownumber [optional]

    + * @param int $row [optional]

    * Optionally choose which row number to retrieve. *

    * @return object|false an object that corresponds to the fetched row, or FALSE if there * are no more rows. */ -function odbc_fetch_object($result, $rownumber = null) {} +function odbc_fetch_object($statement, $row = -1) {} /** * Fetch a row @@ -293,22 +293,22 @@ function odbc_fetch_row($result_id, $row_number = null) {} /** * Fetch one result row into array * @link https://php.net/manual/en/function.odbc-fetch-into.php - * @param resource $result_id

    + * @param resource $statement

    * The result resource. *

    - * @param array &$result_array

    + * @param array &$array

    * The result array * that can be of any type since it will be converted to type * array. The array will contain the column values starting at array * index 0. *

    - * @param int $rownumber [optional]

    + * @param int $row [optional]

    * The row number. *

    * @return int the number of columns in the result; * FALSE on error. */ -function odbc_fetch_into($result_id, array &$result_array, $rownumber = null) {} +function odbc_fetch_into($statement, array &$array, $row = 0) {} /** * Get the length (precision) of a field @@ -389,7 +389,7 @@ function odbc_free_result($result_id) {} /** * Retrieves information about data types supported by the data source * @link https://php.net/manual/en/function.odbc-gettypeinfo.php - * @param resource $connection_id

    The ODBC connection identifier, + * @param resource $odbc

    The ODBC connection identifier, * see odbc_connect for details.

    * @param int $data_type [optional]

    * The data type, which can be used to restrict the information to a @@ -419,7 +419,7 @@ function odbc_free_result($result_id) {} * The result set is ordered by DATA_TYPE and TYPE_NAME. *

    */ -function odbc_gettypeinfo($connection_id, $data_type = null) {} +function odbc_gettypeinfo($odbc, $data_type = 0) {} /** * Handling of LONG columns @@ -473,11 +473,11 @@ function odbc_num_rows($result_id) {} * @param string $dsn * @param string $user * @param string $password - * @param int $cursor_type [optional] + * @param int $cursor_option [optional] * @return resource|false an ODBC connection id or 0 (FALSE) on * error. */ -function odbc_pconnect($dsn, $user, $password, $cursor_type = null) {} +function odbc_pconnect($dsn, $user, $password, $cursor_option = SQL_CUR_USE_DRIVER) {} /** * Prepares a statement for execution @@ -511,7 +511,7 @@ function odbc_result($result_id, $field) {} /** * Print result as HTML table * @link https://php.net/manual/en/function.odbc-result-all.php - * @param resource $result_id

    + * @param resource $statement

    * The result identifier. *

    * @param string $format [optional]

    @@ -520,7 +520,7 @@ function odbc_result($result_id, $field) {} * @return int|false the number of rows in the result or FALSE on error. * @deprecated 8.1 */ -function odbc_result_all($result_id, $format = null) {} +function odbc_result_all($statement, $format = '') {} /** * Rollback a transaction @@ -827,8 +827,13 @@ function odbc_foreignkeys($connection_id, $pk_qualifier, $pk_owner, $pk_table, $ /** * Get the list of procedures stored in a specific data source * @link https://php.net/manual/en/function.odbc-procedures.php - * @param resource $connection_id

    The ODBC connection identifier, + * @param resource $odbc

    The ODBC connection identifier, * see odbc_connect for details.

    + * @param string|null $catalog

    The catalog ('qualifier' in ODBC 2 parlance).

    + * @param string|null $schema

    The schema ('owner' in ODBC 2 parlance). This parameter accepts the + * following search patterns: % to match zero or more characters, and _ to match a single character.

    + * @param string|null $procedure

    The proc. This parameter accepts the following search patterns: + * % to match zero or more characters, and _ to match a single character.

    * @return resource|false

    an ODBC * result identifier containing the information or FALSE on failure. *

    @@ -844,13 +849,20 @@ function odbc_foreignkeys($connection_id, $pk_qualifier, $pk_owner, $pk_table, $ * PROCEDURE_TYPE *

    */ -function odbc_procedures($connection_id) {} +function odbc_procedures($odbc, $catalog = null, $schema = null, $procedure = null) {} /** * Retrieve information about parameters to procedures * @link https://php.net/manual/en/function.odbc-procedurecolumns.php - * @param resource $connection_id

    The ODBC connection identifier, + * @param resource $odbc

    The ODBC connection identifier, * see odbc_connect for details.

    + * @param string|null $catalog

    The catalog ('qualifier' in ODBC 2 parlance).

    + * @param string|null $schema

    The schema ('owner' in ODBC 2 parlance). This parameter accepts the + * following search patterns: % to match zero or more characters, and _ to match a single character.

    + * @param string|null $procedure

    The proc. This parameter accepts the following search patterns: + * % to match zero or more characters, and _ to match a single character.

    + * @param string|null $column

    The column. This parameter accepts the following search patterns: + * % to match zero or more characters, and _ to match a single character.

    * @return resource|false

    the list of input and output parameters, as well as the * columns that make up the result set for the specified procedures. * Returns an ODBC result identifier or FALSE on failure. @@ -872,7 +884,7 @@ function odbc_procedures($connection_id) {} * REMARKS *

    */ -function odbc_procedurecolumns($connection_id) {} +function odbc_procedurecolumns($odbc, $catalog = null, $schema = null, $procedure = null, $column = null) {} /** * Alias of odbc_exec diff --git a/xdebug/xdebug.php b/xdebug/xdebug.php index e4e68a8ad..c4e4b55db 100644 --- a/xdebug/xdebug.php +++ b/xdebug/xdebug.php @@ -3,7 +3,7 @@ /** * Show diagnostic information */ -function xdebug_info(string $category = '') {} +function xdebug_info(string $category = 'null') {} /** * Returns an array of ALL valid ini options with values and is not the same as ini_get_all() which returns only From dbc54fa39ea16aea51b968f80d806365d69df561 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 30 Aug 2023 13:27:04 +0200 Subject: [PATCH 380/419] [phpstorm-stubs] Updated dockerfiles to make gd extension work. --- tests/DockerImages/5.6/Dockerfile | 4 +++- tests/DockerImages/7.0/Dockerfile | 4 +++- tests/DockerImages/7.1/Dockerfile | 4 +++- tests/DockerImages/7.2/Dockerfile | 4 +++- tests/DockerImages/7.3/Dockerfile | 4 +++- tests/DockerImages/7.4/Dockerfile | 4 +++- tests/DockerImages/8.0/Dockerfile | 4 +++- tests/DockerImages/8.1/Dockerfile | 4 +++- tests/DockerImages/8.2/Dockerfile | 4 +++- tests/DockerImages/8.3/Dockerfile | 4 +++- 10 files changed, 30 insertions(+), 10 deletions(-) diff --git a/tests/DockerImages/5.6/Dockerfile b/tests/DockerImages/5.6/Dockerfile index 5592f32d0..13508fded 100644 --- a/tests/DockerImages/5.6/Dockerfile +++ b/tests/DockerImages/5.6/Dockerfile @@ -4,7 +4,9 @@ RUN set -eux; \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c librrd libzip-dev rrdtool-dev \ - gmp-dev yaml yaml-dev fann fann-dev + gmp-dev yaml yaml-dev fann fann-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr RUN docker-php-ext-install imap gmp sockets intl bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap diff --git a/tests/DockerImages/7.0/Dockerfile b/tests/DockerImages/7.0/Dockerfile index a87b4db5b..c64e62f07 100644 --- a/tests/DockerImages/7.0/Dockerfile +++ b/tests/DockerImages/7.0/Dockerfile @@ -5,7 +5,9 @@ RUN set -eux; \ bash gcc g++ make autoconf pkgconfig git \ libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c librrd libzip-dev rrdtool-dev \ - gmp-dev yaml yaml-dev fann fann-dev aspell-dev + gmp-dev yaml yaml-dev fann fann-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr RUN docker-php-ext-install imap gmp sockets intl bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell diff --git a/tests/DockerImages/7.1/Dockerfile b/tests/DockerImages/7.1/Dockerfile index da6e1de44..c83a52753 100644 --- a/tests/DockerImages/7.1/Dockerfile +++ b/tests/DockerImages/7.1/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev aspell-dev + libpng-dev gpgme gpgme-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell diff --git a/tests/DockerImages/7.2/Dockerfile b/tests/DockerImages/7.2/Dockerfile index 1d4611948..59925d362 100644 --- a/tests/DockerImages/7.2/Dockerfile +++ b/tests/DockerImages/7.2/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev php7-imap php7-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev aspell-dev + libpng-dev gpgme gpgme-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pspell diff --git a/tests/DockerImages/7.3/Dockerfile b/tests/DockerImages/7.3/Dockerfile index 307861dcf..0bdc1fa1d 100644 --- a/tests/DockerImages/7.3/Dockerfile +++ b/tests/DockerImages/7.3/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev php7-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php7-dev php7-gd icu-dev \ php7-zip php7-tidy php7-intl libffi-dev openssl-dev php7-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-webp-dir=/usr --with-jpeg-dir=/usr RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell diff --git a/tests/DockerImages/7.4/Dockerfile b/tests/DockerImages/7.4/Dockerfile index d99adbfd3..22f747e60 100644 --- a/tests/DockerImages/7.4/Dockerfile +++ b/tests/DockerImages/7.4/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev icu-dev \ libffi-dev openssl-dev rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell diff --git a/tests/DockerImages/8.0/Dockerfile b/tests/DockerImages/8.0/Dockerfile index 709315711..30d3f3f02 100644 --- a/tests/DockerImages/8.0/Dockerfile +++ b/tests/DockerImages/8.0/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev php8-imap enchant2 php8-enchant bzip2-dev gettext-dev libxml2-dev php8-dev php8-gd icu-dev \ php8-zip php8-tidy php8-intl libffi-dev openssl-dev php8-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell diff --git a/tests/DockerImages/8.1/Dockerfile b/tests/DockerImages/8.1/Dockerfile index d6b728277..c4223ee08 100644 --- a/tests/DockerImages/8.1/Dockerfile +++ b/tests/DockerImages/8.1/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev php-imap enchant2 php-enchant bzip2-dev gettext-dev libxml2-dev php81-dev php-gd icu-dev \ php-zip php-tidy php-intl libffi-dev openssl-dev php81-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell diff --git a/tests/DockerImages/8.2/Dockerfile b/tests/DockerImages/8.2/Dockerfile index 9d60d7554..010d6c073 100644 --- a/tests/DockerImages/8.2/Dockerfile +++ b/tests/DockerImages/8.2/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev php-imap enchant2 php-enchant bzip2-dev gettext-dev libxml2-dev php82-dev php-gd icu-dev \ php-zip php-tidy php-intl libffi-dev openssl-dev php82-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell diff --git a/tests/DockerImages/8.3/Dockerfile b/tests/DockerImages/8.3/Dockerfile index 766eb15a0..4759154c1 100644 --- a/tests/DockerImages/8.3/Dockerfile +++ b/tests/DockerImages/8.3/Dockerfile @@ -6,7 +6,9 @@ RUN set -eux; \ libmcrypt-dev imap-dev php-imap enchant2 php-enchant bzip2-dev gettext-dev libxml2-dev php82-dev php-gd icu-dev \ php-zip php-tidy php-intl libffi-dev openssl-dev php82-pear rabbitmq-c rabbitmq-c-dev librrd \ libzip-dev rrdtool-dev gmp-dev yaml yaml-dev fann fann-dev openldap-dev librdkafka librdkafka-dev libcurl curl-dev \ - libpng-dev gpgme gpgme-dev libpq-dev aspell-dev + libpng-dev gpgme gpgme-dev libpq-dev aspell-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev + +RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype RUN docker-php-ext-install imap gmp sockets intl gd ldap bz2 mysqli bcmath calendar dba exif gettext opcache pcntl \ pdo_mysql shmop sysvmsg sysvsem sysvshm xml soap pgsql pspell From cbdf0aa301e1507081b86f610dd7445867db3d30 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 30 Aug 2023 15:14:32 +0200 Subject: [PATCH 381/419] [phpstorm-stubs] Attempt to fix methods signature according to tests failures. --- gd/gd.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/gd/gd.php b/gd/gd.php index 81cfc892e..b2761404b 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1028,9 +1028,9 @@ function imagepng(GdImage $image, $file = null, int $quality = -1, int $filters * Output a WebP image to browser or file * @link https://php.net/manual/en/function.imagewebp.php * @param resource|GdImage $image - * @param string $to [optional]

    - * The path to save the file to. If not set or null, the raw image stream - * will be outputted directly. + * @param resource|string|null $file [optional]

    + * The path or an open stream resource (which is automatically closed after this function returns) + * to save the file to. If not set or null, the raw image stream will be output directly. *

    * @param int $quality [optional]

    * quality ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). @@ -1038,7 +1038,7 @@ function imagepng(GdImage $image, $file = null, int $quality = -1, int $filters * @return bool true on success or false on failure. * @since 5.4 */ -function imagewebp($image, $to = null, $quality = -1): bool {} +function imagewebp(GdImage $image, $file = null, int $quality = -1): bool {} /** * Output image to browser or file @@ -1071,7 +1071,7 @@ function imagegif(GdImage $image, $file = null): bool {} *

    * @return bool true on success or false on failure. */ -function imagejpeg($image, $file = null, $quality = -1): bool {} +function imagejpeg(GdImage $image, $file = null, int $quality = -1): bool {} /** * Output image to browser or file @@ -1569,9 +1569,10 @@ function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int * search for files that do not begin with a leading '/' by appending * '.ttf' to the filename and searching along a library-defined font path. *

    - * @param string $text

    + * @param string $string

    * The string to be measured. *

    + * @param array $options [optional] * @return array|false imagettfbbox returns an array with 8 * elements representing four points making the bounding box of the * text on success and false on error. @@ -1618,7 +1619,7 @@ function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int * corner seeing the text horizontally. */ #[Pure] -function imagettfbbox($size, $angle, $font_filename, $text, array $options = []) {} +function imagettfbbox(float $size, float $angle, string $font_filename, string $string, #[PhpStormStubsElementAvailable(from: '8.0')] $options = []): array|false {} /** * Write text to the image using TrueType fonts @@ -1703,6 +1704,7 @@ function imagettfbbox($size, $angle, $font_filename, $text, array $options = []) * If a character is used in the string which is not supported by the * font, a hollow rectangle will replace the character. *

    + * @param array $options [optional] * @return array|false an array with 8 elements representing four points making the * bounding box of the text. The order of the points is lower left, lower * right, upper right, upper left. The points are relative to the text @@ -1710,7 +1712,7 @@ function imagettfbbox($size, $angle, $font_filename, $text, array $options = []) * corner when you see the text horizontally. * Returns false on error. */ -function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {} +function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, #[PhpStormStubsElementAvailable(from: '8.0')] array $options = []): array|false {} /** * Give the bounding box of a text using fonts via freetype2 @@ -1790,7 +1792,7 @@ function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, * Returns false on error. */ #[Pure] -function imageftbbox($size, $angle, $font_filename, $string, $options = []) {} +function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {} /** * Write text to the image using fonts using FreeType 2 @@ -1855,7 +1857,7 @@ function imageftbbox($size, $angle, $font_filename, $string, $options = []) {} * Note: * open_basedir does not apply to font_filename. *

    - * @param string $string

    + * @param string $text

    * Text to be inserted into image. *

    * @param array $options [optional]

    @@ -1908,7 +1910,7 @@ function imageftbbox($size, $angle, $font_filename, $string, $options = []) {} * * Returns false on error. */ -function imagefttext($image, $size, $angle, $x, $y, $color, $font_filename, $string, $options = []) {} +function imagefttext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {} /** * Load a PostScript Type 1 font from file From 788fdbd7f5e154d0958177c7f66336ae335be084 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 30 Aug 2023 16:46:42 +0200 Subject: [PATCH 382/419] [phpstorm-stubs] Last fix for typehint for imagettfbbox(). --- gd/gd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gd/gd.php b/gd/gd.php index b2761404b..f3edfff20 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1619,7 +1619,7 @@ function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int * corner seeing the text horizontally. */ #[Pure] -function imagettfbbox(float $size, float $angle, string $font_filename, string $string, #[PhpStormStubsElementAvailable(from: '8.0')] $options = []): array|false {} +function imagettfbbox(float $size, float $angle, string $font_filename, string $string, #[PhpStormStubsElementAvailable(from: '8.0')] array $options = []): array|false {} /** * Write text to the image using TrueType fonts From b0379181588d359718118c96167ada85cd8a2996 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 30 Aug 2023 17:08:16 +0200 Subject: [PATCH 383/419] [phpstorm-stubs] Added default values for parameters in imagegd2(). --- gd/gd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gd/gd.php b/gd/gd.php index f3edfff20..43068286e 100644 --- a/gd/gd.php +++ b/gd/gd.php @@ -1121,7 +1121,7 @@ function imagegd(GdImage $image, ?string $file = null): bool {} *

    * @return bool true on success or false on failure. */ -function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = null, int $mode = null): bool {} +function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = 128, int $mode = IMG_GD2_RAW): bool {} /** * Destroy an image From b54361f8aeb92289d52152beb64b6efbaff9f284 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Mon, 4 Sep 2023 16:05:10 +0200 Subject: [PATCH 384/419] [phpstorm-stubs] WI-73720 added meta key for $flag param in json_validate(). --- meta/.phpstorm.meta.php | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 63a56fe32..3180e0a99 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -549,6 +549,7 @@ function argumentsSet($setName) { expectedArguments(\json_encode(), 1, JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_FORCE_OBJECT | JSON_PRESERVE_ZERO_FRACTION | JSON_UNESCAPED_UNICODE | JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_UNESCAPED_LINE_TERMINATORS | JSON_THROW_ON_ERROR); expectedArguments(\json_decode(), 3, JSON_BIGINT_AS_STRING | JSON_OBJECT_AS_ARRAY | JSON_THROW_ON_ERROR); + expectedArguments(\json_validate(), 2, JSON_INVALID_UTF8_IGNORE); expectedArguments(\idn_to_ascii(), 1, IDNA_ALLOW_UNASSIGNED | IDNA_CHECK_BIDI | IDNA_CHECK_CONTEXTJ | IDNA_DEFAULT | IDNA_NONTRANSITIONAL_TO_ASCII | IDNA_NONTRANSITIONAL_TO_UNICODE | IDNA_USE_STD3_RULES); expectedArguments(\idn_to_ascii(), 2, INTL_IDNA_VARIANT_UTS46, INTL_IDNA_VARIANT_2003); From 60ce5a809469bc93f912961466cfa9fb6764803d Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 7 Sep 2023 08:37:58 +0200 Subject: [PATCH 385/419] [phpstorm-stubs] update 8.3 image to RC 1 --- tests/DockerImages/8.3/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DockerImages/8.3/Dockerfile b/tests/DockerImages/8.3/Dockerfile index 4759154c1..648f1f1d8 100644 --- a/tests/DockerImages/8.3/Dockerfile +++ b/tests/DockerImages/8.3/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.0beta3-alpine +FROM php:8.3.0RC1-alpine RUN set -eux; \ apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community --no-cache --virtual .build-deps \ From f4839a44ca1292a163f7fae067cffc0447360cad Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 7 Sep 2023 08:42:15 +0200 Subject: [PATCH 386/419] [phpstorm-stubs] update test_runner image to 8.3 RC 1 --- tests/DockerImages/testRunner/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DockerImages/testRunner/Dockerfile b/tests/DockerImages/testRunner/Dockerfile index 244e1897c..9c724b1e4 100644 --- a/tests/DockerImages/testRunner/Dockerfile +++ b/tests/DockerImages/testRunner/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.0beta3-apache +FROM php:8.3.0RC1-apache RUN echo 'memory_limit = 1024M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini COPY --from=composer /usr/bin/composer /usr/bin/composer From 9f2e130553d125e84dc5c5acef0d43c132ecffb4 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 7 Sep 2023 08:46:31 +0200 Subject: [PATCH 387/419] [phpstorm-stubs] use composer install instead of composer update and install versions according to composer.lock --- .github/workflows/main.yml | 2 +- .gitignore | 1 - composer.lock | 4035 ++++++++++++++++++++++++++++++++++++ 3 files changed, 4036 insertions(+), 2 deletions(-) create mode 100644 composer.lock diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 473dddb81..605eca11f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: PHP_VERSION: ${{matrix.php}} - name: Composer Install - run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer update + run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer install env: PHP_VERSION: ${{matrix.php}} diff --git a/.gitignore b/.gitignore index bc8b7a41d..d55334171 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ phpunit.xml # Composer vendor -composer.lock .php_cs.cache .phpunit.result.cache diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..7d97231b3 --- /dev/null +++ b/composer.lock @@ -0,0 +1,4035 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "ec72442e7a7b8890b4a3053a66ea2692", + "packages": [], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-11-17T09:50:14+00:00" + }, + { + "name": "composer/semver", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-04-01T19:23:25+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "doctrine/annotations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2 || ^3", + "ext-tokenizer": "*", + "php": "^7.2 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^2.0", + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^5.4 || ^6", + "vimeo/psalm": "^4.10" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/2.0.1" + }, + "time": "2023-02-02T22:02:53+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" + }, + "time": "2023-06-03T09:27:29+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:23:10+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "84a527db05647743d50373e0ec53a152f2cde568" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", + "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^9.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-12-15T16:57:16+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.17.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "3f0ed862f22386c55a767461ef5083bddceeed79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3f0ed862f22386c55a767461ef5083bddceeed79", + "reference": "3f0ed862f22386c55a767461ef5083bddceeed79", + "shasum": "" + }, + "require": { + "composer/semver": "^3.3", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^2", + "doctrine/lexer": "^2 || ^3", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.27", + "symfony/polyfill-php80": "^1.27", + "symfony/polyfill-php81": "^1.27", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.0", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.5.3", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.16", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", + "symfony/phpunit-bridge": "^6.2.3", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.17.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-05-22T19:59:32+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.15.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" + }, + "time": "2023-05-19T20:20:00+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2" + }, + "time": "2023-05-30T18:13:47+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.22.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0" + }, + "time": "2023-06-01T12:35:21+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.26", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.15", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-03-06T12:58:08+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "a9aceaf20a682aeacf28d582654a1670d8826778" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a9aceaf20a682aeacf28d582654a1670d8826778", + "reference": "a9aceaf20a682aeacf28d582654a1670d8826778", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.9" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2023-06-11T06:13:56+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-05-07T05:35:17+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T06:03:37+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-14T08:28:10+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/console", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-29T12:49:39+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", + "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-21T14:41:17+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "97b698e1d77d356304def77a8d0cd73090b359ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/97b698e1d77d356304def77a8d0cd73090b359ea", + "reference": "97b698e1d77d356304def77a8d0cd73090b359ea", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-30T17:12:32+00:00" + }, + { + "name": "symfony/finder", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2", + "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-02T01:25:41+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-12T14:21:09+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/process", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/8741e3ed7fe2e91ec099e02446fb86667a0f1628", + "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-19T08:06:44+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-02-16T10:14:28+00:00" + }, + { + "name": "symfony/string", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-03-21T21:06:29+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "nikic/php-parser": 0, + "phpdocumentor/reflection-docblock": 0, + "friendsofphp/php-cs-fixer": 0 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": { + "php": "^8.0" + }, + "plugin-api-version": "2.3.0" +} From f0db768c518e605e54506aac2fdffcd55667e3ee Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 7 Sep 2023 12:16:08 +0200 Subject: [PATCH 388/419] [phpstorm-stubs] update constants according to 8.3 RC 1 --- tokenizer/tokenizer.php | 292 ++++++++++++++++++++-------------------- 1 file changed, 146 insertions(+), 146 deletions(-) diff --git a/tokenizer/tokenizer.php b/tokenizer/tokenizer.php index b67d2c50f..977422615 100644 --- a/tokenizer/tokenizer.php +++ b/tokenizer/tokenizer.php @@ -43,190 +43,190 @@ function token_get_all(string $code, #[PhpStormStubsElementAvailable(from: '7.0' function token_name(int $id): string {} define('TOKEN_PARSE', 1); -define('T_REQUIRE_ONCE', 276); -define('T_REQUIRE', 275); -define('T_EVAL', 274); -define('T_INCLUDE_ONCE', 273); -define('T_INCLUDE', 272); -define('T_LOGICAL_OR', 277); -define('T_LOGICAL_XOR', 278); -define('T_LOGICAL_AND', 279); -define('T_PRINT', 280); -define('T_YIELD', 281); -define('T_DOUBLE_ARROW', 386); -define('T_YIELD_FROM', 282); -define('T_POW_EQUAL', 402); -define('T_SR_EQUAL', 362); -define('T_SL_EQUAL', 361); -define('T_XOR_EQUAL', 360); -define('T_OR_EQUAL', 359); -define('T_AND_EQUAL', 358); -define('T_MOD_EQUAL', 357); -define('T_CONCAT_EQUAL', 356); -define('T_DIV_EQUAL', 355); -define('T_MUL_EQUAL', 354); -define('T_MINUS_EQUAL', 353); -define('T_PLUS_EQUAL', 352); +define('T_REQUIRE_ONCE', 263); +define('T_REQUIRE', 262); +define('T_EVAL', 323); +define('T_INCLUDE_ONCE', 261); +define('T_INCLUDE', 260); +define('T_LOGICAL_OR', 264); +define('T_LOGICAL_XOR', 265); +define('T_LOGICAL_AND', 266); +define('T_PRINT', 267); +define('T_YIELD', 268); +define('T_DOUBLE_ARROW', 269); +define('T_YIELD_FROM', 270); +define('T_POW_EQUAL', 282); +define('T_SR_EQUAL', 281); +define('T_SL_EQUAL', 280); +define('T_XOR_EQUAL', 279); +define('T_OR_EQUAL', 278); +define('T_AND_EQUAL', 277); +define('T_MOD_EQUAL', 276); +define('T_CONCAT_EQUAL', 275); +define('T_DIV_EQUAL', 274); +define('T_MUL_EQUAL', 273); +define('T_MINUS_EQUAL', 272); +define('T_PLUS_EQUAL', 271); /** * @since 7.4 */ -define('T_COALESCE_EQUAL', 363); -define('T_COALESCE', 400); -define('T_BOOLEAN_OR', 364); -define('T_BOOLEAN_AND', 365); -define('T_SPACESHIP', 372); -define('T_IS_NOT_IDENTICAL', 369); -define('T_IS_IDENTICAL', 368); -define('T_IS_NOT_EQUAL', 367); -define('T_IS_EQUAL', 366); -define('T_IS_GREATER_OR_EQUAL', 371); -define('T_IS_SMALLER_OR_EQUAL', 370); -define('T_SR', 374); -define('T_SL', 373); -define('T_INSTANCEOF', 283); -define('T_UNSET_CAST', 383); -define('T_BOOL_CAST', 382); -define('T_OBJECT_CAST', 381); -define('T_ARRAY_CAST', 380); -define('T_STRING_CAST', 379); -define('T_DOUBLE_CAST', 378); -define('T_INT_CAST', 377); -define('T_DEC', 376); -define('T_INC', 375); -define('T_POW', 401); -define('T_CLONE', 285); -define('T_NEW', 284); -define('T_ELSEIF', 288); -define('T_ELSE', 289); -define('T_ENDIF', 290); -define('T_PUBLIC', 326); -define('T_PROTECTED', 325); -define('T_PRIVATE', 324); -define('T_FINAL', 323); -define('T_ABSTRACT', 322); -define('T_STATIC', 321); -define('T_LNUMBER', 260); -define('T_DNUMBER', 261); -define('T_STRING', 262); -define('T_VARIABLE', 266); -define('T_INLINE_HTML', 267); -define('T_ENCAPSED_AND_WHITESPACE', 268); -define('T_CONSTANT_ENCAPSED_STRING', 269); -define('T_STRING_VARNAME', 270); -define('T_NUM_STRING', 271); -define('T_EXIT', 286); -define('T_IF', 287); -define('T_ECHO', 291); -define('T_DO', 292); -define('T_WHILE', 293); -define('T_ENDWHILE', 294); -define('T_FOR', 295); -define('T_ENDFOR', 296); -define('T_FOREACH', 297); -define('T_ENDFOREACH', 298); -define('T_DECLARE', 299); -define('T_ENDDECLARE', 300); -define('T_AS', 301); -define('T_SWITCH', 302); -define('T_ENDSWITCH', 303); -define('T_CASE', 304); -define('T_DEFAULT', 305); -define('T_MATCH', 306); -define('T_BREAK', 307); -define('T_CONTINUE', 308); -define('T_GOTO', 309); -define('T_FUNCTION', 310); -define('T_CONST', 312); -define('T_RETURN', 313); -define('T_TRY', 314); -define('T_CATCH', 315); -define('T_FINALLY', 316); -define('T_THROW', 317); -define('T_USE', 318); -define('T_INSTEADOF', 319); -define('T_GLOBAL', 320); -define('T_VAR', 328); -define('T_UNSET', 329); -define('T_ISSET', 330); -define('T_EMPTY', 331); -define('T_HALT_COMPILER', 332); -define('T_CLASS', 333); -define('T_TRAIT', 334); -define('T_INTERFACE', 335); +define('T_COALESCE_EQUAL', 283); +define('T_COALESCE', 284); +define('T_BOOLEAN_OR', 285); +define('T_BOOLEAN_AND', 286); +define('T_SPACESHIP', 293); +define('T_IS_NOT_IDENTICAL', 292); +define('T_IS_IDENTICAL', 291); +define('T_IS_NOT_EQUAL', 290); +define('T_IS_EQUAL', 289); +define('T_IS_GREATER_OR_EQUAL', 295); +define('T_IS_SMALLER_OR_EQUAL', 294); +define('T_SR', 297); +define('T_SL', 296); +define('T_INSTANCEOF', 298); +define('T_UNSET_CAST', 305); +define('T_BOOL_CAST', 304); +define('T_OBJECT_CAST', 303); +define('T_ARRAY_CAST', 302); +define('T_STRING_CAST', 301); +define('T_DOUBLE_CAST', 300); +define('T_INT_CAST', 299); +define('T_DEC', 389); +define('T_INC', 388); +define('T_POW', 306); +define('T_CLONE', 307); +define('T_NEW', 324); +define('T_ELSEIF', 309); +define('T_ELSE', 310); +define('T_ENDIF', 327); +define('T_PUBLIC', 362); +define('T_PROTECTED', 361); +define('T_PRIVATE', 360); +define('T_FINAL', 359); +define('T_ABSTRACT', 358); +define('T_STATIC', 357); +define('T_LNUMBER', 311); +define('T_DNUMBER', 312); +define('T_STRING', 313); +define('T_VARIABLE', 317); +define('T_INLINE_HTML', 318); +define('T_ENCAPSED_AND_WHITESPACE', 319); +define('T_CONSTANT_ENCAPSED_STRING', 320); +define('T_STRING_VARNAME', 321); +define('T_NUM_STRING', 322); +define('T_EXIT', 325); +define('T_IF', 326); +define('T_ECHO', 328); +define('T_DO', 329); +define('T_WHILE', 320); +define('T_ENDWHILE', 331); +define('T_FOR', 332); +define('T_ENDFOR', 333); +define('T_FOREACH', 334); +define('T_ENDFOREACH', 335); +define('T_DECLARE', 336); +define('T_ENDDECLARE', 337); +define('T_AS', 338); +define('T_SWITCH', 339); +define('T_ENDSWITCH', 340); +define('T_CASE', 341); +define('T_DEFAULT', 342); +define('T_MATCH', 343); +define('T_BREAK', 344); +define('T_CONTINUE', 345); +define('T_GOTO', 346); +define('T_FUNCTION', 347); +define('T_CONST', 349); +define('T_RETURN', 350); +define('T_TRY', 351); +define('T_CATCH', 352); +define('T_FINALLY', 353); +define('T_THROW', 258); +define('T_USE', 354); +define('T_INSTEADOF', 355); +define('T_GLOBAL', 356); +define('T_VAR', 364); +define('T_UNSET', 365); +define('T_ISSET', 366); +define('T_EMPTY', 367); +define('T_HALT_COMPILER', 368); +define('T_CLASS', 369); +define('T_TRAIT', 370); +define('T_INTERFACE', 371); /** * @since 8.1 */ -define('T_ENUM', 336); -define('T_EXTENDS', 337); -define('T_IMPLEMENTS', 338); -define('T_OBJECT_OPERATOR', 384); -define('T_LIST', 340); -define('T_ARRAY', 341); -define('T_CALLABLE', 342); -define('T_LINE', 343); -define('T_FILE', 344); -define('T_DIR', 345); -define('T_CLASS_C', 346); -define('T_TRAIT_C', 347); -define('T_METHOD_C', 348); -define('T_FUNC_C', 349); -define('T_COMMENT', 387); -define('T_DOC_COMMENT', 388); -define('T_OPEN_TAG', 389); -define('T_OPEN_TAG_WITH_ECHO', 390); -define('T_CLOSE_TAG', 391); -define('T_WHITESPACE', 392); -define('T_START_HEREDOC', 393); -define('T_END_HEREDOC', 394); -define('T_DOLLAR_OPEN_CURLY_BRACES', 395); -define('T_CURLY_OPEN', 396); -define('T_PAAMAYIM_NEKUDOTAYIM', 397); -define('T_NAMESPACE', 339); -define('T_NS_C', 350); -define('T_NS_SEPARATOR', 398); -define('T_ELLIPSIS', 399); -define('T_DOUBLE_COLON', 397); +define('T_ENUM', 372); +define('T_EXTENDS', 373); +define('T_IMPLEMENTS', 374); +define('T_OBJECT_OPERATOR', 390); +define('T_LIST', 376); +define('T_ARRAY', 377); +define('T_CALLABLE', 378); +define('T_LINE', 379); +define('T_FILE', 380); +define('T_DIR', 381); +define('T_CLASS_C', 382); +define('T_TRAIT_C', 383); +define('T_METHOD_C', 384); +define('T_FUNC_C', 385); +define('T_COMMENT', 392); +define('T_DOC_COMMENT', 393); +define('T_OPEN_TAG', 394); +define('T_OPEN_TAG_WITH_ECHO', 395); +define('T_CLOSE_TAG', 396); +define('T_WHITESPACE', 397); +define('T_START_HEREDOC', 398); +define('T_END_HEREDOC', 399); +define('T_DOLLAR_OPEN_CURLY_BRACES', 400); +define('T_CURLY_OPEN', 401); +define('T_PAAMAYIM_NEKUDOTAYIM', 402); +define('T_NAMESPACE', 375); +define('T_NS_C', 386); +define('T_NS_SEPARATOR', 403); +define('T_ELLIPSIS', 404); +define('T_DOUBLE_COLON', 402); /** * @since 7.4 */ -define('T_FN', 311); +define('T_FN', 348); define('T_BAD_CHARACTER', 405); /** * @since 8.0 */ -define('T_NAME_FULLY_QUALIFIED', 263); +define('T_NAME_FULLY_QUALIFIED', 314); /** * @since 8.0 */ -define('T_NAME_RELATIVE', 264); +define('T_NAME_RELATIVE', 315); /** * @since 8.0 */ -define('T_NAME_QUALIFIED', 265); +define('T_NAME_QUALIFIED', 316); /** * @since 8.0 */ -define('T_ATTRIBUTE', 351); +define('T_ATTRIBUTE', 387); /** * @since 8.0 */ -define('T_NULLSAFE_OBJECT_OPERATOR', 385); +define('T_NULLSAFE_OBJECT_OPERATOR', 391); /** * @since 8.1 */ -define('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', 403); +define('T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', 288); /** * @since 8.1 */ -define('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', 404); +define('T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', 287); /** * @since 8.1 */ -define('T_READONLY', 327); +define('T_READONLY', 363); /** * @removed 7.0 From cd71853118bed99193186d6a52ed1c4181dea1da Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 7 Sep 2023 12:59:56 +0200 Subject: [PATCH 389/419] [phpstorm-stubs] add new parameter to strrchr https://github.com/php/php-src/pull/11430 --- standard/standard_1.php | 2 +- tokenizer/tokenizer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/standard_1.php b/standard/standard_1.php index 592e90438..a657dbc46 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -355,7 +355,7 @@ function stristr(string $haystack, string $needle, bool $before_needle = false): *

    */ #[Pure] -function strrchr(string $haystack, string $needle): string|false {} +function strrchr(string $haystack, string $needle, #[PhpStormStubsElementAvailable(from: "8.3")] bool $before_needle = false): string|false {} /** * Randomly shuffles a string diff --git a/tokenizer/tokenizer.php b/tokenizer/tokenizer.php index 977422615..56a20a9ca 100644 --- a/tokenizer/tokenizer.php +++ b/tokenizer/tokenizer.php @@ -118,7 +118,7 @@ function token_name(int $id): string {} define('T_IF', 326); define('T_ECHO', 328); define('T_DO', 329); -define('T_WHILE', 320); +define('T_WHILE', 330); define('T_ENDWHILE', 331); define('T_FOR', 332); define('T_ENDFOR', 333); From f94b4fb19fa8ba216c7ece45c910618d5066209d Mon Sep 17 00:00:00 2001 From: LolGleb Date: Mon, 4 Sep 2023 14:34:19 +0200 Subject: [PATCH 390/419] [phpstorm-stubs] Fixed testMethodsDefaultParametersValue and added default values for parameters that missed it. --- Core/Core_c.php | 4 ++-- PDO/PDO.php | 8 +++---- Phar/Phar.php | 20 ++++++++-------- Reflection/ReflectionClass.php | 4 ++-- SPL/SPL.php | 4 ++-- SPL/SPL_c1.php | 8 +++---- curl/curl.php | 4 ++-- dom/dom_c.php | 22 ++++++++--------- fileinfo/fileinfo.php | 2 +- intl/intl.php | 24 +++++++++---------- mysqli/mysqli.php | 4 ++-- soap/soap.php | 16 ++++++------- sqlite3/sqlite3.php | 4 ++-- tests/AbstractBaseStubsTestCase.php | 11 +++++++++ tests/Model/BasePHPClass.php | 1 + .../ReflectionParametersProvider.php | 2 +- 16 files changed, 75 insertions(+), 63 deletions(-) diff --git a/Core/Core_c.php b/Core/Core_c.php index 37c779d17..07be080d3 100644 --- a/Core/Core_c.php +++ b/Core/Core_c.php @@ -606,8 +606,8 @@ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $message = "", #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $code = 0, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $severity = 1, - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = __FILE__, - #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $line = __LINE__, + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = null, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $line = null, #[LanguageLevelTypeAware(['8.0' => 'Throwable|null'], default: 'Throwable')] $previous = null ) {} diff --git a/PDO/PDO.php b/PDO/PDO.php index bab566d70..34d03f155 100644 --- a/PDO/PDO.php +++ b/PDO/PDO.php @@ -1557,7 +1557,7 @@ public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], defaul */ #[TentativeType] public function fetch( - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_DEFAULT, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOrientation = PDO::FETCH_ORI_NEXT, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOffset = 0 ): mixed {} @@ -1597,7 +1597,7 @@ public function bindParam( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = 0, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null ): bool {} @@ -1629,7 +1629,7 @@ public function bindColumn( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = 0, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null ): bool {} @@ -1734,7 +1734,7 @@ public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: */ #[TentativeType] public function fetchAll( - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_DEFAULT, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $fetch_argument = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args ): array {} diff --git a/Phar/Phar.php b/Phar/Phar.php index 90356506d..84e3c64bf 100644 --- a/Phar/Phar.php +++ b/Phar/Phar.php @@ -137,7 +137,7 @@ public function addFromString( #[TentativeType] public function buildFromDirectory( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = null + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = '' ): array {} /** @@ -257,8 +257,8 @@ public function decompress(#[LanguageLevelTypeAware(['8.0' => 'string|null'], de */ #[TentativeType] public function convertToExecutable( - #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976, - #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = null, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null ): ?Phar {} @@ -293,8 +293,8 @@ public function convertToExecutable( */ #[TentativeType] public function convertToData( - #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976, - #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = null, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null ): ?PharData {} @@ -622,7 +622,7 @@ public function setSignatureAlgorithm( */ public function setStub( $stub, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = -1 + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = null ) {} /** @@ -896,9 +896,9 @@ final public static function unlinkArchive(string $filename): bool {} */ final public static function webPhar( ?string $alias = null, - ?string $index = "index.php", + ?string $index = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $fileNotFoundScript = null, - array $mimeTypes = null, + array $mimeTypes = [], ?callable $rewrite = null ): void {} @@ -1005,7 +1005,7 @@ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = Phar::TAR + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = 0 ) {} /** @@ -1240,7 +1240,7 @@ public function hasMetadata(): bool {} * @return bool TRUE if the file is compressed within the Phar archive, FALSE if not. */ #[TentativeType] - public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976): bool {} + public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = null): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)
    diff --git a/Reflection/ReflectionClass.php b/Reflection/ReflectionClass.php index 71a8a25a9..29c3d365e 100644 --- a/Reflection/ReflectionClass.php +++ b/Reflection/ReflectionClass.php @@ -278,7 +278,7 @@ public function getReflectionConstant(string $name): ReflectionClassConstant|fal */ #[Pure] #[TentativeType] - public function getReflectionConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE): array {} + public function getReflectionConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = null): array {} /** * Checks if constant is defined @@ -300,7 +300,7 @@ public function hasConstant(#[LanguageLevelTypeAware(['8.0' => 'string'], defaul */ #[Pure] #[TentativeType] - public function getConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE): array {} + public function getConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = null): array {} /** * Gets defined constant diff --git a/SPL/SPL.php b/SPL/SPL.php index 73b351d50..27371a1be 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -447,7 +447,7 @@ class IteratorIterator implements OuterIterator * @param Traversable $iterator * @param string|null $class [optional] */ - public function __construct(Traversable $iterator, #[PhpStormStubsElementAvailable(from: '8.0')] ?string $class = '') {} + public function __construct(Traversable $iterator, #[PhpStormStubsElementAvailable(from: '8.0')] ?string $class = null) {} /** * Get the inner iterator @@ -1336,7 +1336,7 @@ class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator public function __construct( RecursiveIterator $iterator, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = self::MATCH, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = RegexIterator::MATCH, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pregFlags = 0 ) {} diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 2498758e1..073f03da8 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -59,7 +59,7 @@ public function getExtension(): string {} * @since 5.2.2 */ #[TentativeType] - public function getBasename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $suffix = null): string {} + public function getBasename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $suffix = ''): string {} /** * Gets the path to the file @@ -582,7 +582,7 @@ class GlobIterator extends FilesystemIterator implements Countable */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO ) {} /** @@ -889,7 +889,7 @@ public function fscanf( #[TentativeType] public function fwrite( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = null + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = 0 ): int|false {} /** @@ -2420,4 +2420,4 @@ public function next(): void {} */ #[TentativeType] public function __debugInfo(): array {} -} +} \ No newline at end of file diff --git a/curl/curl.php b/curl/curl.php index 346f77a6f..2a8665079 100644 --- a/curl/curl.php +++ b/curl/curl.php @@ -27,8 +27,8 @@ class CURLFile */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $mime_type = '', - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $posted_filename = '' + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $mime_type = null, + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $posted_filename = null ) {} /** diff --git a/dom/dom_c.php b/dom/dom_c.php index fbe497b58..6692cca21 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -389,7 +389,7 @@ public function contains(DOMNode|DOMNameSpaceNode|null $other): bool {} /** * @since 8.3 */ - public function getRootNode(?array $options = []): DOMNode {} + public function getRootNode(?array $options = null): DOMNode {} } /** @@ -876,7 +876,7 @@ public function createCDATASection(#[LanguageLevelTypeAware(['8.0' => 'string'], public function createProcessingInstruction( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $target, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.3')] $data, - #[PhpStormStubsElementAvailable(from: '7.4')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = null + #[PhpStormStubsElementAvailable(from: '7.4')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = '' ) {} /** @@ -1061,7 +1061,7 @@ public function renameNode(DOMNode $node, $namespace, $qualifiedName) {} #[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')] public function load( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0 ) {} /** @@ -1095,7 +1095,7 @@ public function save($filename, $options = null) {} #[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')] public function loadXML( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $source, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0 ) {} /** @@ -1113,7 +1113,7 @@ public function loadXML( #[TentativeType] public function saveXML( ?DOMNode $node = null, - #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0 ): string|false {} /** @@ -1146,7 +1146,7 @@ public function validate(): bool {} * @return int|false the number of XIncludes in the document. */ #[TentativeType] - public function xinclude(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null): int|false {} + public function xinclude(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0): int|false {} /** * Load HTML from a string @@ -2015,7 +2015,7 @@ public function replaceChildren(...$nodes): void {} public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $value = null, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace = null + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace = '' ) {} /** @@ -2026,7 +2026,7 @@ public function getAttributeNames(): array {} /** * @since 8.3 */ - public function toggleAttribute(string $qualifiedName, ?bool $force = false): bool {} + public function toggleAttribute(string $qualifiedName, ?bool $force = null): bool {} /** * @since 8.3 @@ -2085,7 +2085,7 @@ public function replaceWholeText($content) {} * @link https://php.net/manual/en/domtext.construct.php * @param string $data [optional] The value of the text node. If not supplied an empty text node is created. */ - public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = '') {} } /** @@ -2100,7 +2100,7 @@ class DOMComment extends DOMCharacterData * @link https://php.net/manual/en/domcomment.construct.php * @param string $data [optional] The value of the comment */ - public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {} + public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = '') {} } /** @@ -2351,7 +2351,7 @@ class DOMProcessingInstruction extends DOMNode */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value = '' ) {} } diff --git a/fileinfo/fileinfo.php b/fileinfo/fileinfo.php index a13a2d197..c29106777 100644 --- a/fileinfo/fileinfo.php +++ b/fileinfo/fileinfo.php @@ -14,7 +14,7 @@ class finfo * @param string $magic_database [optional] */ public function __construct( - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $magic_database ) {} diff --git a/intl/intl.php b/intl/intl.php index 7d72ddec0..5168864b7 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -321,7 +321,7 @@ public function compare( #[TentativeType] public function sort( array &$array, - #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = 0 ): bool {} /** @@ -352,7 +352,7 @@ public function sortWithSortKeys( #[TentativeType] public function asort( array &$array, - #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = 0 ): bool {} /** @@ -987,7 +987,7 @@ public static function create( #[TentativeType] public function format( #[LanguageAware(['8.0' => 'int|float'], default: '')] $num, - #[LanguageAware(['8.0' => 'int'], default: '')] $type = null + #[LanguageAware(['8.0' => 'int'], default: '')] $type = 0 ): string|false {} /** @@ -1189,7 +1189,7 @@ public function getPattern(): string|false {} #[Pure] #[TentativeType] public function getLocale( - #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = 0 ): string|false {} /** @@ -1911,7 +1911,7 @@ public function __construct( #[ElementAvailable(from: '8.1')] int $timeType = 0, $timezone = null, $calendar = null, - #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = '' + #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = null ) {} /** @@ -1958,7 +1958,7 @@ public static function create( #[ElementAvailable(from: '8.1')] int $timeType = 0, $timezone = null, #[LanguageAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar = null, - #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = '' + #[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = null ): ?IntlDateFormatter {} /** @@ -2127,7 +2127,7 @@ public function getPattern(): string|false {} public function getLocale( #[ElementAvailable(from: '8.0')] #[LanguageAware(['8.0' => 'int'], default: '')] - $type = null + $type = 0 ): string|false {} /** @@ -2400,7 +2400,7 @@ final private function __construct() {} #[TentativeType] public static function create( #[LanguageAware(['8.0' => 'string'], default: '')] $id, - #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = 0 ): ?Transliterator {} /** @@ -2422,7 +2422,7 @@ public static function create( #[TentativeType] public static function createFromRules( #[LanguageAware(['8.0' => 'string'], default: '')] $rules, - #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null + #[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = 0 ): ?Transliterator {} /** @@ -2469,7 +2469,7 @@ public static function listIDs(): array|false {} #[TentativeType] public function transliterate( #[LanguageAware(['8.0' => 'string'], default: '')] $string, - #[LanguageAware(['8.0' => 'int'], default: '')] $start = null, + #[LanguageAware(['8.0' => 'int'], default: '')] $start = 0, #[LanguageAware(['8.0' => 'int'], default: '')] $end = -1 ): string|false {} @@ -3560,7 +3560,7 @@ public static function createTimeZone(#[LanguageAware(['8.0' => 'string'], defau public static function createTimeZoneIDEnumeration( #[LanguageAware(['8.0' => 'int'], default: '')] $type, #[LanguageAware(['8.0' => 'string|null'], default: '')] $region = null, - #[LanguageAware(['8.0' => 'int|null'], default: '')] $rawOffset = 0 + #[LanguageAware(['8.0' => 'int|null'], default: '')] $rawOffset = null ): IntlIterator|false {} /** @@ -7742,7 +7742,7 @@ public static function transcode( #[LanguageAware(['8.0' => 'string'], default: '')] $str, #[LanguageAware(['8.0' => 'string'], default: '')] $toEncoding, #[LanguageAware(['8.0' => 'string'], default: '')] $fromEncoding, - ?array $options = [] + ?array $options = null ): string|false {} } // End of intl v.1.1.0 diff --git a/mysqli/mysqli.php b/mysqli/mysqli.php index 21709609e..2186ab4dd 100644 --- a/mysqli/mysqli.php +++ b/mysqli/mysqli.php @@ -683,7 +683,7 @@ public function real_connect( ?string $database = null, ?int $port = null, ?string $socket = null, - int $flags = null + int $flags = 0 ): bool {} /** @@ -1291,7 +1291,7 @@ public function fetch_assoc(): array|false|null {} * are no more rows in the result set, or false on failure. */ #[TentativeType] - public function fetch_object(string $class = 'stdClass', array $constructor_args = null): object|false|null {} + public function fetch_object(string $class = 'stdClass', array $constructor_args = []): object|false|null {} /** * Fetch the next row of a result set as an enumerated array diff --git a/soap/soap.php b/soap/soap.php index 49550e00d..0d36f88c5 100644 --- a/soap/soap.php +++ b/soap/soap.php @@ -267,7 +267,7 @@ public function SoapClient($wsdl, array $options = null) {} */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $wsdl, - array $options = null + array $options = [] ) {} /** @@ -462,7 +462,7 @@ public function __setCookie( * @since 5.0.1 */ #[TentativeType] - public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $location = ''): ?string {} + public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $location = null): ?string {} /** * Sets SOAP headers for subsequent calls @@ -551,9 +551,9 @@ public function __construct( #[LanguageLevelTypeAware(["8.0" => 'mixed'], default: '')] $data, #[LanguageLevelTypeAware(["7.1" => "int|null"], default: "int")] $encoding, #[LanguageLevelTypeAware(["8.0" => "string|null"], default: "string")] $typeName, - #[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $typeNamespace = '', - #[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeName = '', - #[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeNamespace = '' + #[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $typeNamespace = null, + #[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeName = null, + #[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeNamespace = null ) {} /** @@ -631,7 +631,7 @@ class SoapServer */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $wsdl, - array $options = null + array $options = [] ) {} /** @@ -799,9 +799,9 @@ public function handle(#[LanguageLevelTypeAware(['8.0' => 'string|null'], defaul public function fault( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $code, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $actor = null, + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $actor = '', #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $details = null, - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name = null + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name = '' ): void {} /** diff --git a/sqlite3/sqlite3.php b/sqlite3/sqlite3.php index f4d942d61..ebcacd143 100644 --- a/sqlite3/sqlite3.php +++ b/sqlite3/sqlite3.php @@ -81,7 +81,7 @@ public function open( #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $flags, #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $encryptionKey, #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, - #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = '' ): void {} /** @@ -370,7 +370,7 @@ public function __construct( #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $flags, #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $encryptionKey, #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, - #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = '' ) {} /** diff --git a/tests/AbstractBaseStubsTestCase.php b/tests/AbstractBaseStubsTestCase.php index 6c4483b52..65602af0c 100644 --- a/tests/AbstractBaseStubsTestCase.php +++ b/tests/AbstractBaseStubsTestCase.php @@ -68,6 +68,17 @@ public static function getStringRepresentationOfDefaultParameterValue(mixed $def /** @var PHPConst $rightConstant */ $rightConstant = array_pop($constants); $value = $leftConstant->value|$rightConstant->value; + } elseif ($defaultValue->left instanceof ClassConstFetch && $defaultValue->right instanceof ClassConstFetch){ + $leftClass = $defaultValue->left->class->toString(); + $rightClass = $defaultValue->right->class->toString(); + $leftClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($leftClass); + $rightClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($rightClass); + if ($leftClass === null || $rightClass === null) { + throw new Exception("Class $leftClass->name or $rightClass->name not found in stubs"); + } + $leftConstant = $leftClass->getConstant((string)$defaultValue->left->name);; + $rightConstant = $rightClass->getConstant((string)$defaultValue->right->name);; + $value = $leftConstant->value|$rightConstant->value; } } elseif ($defaultValue instanceof UnaryMinus && property_exists($defaultValue->expr, 'value')) { $value = '-' . $defaultValue->expr->value; diff --git a/tests/Model/BasePHPClass.php b/tests/Model/BasePHPClass.php index 300ec83c3..63c30aceb 100644 --- a/tests/Model/BasePHPClass.php +++ b/tests/Model/BasePHPClass.php @@ -59,6 +59,7 @@ function (PHPConst $nextConstant) use ($parsedConstant) { */ public function getConstant($constantName) { + $arra = $this->constants; $constants = array_filter($this->constants, function (PHPConst $constant) use ($constantName) { return $constant->name === $constantName && $constant->duplicateOtherElement === false && BasePHPElement::entitySuitsCurrentPhpVersion($constant); diff --git a/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php b/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php index 751563825..e74e07eec 100644 --- a/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php +++ b/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php @@ -129,7 +129,7 @@ public static function methodOptionalParametersWithDefaultValueProvider(): ?Gene foreach (EntitiesFilter::getFilteredFunctions($class) as $method) { foreach (EntitiesFilter::getFilteredParameters( $method, - fn (PHPParameter $parameter) => !$parameter->isOptional || empty($parameter->defaultValue), + fn (PHPParameter $parameter) => !$parameter->isOptional, StubProblemType::WRONG_PARAMETER_DEFAULT_VALUE ) as $parameter) { yield "$class->name::$method->name($parameter->name)" => [$class, $method, $parameter]; From ade19d250a84caec62377217aba4631d72f07523 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Mon, 4 Sep 2023 14:58:58 +0200 Subject: [PATCH 391/419] [phpstorm-stubs] Reverted things that shouldn't have been changed. --- SPL/SPL_c1.php | 4 ++-- tests/Model/BasePHPClass.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 073f03da8..402779ade 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -582,7 +582,7 @@ class GlobIterator extends FilesystemIterator implements Countable */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO ) {} /** @@ -2420,4 +2420,4 @@ public function next(): void {} */ #[TentativeType] public function __debugInfo(): array {} -} \ No newline at end of file +} diff --git a/tests/Model/BasePHPClass.php b/tests/Model/BasePHPClass.php index 63c30aceb..300ec83c3 100644 --- a/tests/Model/BasePHPClass.php +++ b/tests/Model/BasePHPClass.php @@ -59,7 +59,6 @@ function (PHPConst $nextConstant) use ($parsedConstant) { */ public function getConstant($constantName) { - $arra = $this->constants; $constants = array_filter($this->constants, function (PHPConst $constant) use ($constantName) { return $constant->name === $constantName && $constant->duplicateOtherElement === false && BasePHPElement::entitySuitsCurrentPhpVersion($constant); From da20e393ee381ef3ce3f8e1a8e48c6d2f8e1fd58 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Tue, 5 Sep 2023 12:12:02 +0200 Subject: [PATCH 392/419] [phpstorm-stubs] removed most of the muted problems with description 'wrong default value'. Fixed tests that started to fail after this. --- Phar/Phar.php | 4 +- SPL/SPL.php | 4 +- date/date_c.php | 4 +- tests/AbstractBaseStubsTestCase.php | 4 +- tests/TestData/mutedProblems.json | 245 ---------------------------- 5 files changed, 8 insertions(+), 253 deletions(-) diff --git a/Phar/Phar.php b/Phar/Phar.php index 84e3c64bf..56795c9df 100644 --- a/Phar/Phar.php +++ b/Phar/Phar.php @@ -57,7 +57,7 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null, #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $fileformat = null ) {} @@ -1003,7 +1003,7 @@ class PharData extends Phar */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO, + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = 0 ) {} diff --git a/SPL/SPL.php b/SPL/SPL.php index 27371a1be..abc3a6619 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -935,7 +935,7 @@ class RecursiveCachingIterator extends CachingIterator implements RecursiveItera * @param Iterator $iterator The iterator to cache. * @param int $flags [optional] A bitmask of flags. See CachingIterator class constants for details. */ - public function __construct(Iterator $iterator, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = self::CALL_TOSTRING) {} + public function __construct(Iterator $iterator, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = CachingIterator::CALL_TOSTRING) {} /** * Check whether the current element of the inner iterator has children @@ -1385,7 +1385,7 @@ public function __construct( $iterator, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = self::BYPASS_KEY, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cachingIteratorFlags = CachingIterator::CATCH_GET_CHILD, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = self::SELF_FIRST + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = RecursiveIteratorIterator::SELF_FIRST ) {} /** diff --git a/date/date_c.php b/date/date_c.php index c297e6ca0..9e2bd89bb 100644 --- a/date/date_c.php +++ b/date/date_c.php @@ -809,8 +809,8 @@ public function getOffset(DateTimeInterface $datetime): int {} public function getTransitions( #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $timestampBegin, #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $timestampEnd, - #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampBegin = null, - #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampEnd = null + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampBegin = PHP_INT_MIN, + #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $timestampEnd = PHP_INT_MAX ): array|false {} /** diff --git a/tests/AbstractBaseStubsTestCase.php b/tests/AbstractBaseStubsTestCase.php index 65602af0c..24463da2e 100644 --- a/tests/AbstractBaseStubsTestCase.php +++ b/tests/AbstractBaseStubsTestCase.php @@ -76,8 +76,8 @@ public static function getStringRepresentationOfDefaultParameterValue(mixed $def if ($leftClass === null || $rightClass === null) { throw new Exception("Class $leftClass->name or $rightClass->name not found in stubs"); } - $leftConstant = $leftClass->getConstant((string)$defaultValue->left->name);; - $rightConstant = $rightClass->getConstant((string)$defaultValue->right->name);; + $leftConstant = $leftClass->getConstant((string)$defaultValue->left->name); + $rightConstant = $rightClass->getConstant((string)$defaultValue->right->name); $value = $leftConstant->value|$rightConstant->value; } } elseif ($defaultValue instanceof UnaryMinus && property_exists($defaultValue->expr, 'value')) { diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index 31b8f6385..e39bc1607 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -799,129 +799,6 @@ } ] }, - { - "name": "timezone_transitions_get", - "parameters": [ - { - "name": "timestampBegin", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - }, - { - "name": "timestampEnd", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, - { - "name": "mb_encode_mimeheader", - "parameters": [ - { - "name": "newline", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, - { - "name": "trim", - "parameters": [ - { - "name": "characters", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, - { - "name": "rtrim", - "parameters": [ - { - "name": "characters", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, - { - "name": "chop", - "parameters": [ - { - "name": "characters", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, - { - "name": "ltrim", - "parameters": [ - { - "name": "characters", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, - { - "name": "explode", - "parameters": [ - { - "name": "limit", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, { "name": "bcdiv", "problems": [ @@ -1821,44 +1698,12 @@ ] } ] - }, - { - "name": "__construct", - "parameters": [ - { - "name": "flags", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] } ] }, { "name": "PharData", "methods": [ - { - "name": "__construct", - "parameters": [ - { - "name": "flags", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - }, { "name": "__destruct", "problems": [ @@ -2722,75 +2567,6 @@ ] } ] - }, - { - "name": "getTransitions", - "parameters": [ - { - "name": "timestampBegin", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - }, - { - "name": "timestampEnd", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - } - ] - }, - { - "name": "RecursiveCachingIterator", - "methods": [ - { - "name": "__construct", - "parameters": [ - { - "name": "flags", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - } - ] - }, - { - "name": "RecursiveTreeIterator", - "methods": [ - { - "name": "__construct", - "parameters": [ - { - "name": "mode", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] } ] }, @@ -2815,27 +2591,6 @@ } ] }, - { - "name": "MultipleIterator", - "methods": [ - { - "name": "__construct", - "parameters": [ - { - "name": "flags", - "problems": [ - { - "description": "wrong default value", - "versions": [ - "ALL" - ] - } - ] - } - ] - } - ] - }, { "name": "DateInterval", "methods": [ From fb1e679110f7b4d2639600ec9eb8d8383876c56b Mon Sep 17 00:00:00 2001 From: LolGleb Date: Tue, 5 Sep 2023 12:40:52 +0200 Subject: [PATCH 393/419] [phpstorm-stubs] fixed stubs default values for testFunctionsDefaultParametersValue. --- date/date.php | 2 +- mbstring/mbstring.php | 2 +- standard/standard_1.php | 8 ++++---- standard/standard_2.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/date/date.php b/date/date.php index 7e328bacf..b72ce4452 100644 --- a/date/date.php +++ b/date/date.php @@ -1346,7 +1346,7 @@ function timezone_offset_get(DateTimeZone $object, DateTimeInterface $datetime) * @return array|false

    Returns numerically indexed array containing associative array with all transitions on success or FALSE on failure.

    */ #[Pure(true)] -function timezone_transitions_get(DateTimeZone $object, int $timestampBegin, int $timestampEnd): array|false {} +function timezone_transitions_get(DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {} /** * Alias: diff --git a/mbstring/mbstring.php b/mbstring/mbstring.php index fb4be1ec1..7f950634b 100644 --- a/mbstring/mbstring.php +++ b/mbstring/mbstring.php @@ -779,7 +779,7 @@ function mb_convert_kana(string $string, string $mode = 'KV', ?string $encoding) * @return string A converted version of the string represented in ASCII. */ #[Pure] -function mb_encode_mimeheader(string $string, ?string $charset, ?string $transfer_encoding, string $newline = "\n", int $indent = 0): string {} +function mb_encode_mimeheader(string $string, ?string $charset, ?string $transfer_encoding, string $newline = "\r\n", int $indent = 0): string {} /** * Decode string in MIME header field diff --git a/standard/standard_1.php b/standard/standard_1.php index a657dbc46..ecbd15361 100644 --- a/standard/standard_1.php +++ b/standard/standard_1.php @@ -767,7 +767,7 @@ function addcslashes(string $string, string $characters): string {} * @return string the modified string. */ #[Pure] -function rtrim(string $string, string $characters = " \t\n\r\0\x0B"): string {} +function rtrim(string $string, string $characters = " \n\r\t\v\0"): string {} /** * Replace all occurrences of the search string with the replacement string @@ -894,7 +894,7 @@ function chunk_split(string $string, int $length = 76, string $separator = "\r\n * @return string The trimmed string. */ #[Pure] -function trim(string $string, string $characters = " \t\n\r\0\x0B"): string {} +function trim(string $string, string $characters = " \n\r\t\v\0"): string {} /** * Strip whitespace (or other characters) from the beginning of a string @@ -926,7 +926,7 @@ function trim(string $string, string $characters = " \t\n\r\0\x0B"): string {} * (0x0B)), a vertical tab. */ #[Pure] -function ltrim(string $string, string $characters = " \t\n\r\0\x0B"): string {} +function ltrim(string $string, string $characters = " \n\r\t\v\0"): string {} /** * Strip HTML and PHP tags from a string @@ -996,7 +996,7 @@ function similar_text(string $string1, string $string2, &$percent): int {} */ #[Pure] #[LanguageLevelTypeAware(["8.0" => "string[]"], default: "string[]|false")] -function explode(string $separator, string $string, int $limit) {} +function explode(string $separator, string $string, int $limit = PHP_INT_MAX) {} /** * Join array elements with a string diff --git a/standard/standard_2.php b/standard/standard_2.php index 82494741f..8b5188b88 100644 --- a/standard/standard_2.php +++ b/standard/standard_2.php @@ -295,7 +295,7 @@ function str_pad(string $string, int $length, string $pad_string = " ", int $pad * @see rtrim() */ #[Pure] -function chop(string $string, string $characters): string {} +function chop(string $string, string $characters = " \n\r\t\v\0"): string {} /** * Alias: From a0c77afb46503f22d631b57761c14f481be0d9aa Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 13 Sep 2023 15:23:56 +0200 Subject: [PATCH 394/419] [phpstorm-stubs] added new tests for parameters without default value. --- Phar/Phar.php | 2 +- Reflection/ReflectionClass.php | 4 +- Reflection/ReflectionProperty.php | 4 +- intl/intl.php | 16 ++-- pgsql/pgsql.php | 82 +++++++++---------- random/random.php | 8 +- soap/soap.php | 2 +- tests/Model/PHPFunction.php | 1 + tests/Model/PHPMethod.php | 1 + tests/Model/PHPParameter.php | 3 + .../StubsConstantsAndParametersValuesTest.php | 62 ++++++++++++++ .../ReflectionParametersProvider.php | 35 +++++++- 12 files changed, 160 insertions(+), 60 deletions(-) diff --git a/Phar/Phar.php b/Phar/Phar.php index 56795c9df..2e6eb1747 100644 --- a/Phar/Phar.php +++ b/Phar/Phar.php @@ -622,7 +622,7 @@ public function setSignatureAlgorithm( */ public function setStub( $stub, - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = null + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length ) {} /** diff --git a/Reflection/ReflectionClass.php b/Reflection/ReflectionClass.php index 29c3d365e..78677a763 100644 --- a/Reflection/ReflectionClass.php +++ b/Reflection/ReflectionClass.php @@ -533,7 +533,7 @@ public function getStaticProperties() {} * * @link https://php.net/manual/en/reflectionclass.getstaticpropertyvalue.php * @param string $name The name of the static property for which to return a value. - * @param mixed $default A default value to return in case the class does + * @param mixed $default [optional] A default value to return in case the class does * not declare a static property with the given name. If the property does * not exist and this argument is omitted, a {@see ReflectionException} is thrown. * @return mixed The value of the static property. @@ -542,7 +542,7 @@ public function getStaticProperties() {} #[TentativeType] public function getStaticPropertyValue( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $default = null + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $default ): mixed {} /** diff --git a/Reflection/ReflectionProperty.php b/Reflection/ReflectionProperty.php index f770f1f5d..642d4d9b3 100644 --- a/Reflection/ReflectionProperty.php +++ b/Reflection/ReflectionProperty.php @@ -130,13 +130,13 @@ public function getValue(#[LanguageLevelTypeAware(['8.0' => 'object|null'], defa * @param mixed $objectOrValue If the property is non-static an object must * be provided to change the property on. If the property is static this * parameter is left out and only $value needs to be provided. - * @param mixed $value The new value. + * @param mixed $value [optional] The new value. * @return void No value is returned. */ #[TentativeType] public function setValue( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $objectOrValue, - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value = null + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value ): void {} /** diff --git a/intl/intl.php b/intl/intl.php index 5168864b7..a328d1c5c 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -5563,7 +5563,7 @@ function intlcal_before(IntlCalendar $calendar, IntlCalendar $other): bool {} * @since 5.5 */ #[LanguageAware(['8.3' => 'true'], default: 'bool')] -function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = null, int $hour = null, int $minute = null, int $second = null) {} +function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth, int $hour, int $minute, int $second) {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    @@ -6448,17 +6448,17 @@ function intltz_use_daylight_time(IntlTimeZone $timezone): bool {} /** * (PHP 5 >=5.5.0 PECL intl >= 3.0.0a1)
    - * @param DateTimeZone|IntlTimeZone|string|int|null $timezoneOrYear - * @param string|null $localeOrMonth - * @param int $day - * @param int $hour - * @param int $minute - * @param int $second + * @param DateTimeZone|IntlTimeZone|string|int|null $timezoneOrYear [optional] + * @param string|null $localeOrMonth [optional] + * @param int $day [optional] + * @param int $hour [optional] + * @param int $minute [optional] + * @param int $second [optional] * @return IntlGregorianCalendar|null * @since 5.5 */ #[Pure] -function intlgregcal_create_instance($timezoneOrYear = null, $localeOrMonth = null, $day = null, $hour = null, $minute = null, $second = null): ?IntlGregorianCalendar {} +function intlgregcal_create_instance($timezoneOrYear, $localeOrMonth, $day, $hour, $minute, $second): ?IntlGregorianCalendar {} /** * @param IntlGregorianCalendar $calendar diff --git a/pgsql/pgsql.php b/pgsql/pgsql.php index 9b2411bc4..0d0764541 100644 --- a/pgsql/pgsql.php +++ b/pgsql/pgsql.php @@ -267,7 +267,7 @@ function pg_ping(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], de * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $name

    + * @param string $name [optional]

    * Possible param_name values include server_version, * server_encoding, client_encoding, * is_superuser, session_authorization, @@ -277,7 +277,7 @@ function pg_ping(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], de * @return string|false A string containing the value of the parameter, FALSE on failure or invalid * param_name. */ -function pg_parameter_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, string $name = null): string|false {} +function pg_parameter_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, string $name): string|false {} /** * Returns the current in-transaction status of the server. @@ -304,7 +304,7 @@ function pg_transaction_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connect * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $query

    + * @param string $query [optional]

    * The SQL statement or statements to be executed. When multiple statements are passed to the function, * they are automatically executed as one transaction, unless there are explicit BEGIN/COMMIT commands * included in the query string. However, using multiple transactions in one function call is not recommended. @@ -327,7 +327,7 @@ function pg_transaction_status(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connect function pg_query( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $query = null + string $query ) {} /** @@ -352,7 +352,7 @@ function pg_query( * If for some reason you cannot use a parameter, ensure that interpolated * values are properly escaped. *

    - * @param array $params

    + * @param array $params [optional]

    * An array of parameter values to substitute for the $1, $2, etc. placeholders * in the original prepared query string. The number of elements in the array * must match the number of placeholders. @@ -370,7 +370,7 @@ function pg_query_params( #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $query = '', #[PhpStormStubsElementAvailable(from: '8.0')] $query, - array $params = null + array $params ) {} /** @@ -388,7 +388,7 @@ function pg_query_params( * "" is specified, then an unnamed statement is created, overwriting any * previously defined unnamed statement. *

    - * @param string $query

    + * @param string $query [optional]

    * The parameterized SQL statement. Must contain only a single statement. * (multiple statements separated by semi-colons are not allowed.) If any parameters * are used, they are referred to as $1, $2, etc. @@ -401,7 +401,7 @@ function pg_prepare( #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $statement_name = '', #[PhpStormStubsElementAvailable(from: '8.0')] string $statement_name, - string $query = null + string $query ) {} /** @@ -420,7 +420,7 @@ function pg_prepare( * pg_send_prepare or a PREPARE SQL * command. *

    - * @param array $params

    + * @param array $params [optional]

    * An array of parameter values to substitute for the $1, $2, etc. placeholders * in the original prepared query string. The number of elements in the array * must match the number of placeholders. @@ -436,7 +436,7 @@ function pg_execute( #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $statement_name = '', #[PhpStormStubsElementAvailable(from: '8.0')] $statement_name, - array $params = null + array $params ) {} /** @@ -566,7 +566,7 @@ function pg_cancel_query(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], * Row number in result to fetch. Rows are numbered from 0 upwards. If omitted, * next row is fetched. *

    - * @param mixed $field

    + * @param mixed $field [optional]

    * A string representing the name of the field (column) to fetch, otherwise * an int representing the field number to fetch. Fields are * numbered from 0 upwards. @@ -585,7 +585,7 @@ function pg_fetch_result( #[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $row = 0, #[PhpStormStubsElementAvailable(from: '8.0')] $row, - string|int $field = null + string|int $field ): string|false|null {} /** @@ -951,14 +951,14 @@ function pg_field_type_oid(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], d * (among others). *

    * @param int $row - * @param mixed $field + * @param mixed $field [optional] * @return int|false The field printed length, or FALSE on error. */ function pg_field_prtlen( #[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $row = 0, #[PhpStormStubsElementAvailable(from: '8.0')] $row, - string|int $field = null + string|int $field ): int|false {} /** @@ -973,7 +973,7 @@ function pg_field_prtlen( * Row number in result to fetch. Rows are numbered from 0 upwards. If omitted, * current row is fetched. *

    - * @param mixed $field

    + * @param mixed $field [optional]

    * Field number (starting from 0) as an integer or * the field name as a string. *

    @@ -984,7 +984,7 @@ function pg_field_is_null( #[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $row = 0, #[PhpStormStubsElementAvailable(from: '8.0')] $row, - string|int $field = null + string|int $field ): int|false {} /** @@ -1129,7 +1129,7 @@ function pg_last_notice(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $query

    + * @param string $query [optional]

    * A line of text to be sent directly to the PostgreSQL backend. A NULL * terminator is added automatically. *

    @@ -1138,7 +1138,7 @@ function pg_last_notice(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], function pg_put_line( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $query = null + string $query ): bool {} /** @@ -1271,7 +1271,7 @@ function pg_untrace(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection|null'], *

    * @return string|int|false A large object OID or FALSE on error. */ -function pg_lo_create(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection = null, $oid = null): string|int|false {} +function pg_lo_create(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, $oid): string|int|false {} /** * Delete a large object @@ -1282,7 +1282,7 @@ function pg_lo_create(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], de * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param int $oid

    + * @param int $oid [optional]

    * The OID of the large object in the database. *

    * @return bool TRUE on success or FALSE on failure. @@ -1290,7 +1290,7 @@ function pg_lo_create(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], de function pg_lo_unlink( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - $oid = null + $oid ): bool {} /** @@ -1302,10 +1302,10 @@ function pg_lo_unlink( * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param int $oid

    + * @param int $oid [optional]

    * The OID of the large object in the database. *

    - * @param string $mode

    + * @param string $mode [optional]

    * Can be either "r" for read-only, "w" for write only or "rw" for read and * write. *

    @@ -1315,8 +1315,8 @@ function pg_lo_unlink( function pg_lo_open( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - $oid = null, - string $mode = null + $oid, + string $mode ) {} /** @@ -1479,7 +1479,7 @@ function pg_lo_truncate( * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $string

    + * @param string $string [optional]

    * A string containing text to be escaped. *

    * @return string A string containing the escaped data. @@ -1487,7 +1487,7 @@ function pg_lo_truncate( function pg_escape_string( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $string = null + string $string ): string {} /** @@ -1499,7 +1499,7 @@ function pg_escape_string( * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $string

    + * @param string $string [optional]

    * A string containing text or binary data to be inserted into a bytea * column. *

    @@ -1508,7 +1508,7 @@ function pg_escape_string( function pg_escape_bytea( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $string = null + string $string ): string {} /** @@ -1520,7 +1520,7 @@ function pg_escape_bytea( * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $string

    + * @param string $string [optional]

    * A string containing text to be escaped. *

    * @return string|false A string containing the escaped data. @@ -1529,7 +1529,7 @@ function pg_escape_bytea( function pg_escape_identifier( #[PhpStormStubsElementAvailable(from: '5.4', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $string = null + string $string ): string|false {} /** @@ -1541,7 +1541,7 @@ function pg_escape_identifier( * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $string

    + * @param string $string [optional]

    * A string containing text to be escaped. *

    * @return string|false A string containing the escaped data. @@ -1550,7 +1550,7 @@ function pg_escape_identifier( function pg_escape_literal( #[PhpStormStubsElementAvailable(from: '5.4', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $string = null + string $string ): string|false {} /** @@ -1574,7 +1574,7 @@ function pg_unescape_bytea(string $string): string {} * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param int $verbosity

    + * @param int $verbosity [optional]

    * The required verbosity: PGSQL_ERRORS_TERSE, * PGSQL_ERRORS_DEFAULT * or PGSQL_ERRORS_VERBOSE. @@ -1586,7 +1586,7 @@ function pg_unescape_bytea(string $string): string {} function pg_set_error_verbosity( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - int $verbosity = null + int $verbosity ): int|false {} /** @@ -1611,7 +1611,7 @@ function pg_client_encoding(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection * is used. The default connection is the last connection made by * pg_connect or pg_pconnect. *

    - * @param string $encoding

    + * @param string $encoding [optional]

    * The required client encoding. One of SQL_ASCII, EUC_JP, * EUC_CN, EUC_KR, EUC_TW, * UNICODE, MULE_INTERNAL, LATINX (X=1...9), @@ -1627,7 +1627,7 @@ function pg_client_encoding(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection function pg_set_client_encoding( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $encoding = null + string $encoding ): int {} /** @@ -1817,14 +1817,14 @@ function pg_select( /** * @param $connection - * @param $query + * @param $query [optional] * @return mixed */ #[LanguageLevelTypeAware(['8.1' => 'PgSql\Result|false'], default: 'resource|false')] function pg_exec( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection = null, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Connection'], default: 'resource')] $connection, - string $query = null + string $query ) {} /** @@ -1932,14 +1932,14 @@ function pg_freeresult(#[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], defau /** * @param PgSql\Result|resource $result * @param $row - * @param $field + * @param $field [optional] * @deprecated */ function pg_result( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $connection, #[PhpStormStubsElementAvailable(from: '8.0')] #[LanguageLevelTypeAware(['8.1' => 'PgSql\Result'], default: 'resource')] $result, #[PhpStormStubsElementAvailable(from: '8.0')] $row, - #[PhpStormStubsElementAvailable(from: '8.0')] string|int $field = null + #[PhpStormStubsElementAvailable(from: '8.0')] string|int $field ): string|null|false {} /** diff --git a/random/random.php b/random/random.php index becbf9c37..352edc28d 100644 --- a/random/random.php +++ b/random/random.php @@ -50,17 +50,17 @@ function srand( /** * Generate a random integer * @link https://php.net/manual/en/function.rand.php - * @param int $min + * @param int $min [optional] * @param int $max [optional] * @return int A pseudo random value between min * (or 0) and max (or getrandmax, inclusive). */ - function rand(int $min = null, int $max): int {} + function rand(int $min, int $max): int {} /** * Generate a random value via the Mersenne Twister Random Number Generator * @link https://php.net/manual/en/function.mt-rand.php - * @param int $min

    + * @param int $min [optional]

    * Optional lowest value to be returned (default: 0) *

    * @param int $max [optional]

    @@ -69,7 +69,7 @@ function rand(int $min = null, int $max): int {} * @return int A random integer value between min (or 0) * and max (or mt_getrandmax, inclusive) */ - function mt_rand(int $min = null, int $max): int {} + function mt_rand(int $min, int $max): int {} /** * Show largest possible random value diff --git a/soap/soap.php b/soap/soap.php index 0d36f88c5..c25efc398 100644 --- a/soap/soap.php +++ b/soap/soap.php @@ -1054,7 +1054,7 @@ class SoapHeader public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name, - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $mustUnderstand = false, #[LanguageLevelTypeAware(['8.0' => 'string|int|null'], default: '')] $actor = null ) {} diff --git a/tests/Model/PHPFunction.php b/tests/Model/PHPFunction.php index 5a8219e28..98ac6b679 100644 --- a/tests/Model/PHPFunction.php +++ b/tests/Model/PHPFunction.php @@ -103,6 +103,7 @@ public function readObjectFromStubNode($node) $relatedParamTag = array_pop($relatedParamTags); if ($relatedParamTag !== null) { $parameter->isOptional = $parameter->isOptional || str_contains((string)$relatedParamTag->getDescription(), '[optional]'); + $parameter->markedOptionalInPhpDoc = str_contains((string)$relatedParamTag->getDescription(), '[optional]'); } } diff --git a/tests/Model/PHPMethod.php b/tests/Model/PHPMethod.php index 4526da3a2..da0271664 100644 --- a/tests/Model/PHPMethod.php +++ b/tests/Model/PHPMethod.php @@ -119,6 +119,7 @@ public function readObjectFromStubNode($node) $relatedParamTag = array_pop($relatedParamTags); if ($relatedParamTag !== null) { $parameter->isOptional = $parameter->isOptional || str_contains((string)$relatedParamTag->getDescription(), '[optional]'); + $parameter->markedOptionalInPhpDoc = str_contains((string)$relatedParamTag->getDescription(), '[optional]'); } } diff --git a/tests/Model/PHPParameter.php b/tests/Model/PHPParameter.php index c335996a7..a44585576 100644 --- a/tests/Model/PHPParameter.php +++ b/tests/Model/PHPParameter.php @@ -23,6 +23,8 @@ class PHPParameter extends BasePHPElement public $is_vararg = false; public $is_passed_by_ref = false; public $isOptional = false; + public $isDefaultValueAvailable = false; + public $markedOptionalInPhpDoc = false; public $defaultValue; /** @@ -39,6 +41,7 @@ public function readObjectFromReflection($reflectionObject) $this->is_passed_by_ref = $reflectionObject->isPassedByReference() && !$reflectionObject->canBePassedByValue(); $this->isOptional = $reflectionObject->isOptional(); $this->indexInSignature = $reflectionObject->getPosition(); + $this->isDefaultValueAvailable = $reflectionObject->isDefaultValueAvailable(); if ($reflectionObject->isDefaultValueAvailable()) { $this->defaultValue = $reflectionObject->getDefaultValue(); if (in_array('bool', $this->typesFromSignature, true)) { diff --git a/tests/StubsConstantsAndParametersValuesTest.php b/tests/StubsConstantsAndParametersValuesTest.php index cc2c58135..43359ce32 100644 --- a/tests/StubsConstantsAndParametersValuesTest.php +++ b/tests/StubsConstantsAndParametersValuesTest.php @@ -57,6 +57,33 @@ public function testFunctionsDefaultParametersValue(PHPFunction $function, PHPPa ); } + /** + * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::functionOptionalParametersWithoutDefaultValueProvider + * @throws Exception|RuntimeException + */ + public function testFunctionsWithoutOptionalDefaultParametersValue(PHPFunction $function, PHPParameter $parameter) + { + $phpstormFunction = PhpStormStubsSingleton::getPhpStormStubs()->getFunction($function->name); + $stubParameters = array_filter($phpstormFunction->parameters, fn (PHPParameter $stubParameter) => $stubParameter->indexInSignature === $parameter->indexInSignature); + /** @var PHPParameter $stubOptionalParameter */ + $stubOptionalParameter = array_pop($stubParameters); + + self::assertTrue(empty($stubOptionalParameter->defaultValue), + sprintf( + 'Stub function "%s" has a parameter "%s" which expected to have no default value but it has', + $function->name, + $stubOptionalParameter->name + ) + ); + self::assertTrue($stubOptionalParameter->markedOptionalInPhpDoc, + sprintf( + 'Stub function "%s" has a parameter "%s" which expected to be marked as [optional] at PHPDoc but it is not', + $function->name, + $stubOptionalParameter->name + ) + ); + } + /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::methodOptionalParametersWithDefaultValueProvider * @throws Exception|RuntimeException @@ -88,4 +115,39 @@ public function testMethodsDefaultParametersValue(PHPClass|PHPInterface $class, ) ); } + + /** + * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionParametersProvider::methodOptionalParametersWithoutDefaultValueProvider + * @throws Exception|RuntimeException + */ + public function testMethodsWithoutOptionalDefaultParametersValue(PHPClass|PHPInterface $class, PHPMethod $method, PHPParameter $parameter) + { + if ($class instanceof PHPEnum) { + $phpstormFunction = PhpStormStubsSingleton::getPhpStormStubs()->getEnum($class->name)->getMethod($method->name); + } elseif ($class instanceof PHPClass) { + $phpstormFunction = PhpStormStubsSingleton::getPhpStormStubs()->getClass($class->name)->getMethod($method->name); + } else { + $phpstormFunction = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($class->name)->getMethod($method->name); + } + $stubParameters = array_filter($phpstormFunction->parameters, fn (PHPParameter $stubParameter) => $stubParameter->indexInSignature === $parameter->indexInSignature); + /** @var PHPParameter $stubOptionalParameter */ + $stubOptionalParameter = array_pop($stubParameters); + + self::assertTrue(empty($stubOptionalParameter->defaultValue), + sprintf( + 'Stub method %s::%s has a parameter "%s" which expected to have no default value but it has', + $class->name, + $method->name, + $stubOptionalParameter->name + ) + ); + self::assertTrue($stubOptionalParameter->markedOptionalInPhpDoc, + sprintf( + 'Stub method %s::%s has a parameter "%s" which expected to be marked as [optional] at PHPDoc but it is not', + $class->name, + $method->name, + $stubOptionalParameter->name + ) + ); + } } diff --git a/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php b/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php index e74e07eec..d5bea6f2b 100644 --- a/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php +++ b/tests/TestData/Providers/Reflection/ReflectionParametersProvider.php @@ -63,6 +63,19 @@ public static function functionOptionalParametersWithDefaultValueProvider(): ?Ge } } + public static function functionOptionalParametersWithoutDefaultValueProvider(): ?Generator + { + foreach (EntitiesFilter::getFilteredFunctions() as $function) { + foreach (EntitiesFilter::getFilteredParameters( + $function, + fn (PHPParameter $parameter) => !$parameter->isOptional || $parameter->isDefaultValueAvailable || $parameter->is_vararg, + StubProblemType::WRONG_PARAMETER_DEFAULT_VALUE + ) as $parameter) { + yield "$function->name($parameter->name)" => [$function, $parameter]; + } + } + } + public static function methodParametersProvider(): ?Generator { $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + @@ -129,7 +142,27 @@ public static function methodOptionalParametersWithDefaultValueProvider(): ?Gene foreach (EntitiesFilter::getFilteredFunctions($class) as $method) { foreach (EntitiesFilter::getFilteredParameters( $method, - fn (PHPParameter $parameter) => !$parameter->isOptional, + fn (PHPParameter $parameter) => !$parameter->isOptional || !$parameter->isDefaultValueAvailable, + StubProblemType::WRONG_PARAMETER_DEFAULT_VALUE + ) as $parameter) { + yield "$class->name::$method->name($parameter->name)" => [$class, $method, $parameter]; + } + } + } + } + } + + public static function methodOptionalParametersWithoutDefaultValueProvider(): ?Generator + { + $classesAndInterfaces = ReflectionStubsSingleton::getReflectionStubs()->getClasses() + + ReflectionStubsSingleton::getReflectionStubs()->getInterfaces(); + foreach (EntitiesFilter::getFiltered($classesAndInterfaces) as $class) { + //exclude classes from PHPReflectionParser + if (strncmp($class->name, 'PHP', 3) !== 0) { + foreach (EntitiesFilter::getFilteredFunctions($class) as $method) { + foreach (EntitiesFilter::getFilteredParameters( + $method, + fn (PHPParameter $parameter) => !$parameter->isOptional || $parameter->isDefaultValueAvailable || $parameter->is_vararg, StubProblemType::WRONG_PARAMETER_DEFAULT_VALUE ) as $parameter) { yield "$class->name::$method->name($parameter->name)" => [$class, $method, $parameter]; From d499a2f314941f737b31e97830b15af6e05e08a3 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 13 Sep 2023 16:07:02 +0200 Subject: [PATCH 395/419] [phpstorm-stubs] test commit. --- tests/StubsConstantsAndParametersValuesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/StubsConstantsAndParametersValuesTest.php b/tests/StubsConstantsAndParametersValuesTest.php index 43359ce32..bcb837649 100644 --- a/tests/StubsConstantsAndParametersValuesTest.php +++ b/tests/StubsConstantsAndParametersValuesTest.php @@ -135,7 +135,7 @@ public function testMethodsWithoutOptionalDefaultParametersValue(PHPClass|PHPInt self::assertTrue(empty($stubOptionalParameter->defaultValue), sprintf( - 'Stub method %s::%s has a parameter "%s" which expected to have no default value but it has', + 'Stub method %s::%s has a parameter "%s" which expected to have no default value but it has ', $class->name, $method->name, $stubOptionalParameter->name From b0598dc805445714bf36abc0f99d9e4be784d720 Mon Sep 17 00:00:00 2001 From: LolGleb Date: Wed, 13 Sep 2023 16:08:01 +0200 Subject: [PATCH 396/419] [phpstorm-stubs] revert test commit. --- tests/StubsConstantsAndParametersValuesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/StubsConstantsAndParametersValuesTest.php b/tests/StubsConstantsAndParametersValuesTest.php index bcb837649..43359ce32 100644 --- a/tests/StubsConstantsAndParametersValuesTest.php +++ b/tests/StubsConstantsAndParametersValuesTest.php @@ -135,7 +135,7 @@ public function testMethodsWithoutOptionalDefaultParametersValue(PHPClass|PHPInt self::assertTrue(empty($stubOptionalParameter->defaultValue), sprintf( - 'Stub method %s::%s has a parameter "%s" which expected to have no default value but it has ', + 'Stub method %s::%s has a parameter "%s" which expected to have no default value but it has', $class->name, $method->name, $stubOptionalParameter->name From ed9f6d8b529826bfb82b5d39b2d3697cbfc962bf Mon Sep 17 00:00:00 2001 From: LolGleb Date: Thu, 14 Sep 2023 09:42:52 +0200 Subject: [PATCH 397/419] [phpstorm-stubs] cs-fixer. --- tests/StubsConstantsAndParametersValuesTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/StubsConstantsAndParametersValuesTest.php b/tests/StubsConstantsAndParametersValuesTest.php index 43359ce32..f01db390d 100644 --- a/tests/StubsConstantsAndParametersValuesTest.php +++ b/tests/StubsConstantsAndParametersValuesTest.php @@ -68,14 +68,16 @@ public function testFunctionsWithoutOptionalDefaultParametersValue(PHPFunction $ /** @var PHPParameter $stubOptionalParameter */ $stubOptionalParameter = array_pop($stubParameters); - self::assertTrue(empty($stubOptionalParameter->defaultValue), + self::assertTrue( + empty($stubOptionalParameter->defaultValue), sprintf( 'Stub function "%s" has a parameter "%s" which expected to have no default value but it has', $function->name, $stubOptionalParameter->name ) ); - self::assertTrue($stubOptionalParameter->markedOptionalInPhpDoc, + self::assertTrue( + $stubOptionalParameter->markedOptionalInPhpDoc, sprintf( 'Stub function "%s" has a parameter "%s" which expected to be marked as [optional] at PHPDoc but it is not', $function->name, @@ -133,15 +135,17 @@ public function testMethodsWithoutOptionalDefaultParametersValue(PHPClass|PHPInt /** @var PHPParameter $stubOptionalParameter */ $stubOptionalParameter = array_pop($stubParameters); - self::assertTrue(empty($stubOptionalParameter->defaultValue), + self::assertTrue( + empty($stubOptionalParameter->defaultValue), sprintf( 'Stub method %s::%s has a parameter "%s" which expected to have no default value but it has', $class->name, $method->name, $stubOptionalParameter->name ) - ); - self::assertTrue($stubOptionalParameter->markedOptionalInPhpDoc, + ); + self::assertTrue( + $stubOptionalParameter->markedOptionalInPhpDoc, sprintf( 'Stub method %s::%s has a parameter "%s" which expected to be marked as [optional] at PHPDoc but it is not', $class->name, From 056963947791367370aa2a593b439ad1631af86f Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Tue, 2 May 2023 20:41:01 +1000 Subject: [PATCH 398/419] adding opentelemetry extension stubs --- PhpStormStubsMap.php | 1 + opentelemetry/opentelemetry.php | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 opentelemetry/opentelemetry.php diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 69270a021..4bbb35d19 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -1385,6 +1385,7 @@ final class PhpStormStubsMap 'MongoDB\\BSON\\toRelaxedExtendedJSON' => 'mongodb/BSON/functions.php', 'MongoDB\\Driver\\Monitoring\\addSubscriber' => 'mongodb/Monitoring/functions.php', 'MongoDB\\Driver\\Monitoring\\removeSubscriber' => 'mongodb/Monitoring/functions.php', + 'OpenTelemetry\\Instrumentation\\hook' => 'opentelemetry/opentelemetry.php', 'PDF_activate_item' => 'pdflib/PDFlib.php', 'PDF_add_launchlink' => 'pdflib/PDFlib.php', 'PDF_add_locallink' => 'pdflib/PDFlib.php', diff --git a/opentelemetry/opentelemetry.php b/opentelemetry/opentelemetry.php new file mode 100644 index 000000000..5aa2c42f6 --- /dev/null +++ b/opentelemetry/opentelemetry.php @@ -0,0 +1,23 @@ + Date: Tue, 22 Aug 2023 08:49:54 +1000 Subject: [PATCH 399/419] adding opentelemetry to PhpCoreStubsProvider --- tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php index 420eb3f87..82cfc3faf 100644 --- a/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php +++ b/tests/TestData/Providers/Stubs/PhpCoreStubsProvider.php @@ -124,6 +124,7 @@ class PhpCoreStubsProvider 'mysql_xdevapi', 'ncurses', 'oauth', + 'opentelemetry', 'pam', 'parallel', 'Parle', From 0096b3ccd4102acf967ee66814fee75b7722168d Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Tue, 3 Oct 2023 09:03:14 +1100 Subject: [PATCH 400/419] fixing param typehint --- opentelemetry/opentelemetry.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry/opentelemetry.php b/opentelemetry/opentelemetry.php index 5aa2c42f6..564644888 100644 --- a/opentelemetry/opentelemetry.php +++ b/opentelemetry/opentelemetry.php @@ -5,7 +5,7 @@ use Closure; /** - * @param string|null $class The (optional) hooked function's class. Null for a global/built-in function. + * @param string|null $class The hooked function's class. Null for a global/built-in function. * @param string $function The hooked function's name. * @param Closure|null $pre function($class, array $params, string $class, string $function, ?string $filename, ?int $lineno): $params * You may optionally return modified parameters. @@ -16,7 +16,7 @@ * @see https://github.com/open-telemetry/opentelemetry-php-instrumentation */ function hook( - ?string $class, + string|null $class, string $function, ?Closure $pre = null, ?Closure $post = null, From eeda88f957475b36e9974a7ac69380c1a36a8aea Mon Sep 17 00:00:00 2001 From: Jon <24463871+j-applese3d@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:24:33 -0700 Subject: [PATCH 401/419] get rid of misleading version string --- standard/standard_9.php | 1 - 1 file changed, 1 deletion(-) diff --git a/standard/standard_9.php b/standard/standard_9.php index cf0d340de..03b005473 100644 --- a/standard/standard_9.php +++ b/standard/standard_9.php @@ -113,7 +113,6 @@ function array_values(array $array): array {} function array_count_values(array $array): array {} /** - * (PHP 5 >=5.5.0)
    * Return the values from a single column in the input array * @link https://secure.php.net/manual/en/function.array-column.php * @param array $array

    A multi-dimensional array (record set) from which to pull a column of values.

    From 63fb4120aef7802b708d308e1bfb4a3aac98466e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kr=C3=BCss?= Date: Fri, 6 Oct 2023 09:42:01 -0700 Subject: [PATCH 402/419] sync stubs with Relay v0.6.8 --- PhpStormStubsMap.php | 1 + relay/Relay.php | 49 +++++++++++++++++++++-------- relay/Sentinel.php | 10 ++++-- relay/Table.php | 73 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 15 deletions(-) create mode 100644 relay/Table.php diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 4bbb35d19..d7164f8e7 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -872,6 +872,7 @@ final class PhpStormStubsMap 'Relay\\KeyType' => 'relay/KeyType.php', 'Relay\\Relay' => 'relay/Relay.php', 'Relay\\Sentinel' => 'relay/Sentinel.php', + 'Relay\\Table' => 'relay/Table.php', 'ResourceBundle' => 'intl/intl.php', 'ReturnTypeWillChange' => 'Core/Core_c.php', 'RuntimeException' => 'SPL/SPL.php', diff --git a/relay/Relay.php b/relay/Relay.php index 184b5d908..8962353bb 100644 --- a/relay/Relay.php +++ b/relay/Relay.php @@ -12,14 +12,14 @@ class Relay * * @var string */ - public const VERSION = "0.6.2"; + public const VERSION = "0.6.8"; /** * Relay's version. * * @var string */ - public const Version = "0.6.2"; + public const Version = "0.6.8"; /** * Integer representing no compression algorithm. @@ -407,7 +407,7 @@ class Relay /** * Establishes a new connection to Redis, or re-uses already opened connection. * - * @param string $host + * @param string|array|null $host * @param int $port * @param float $connect_timeout * @param float $command_timeout @@ -415,11 +415,12 @@ class Relay */ #[\Relay\Attributes\Server] public function __construct( - string $host = null, + string|array|null $host = null, int $port = 6379, float $connect_timeout = 0.0, float $command_timeout = 0.0, - #[\SensitiveParameter] array $context = [], + #[\SensitiveParameter] + array $context = [], int $database = 0, ) {} @@ -445,7 +446,8 @@ public function connect( ?string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0.0, - #[\SensitiveParameter] array $context = [], + #[\SensitiveParameter] + array $context = [], int $database = 0 ): bool {} @@ -470,7 +472,8 @@ public function pconnect( ?string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0.0, - #[\SensitiveParameter] array $context = [], + #[\SensitiveParameter] + array $context = [], int $database = 0 ): bool {} @@ -813,10 +816,10 @@ public static function license(): array {} * - `stats.ops_per_sec`: The number of commands processed per second * - `stats.bytes_sent`: The number of bytes Relay has written to the network * - `stats.bytes_received`: The number of bytes Relay has read from the network - * - `stats.command_usec`: The number of microseconds Relay has spent executing commands - * - `stats.rinit_usec`: The number of microseconds Relay has spent in request initialization. - * - `stats.rshutdown_usec`: The number of microseconds Relay has spent in request shutdown. - * - `stats.sigio_usec`: The number of microseconds Relay has spent in its SIGIO handler. + * - `stats.command_usec`: Deprecated + * - `stats.rinit_usec`: The number of microseconds Relay has spent in request initialization + * - `stats.rshutdown_usec`: The number of microseconds Relay has spent in request shutdown + * - `stats.sigio_usec`: The number of microseconds Relay has spent in its SIGIO handler * * - `memory.total`: The total bytes of allocated memory * - `memory.limit`: The capped number of bytes Relay has available to use @@ -1016,7 +1019,8 @@ public function migrate( int $timeout, bool $copy = false, bool $replace = false, - #[\SensitiveParameter] mixed $credentials = null + #[\SensitiveParameter] + mixed $credentials = null ): Relay|bool {} /** @@ -1403,6 +1407,17 @@ public function getbit(mixed $key, int $pos): Relay|int|false {} #[\Relay\Attributes\RedisCommand, \Relay\Attributes\Cached] public function bitcount(mixed $key, int $start = 0, int $end = -1, bool $by_bit = false): Relay|int|false {} + /** + * Perform various bitfield operations on a string key, such as getting/setting bit ranges, + * incrementing, etc. + * + * @param mixed $key + * @param mixed $args,... + * @return Relay|array|false + */ + #[\Relay\Attributes\RedisCommand] + public function bitfield(mixed $key, mixed ...$args): Relay|array|false {} + /** * This is a container command for runtime configuration commands. * @@ -1577,6 +1592,16 @@ public function psetex(mixed $key, int $milliseconds, mixed $value): Relay|bool #[\Relay\Attributes\RedisCommand] public function publish(string $channel, string $message): Relay|int|false {} + /** + * A container command for Pub/Sub introspection commands. + * + * @param string $operation + * @param mixed $args,... + * @return mixed + */ + #[\Relay\Attributes\RedisCommand] + public function pubsub(string $operation, mixed ...$args): mixed {} + /** * Posts a message to the given shard channel. * diff --git a/relay/Sentinel.php b/relay/Sentinel.php index e2a14c4df..fdd99a00d 100644 --- a/relay/Sentinel.php +++ b/relay/Sentinel.php @@ -27,7 +27,10 @@ class Sentinel /** * Establishes a new connection to a Sentinel instance. * - * @param string $host + * For backwards compatibility with PhpRedis 6.x, the + * constructor may be called with a single options array. + * + * @param array|string|null $host * @param int $port * @param float $timeout * @param mixed $persistent @@ -37,13 +40,14 @@ class Sentinel */ #[\Relay\Attributes\Server] public function __construct( - string $host, + array|string|null $host = null, int $port = 26379, float $timeout = 0, mixed $persistent = null, int $retry_interval = 0, float $read_timeout = 0, - #[\SensitiveParameter] mixed $auth = null + #[\SensitiveParameter] + mixed $auth = null ) {} /** diff --git a/relay/Table.php b/relay/Table.php new file mode 100644 index 000000000..3225c003d --- /dev/null +++ b/relay/Table.php @@ -0,0 +1,73 @@ + Date: Fri, 6 Oct 2023 09:48:23 -0700 Subject: [PATCH 403/419] fix Table stub --- relay/Table.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/relay/Table.php b/relay/Table.php index 3225c003d..0ec5ee437 100644 --- a/relay/Table.php +++ b/relay/Table.php @@ -12,7 +12,7 @@ class Table * * @param int $serializer */ - public function __construct(int $serializer = \Relay\Relay::SERIALIZER_PHP); + public function __construct(int $serializer = \Relay\Relay::SERIALIZER_PHP) {} /** * Get a key from the table. @@ -21,7 +21,7 @@ public function __construct(int $serializer = \Relay\Relay::SERIALIZER_PHP); * @param string $key * @return mixed */ - public function get(string $key): mixed; + public function get(string $key): mixed {} /** * Get a field of a cached key. This is an array lookup. @@ -30,7 +30,7 @@ public function get(string $key): mixed; * @param string $field * @return mixed */ - public function getField(string $key, string $field): mixed; + public function getField(string $key, string $field): mixed {} /** * Set a key in the table. @@ -39,7 +39,7 @@ public function getField(string $key, string $field): mixed; * @param mixed $value; * @return bool */ - public function set(string $key, mixed $value): bool; + public function set(string $key, mixed $value): bool {} /** * Check if a key exists in the table. @@ -47,7 +47,7 @@ public function set(string $key, mixed $value): bool; * @param string $key * @return bool */ - public function exists(string $key): bool; + public function exists(string $key): bool {} /** * Remove a key from the table. @@ -55,19 +55,19 @@ public function exists(string $key): bool; * @param string $key * @return bool */ - public function delete(string $key): bool; + public function delete(string $key): bool {} /** * Removes all keys from the table. * * @return bool */ - public function clear(): bool; + public function clear(): bool {} /** * Get the number of keys stored in the table. * * @return int */ - public function count(): int; -} \ No newline at end of file + public function count(): int {} +} From f17790083dfe441db94fd96ff139dc5e54f336c4 Mon Sep 17 00:00:00 2001 From: schlndh Date: Fri, 13 Oct 2023 12:35:24 +0200 Subject: [PATCH 404/419] fix SplHeap::extract phpdoc return type --- SPL/SPL_c1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPL/SPL_c1.php b/SPL/SPL_c1.php index 402779ade..23815b60e 100644 --- a/SPL/SPL_c1.php +++ b/SPL/SPL_c1.php @@ -1372,7 +1372,7 @@ abstract class SplHeap implements Iterator, Countable /** * Extracts a node from top of the heap and sift up. * @link https://php.net/manual/en/splheap.extract.php - * @return mixed The value of the extracted node. + * @return TValue The value of the extracted node. */ #[TentativeType] public function extract(): mixed {} From 26462cb5c09c983cfd9beb78ec47b75f5cb8c162 Mon Sep 17 00:00:00 2001 From: Evgeny Mazovetskiy Date: Thu, 12 Oct 2023 11:06:20 +0200 Subject: [PATCH 405/419] more accurate replacement for utf8_encode and utf8_decode The problem is that both deprecated functions convert unconditionally between utf-8 and iso-8859-1. But mb_convert_encoding works differently if the from_encoding parameter is missing: " If from_encoding is omitted or null, the mbstring.internal_encoding setting will be used if set, otherwise the default_charset setting." --- standard/basic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/basic.php b/standard/basic.php index 4bf527e93..50fb3ea9c 100644 --- a/standard/basic.php +++ b/standard/basic.php @@ -81,7 +81,7 @@ function is_iterable(mixed $value): bool {} * @deprecated 8.2 Consider to use {@link mb_convert_encoding}, {@link UConverter::transcode()} or {@link iconv()} */ #[Pure] -#[Deprecated(replacement: "mb_convert_encoding(%parameter0%, 'UTF-8')", since: "8.2")] +#[Deprecated(replacement: "mb_convert_encoding(%parameter0%, 'UTF-8', 'ISO-8859-1')", since: "8.2")] function utf8_encode(string $string): string {} /** @@ -95,7 +95,7 @@ function utf8_encode(string $string): string {} * @deprecated 8.2 Consider to use {@link mb_convert_encoding}, {@link UConverter::transcode()} or {@link iconv()} */ #[Pure] -#[Deprecated(replacement: "mb_convert_encoding(%parameter0%, 'ISO-8859-1')", since: "8.2")] +#[Deprecated(replacement: "mb_convert_encoding(%parameter0%, 'ISO-8859-1', 'UTF-8')", since: "8.2")] function utf8_decode(string $string): string {} /** From 86c2d3c470409e5841908bfc6392d3ef10233111 Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Tue, 24 Oct 2023 22:56:27 +0200 Subject: [PATCH 406/419] Update phpredis docs of timeout option Ref: https://github.com/phpredis/phpredis/pull/1983/files --- redis/Redis.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/redis/Redis.php b/redis/Redis.php index f6146b689..f01caf329 100644 --- a/redis/Redis.php +++ b/redis/Redis.php @@ -154,10 +154,10 @@ public function __construct($options = null) {} * * @param string $host can be a host, or the path to a unix domain socket * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) + * @param float $timeout value in seconds (optional, default is 0.0 meaning it will use `default_socket_timeout`) * @param string|null $persistent_id identity for the requested persistent connection * @param int $retry_interval retry interval in milliseconds. - * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) + * @param float $read_timeout value in seconds (optional, default is 0 meaning it will use `default_socket_timeout`) * @param array|null $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on error @@ -189,10 +189,10 @@ public function connect( * * @param string $host can be a host, or the path to a unix domain socket * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) + * @param float $timeout value in seconds (optional, default is 0.0 meaning it will use `default_socket_timeout`) * @param string $persistent_id identity for the requested persistent connection * @param int $retry_interval retry interval in milliseconds. - * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) + * @param float $read_timeout value in seconds (optional, default is 0 meaning it will use `default_socket_timeout`) * @param array $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on error @@ -304,10 +304,10 @@ public function getAuth() {} * * @param string $host can be a host, or the path to a unix domain socket * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) + * @param float $timeout value in seconds (optional, default is 0.0 meaning it will use `default_socket_timeout`) * @param string|null $persistent_id identity for the requested persistent connection * @param int $retry_interval retry interval in milliseconds. - * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) + * @param float $read_timeout value in seconds (optional, default is 0 meaning it will use `default_socket_timeout`) * @param array|null $context since PhpRedis >= 5.3.0 can specify authentication and stream information on connect * * @return bool TRUE on success, FALSE on error. From 290cc67092434f89c3bdb21f53a746df15e442e8 Mon Sep 17 00:00:00 2001 From: Artemy Pestretsov Date: Mon, 30 Oct 2023 11:31:15 +0100 Subject: [PATCH 407/419] WI-74324 PHP8.3 Deprecations: deprecate NumberFormatter::TYPE_CURRENCY, MT_RAND_PHP constants --- intl/intl.php | 1 + standard/standard_defines.php | 1 + 2 files changed, 2 insertions(+) diff --git a/intl/intl.php b/intl/intl.php index a328d1c5c..478c2f451 100644 --- a/intl/intl.php +++ b/intl/intl.php @@ -914,6 +914,7 @@ class NumberFormatter /** * Format/parse as currency value * @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants + * @deprecated 8.3 */ public const TYPE_CURRENCY = 4; diff --git a/standard/standard_defines.php b/standard/standard_defines.php index d08e6d4ad..51a3b1117 100644 --- a/standard/standard_defines.php +++ b/standard/standard_defines.php @@ -1267,6 +1267,7 @@ define("MT_RAND_MT19937", 0); /** * @since 7.1 + * @deprecated 8.3 */ define("MT_RAND_PHP", 1); From 1f6e11802b10ee218762dbd5d9b80974d33d6f51 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 30 Oct 2023 18:13:52 +0100 Subject: [PATCH 408/419] [phpstorm-stubs] update Dockerfile for 8.3 to RC5 --- tests/DockerImages/8.3/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DockerImages/8.3/Dockerfile b/tests/DockerImages/8.3/Dockerfile index 648f1f1d8..a783329c6 100644 --- a/tests/DockerImages/8.3/Dockerfile +++ b/tests/DockerImages/8.3/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3.0RC1-alpine +FROM php:8.3.0RC5-alpine RUN set -eux; \ apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community --no-cache --virtual .build-deps \ From ccdaadeec0718ba9f68124428555b1067d90a101 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 30 Oct 2023 18:30:23 +0100 Subject: [PATCH 409/419] [phpstorm-stubs] Update DOM stubs for serialization https://github.com/php/php-src/issues/8996 --- dom/dom_c.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dom/dom_c.php b/dom/dom_c.php index 6692cca21..c8d153273 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -390,6 +390,16 @@ public function contains(DOMNode|DOMNameSpaceNode|null $other): bool {} * @since 8.3 */ public function getRootNode(?array $options = null): DOMNode {} + + /** + * @since 8.1 + */ + public function __sleep() {} + + /** + * @since 8.1 + */ + public function __wakeup() {} } /** @@ -578,6 +588,16 @@ class DOMNameSpaceNode public $nodeName; public ?DOMElement $parentElement; public bool $isConnected; + + /** + * @since 8.1 + */ + public function __sleep(): array {} + + /** + * @since 8.1 + */ + public function __wakeup(): void {} } /** From 82d7d4444ea02555fa9877c026df9a9ffeb33b64 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 30 Oct 2023 18:33:43 +0100 Subject: [PATCH 410/419] [phpstorm-stubs] Update return type for xml_parse_into_struct --- xml/xml.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xml/xml.php b/xml/xml.php index 151fa8399..a66b10028 100644 --- a/xml/xml.php +++ b/xml/xml.php @@ -371,7 +371,8 @@ function xml_parse(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "re * success. This is not the same as FALSE and TRUE, be careful with * operators such as ===. */ -function xml_parse_into_struct(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, string $data, &$values, &$index): int {} +#[LanguageLevelTypeAware(['8.1' => 'int|false'], default: 'int')] +function xml_parse_into_struct(#[LanguageLevelTypeAware(["8.0" => "XMLParser"], default: "resource")] $parser, string $data, &$values, &$index) {} /** * Get XML parser error code From 57f671c2c5cc5935f96010d126b5db1e27c61659 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 30 Oct 2023 18:34:06 +0100 Subject: [PATCH 411/419] [phpstorm-stubs] Update value of PCRE_VERSION_MINOR --- pcre/pcre.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcre/pcre.php b/pcre/pcre.php index 7baccb4d3..17aee6e70 100644 --- a/pcre/pcre.php +++ b/pcre/pcre.php @@ -629,7 +629,7 @@ function preg_last_error_msg(): string {} /** * @since 7.3 */ -define('PCRE_VERSION_MINOR', 40); +define('PCRE_VERSION_MINOR', 42); /** * @since 7.3 From 1720f96770005c3878c89b1e8c618251820a6d40 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Mon, 30 Oct 2023 19:39:14 +0100 Subject: [PATCH 412/419] [phpstorm-stubs] Fix return type of DOMNode::__sleep and DOMNode::__wakeup --- dom/dom_c.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/dom_c.php b/dom/dom_c.php index c8d153273..69cd4c433 100644 --- a/dom/dom_c.php +++ b/dom/dom_c.php @@ -394,12 +394,12 @@ public function getRootNode(?array $options = null): DOMNode {} /** * @since 8.1 */ - public function __sleep() {} + public function __sleep(): array {} /** * @since 8.1 */ - public function __wakeup() {} + public function __wakeup(): void {} } /** From 99d8bcab934ae5362f33660b1cd4b8c4d617c40b Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Wed, 1 Nov 2023 19:52:29 +0100 Subject: [PATCH 413/419] [phpstorm-stubs] deprecate dba_fetch with 3 parameters since 8.3 https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures --- dba/dba.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dba/dba.php b/dba/dba.php index fbf439622..773a54df4 100644 --- a/dba/dba.php +++ b/dba/dba.php @@ -1,6 +1,7 @@ FALSE * otherwise. */ +#[Deprecated(since: 8.3)] function dba_fetch($key, $skip, $dba): string|false {} /** From dacc7b6b9f4c0ce9d6d74b25d0486da944404564 Mon Sep 17 00:00:00 2001 From: Tom Klingenberg Date: Wed, 1 Nov 2023 06:36:36 +0100 Subject: [PATCH 414/419] Fix SPL ArrayObject::__construct(, $flags, $iteratorClass) Element is available from PHP 5.1, not 7.0. [1] The lowest common denominator is 5.3. Phpunit reports one argument on PHP 5.6 (reflection). [1]: https://github.com/php/php-src/blob/php-5.1.0/ext/spl/spl_array.c#L787 --- SPL/SPL.php | 4 ++-- tests/TestData/mutedProblems.json | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/SPL/SPL.php b/SPL/SPL.php index abc3a6619..74420a300 100644 --- a/SPL/SPL.php +++ b/SPL/SPL.php @@ -1551,8 +1551,8 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'object|array'], default: '')] $array = [], - #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, - #[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $iteratorClass = "ArrayIterator" + #[PhpStormStubsElementAvailable(from: '5.3')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, + #[PhpStormStubsElementAvailable(from: '5.3')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $iteratorClass = "ArrayIterator" ) {} /** diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index e39bc1607..4802b4d98 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -1669,6 +1669,25 @@ } ] }, + { + "name": "ArrayObject", + "methods": [ + { + "name": "__construct", + "problems": [ + { + "description": "parameter mismatch", + "versions": [ + 5.3, + 5.4, + 5.5, + 5.6 + ] + } + ] + } + ] + }, { "name": "RecursiveRegexIterator", "methods": [ From e967b6091625e165539e5f4b82bc3ac36a16d531 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 3 Nov 2023 12:07:27 +0100 Subject: [PATCH 415/419] [phpstorm-stubs] WI-74924 add rpmaddtag function stub --- PhpStormStubsMap.php | 1 + rpminfo/rpminfo.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index d7164f8e7..ff640eea9 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -4922,6 +4922,7 @@ final class PhpStormStubsMap 'rewinddir' => 'standard/standard_7.php', 'rmdir' => 'standard/standard_5.php', 'round' => 'standard/standard_3.php', + 'rpmaddtag' => 'rpminfo/rpminfo.php', 'rpmdbinfo' => 'rpminfo/rpminfo.php', 'rpmdbsearch' => 'rpminfo/rpminfo.php', 'rpminfo' => 'rpminfo/rpminfo.php', diff --git a/rpminfo/rpminfo.php b/rpminfo/rpminfo.php index c0be9dacb..63ece9e55 100644 --- a/rpminfo/rpminfo.php +++ b/rpminfo/rpminfo.php @@ -354,3 +354,13 @@ function rpmdbinfo(string $nevr, bool $full = false) {} * @since 0.3.0 */ function rpmdbsearch(string $pattern, int $rpmtag = RPMTAG_NAME, int $rpmmire = -1, bool $full = false) {} + +/** + * Add an additional retrieved tag in subsequent queries. + * + * @param int $tag One of RPMTAG_* constant, see the rpminfo constants page. + * + * @return bool Returns true on success or false on failure. + * @since 0.5.0 + */ +function rpmaddtag(int $tag): bool {} From 13e37a8a9e7d56d3b118d51de9a6e0e4ddf216b9 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 3 Nov 2023 12:43:57 +0100 Subject: [PATCH 416/419] [phpstorm-stubs] WI-74929 add db2_pclose function stub --- PhpStormStubsMap.php | 1 + ibm_db2/ibm_db2.php | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index ff640eea9..057a03205 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -2063,6 +2063,7 @@ final class PhpStormStubsMap 'db2_next_result' => 'ibm_db2/ibm_db2.php', 'db2_num_fields' => 'ibm_db2/ibm_db2.php', 'db2_num_rows' => 'ibm_db2/ibm_db2.php', + 'db2_pclose' => 'ibm_db2/ibm_db2.php', 'db2_pconnect' => 'ibm_db2/ibm_db2.php', 'db2_prepare' => 'ibm_db2/ibm_db2.php', 'db2_primary_keys' => 'ibm_db2/ibm_db2.php', diff --git a/ibm_db2/ibm_db2.php b/ibm_db2/ibm_db2.php index b074a0baf..c451bf094 100644 --- a/ibm_db2/ibm_db2.php +++ b/ibm_db2/ibm_db2.php @@ -97,6 +97,19 @@ function db2_commit($connection): bool {} */ function db2_pconnect(#[\SensitiveParameter] string $database, ?string $username, #[\SensitiveParameter] ?string $password, array $options = []) {} +/** + * Closes a persistent database connection + * + * This function closes a persistent DB2 client connection. + * + * @link https://php.net/manual/en/function.db2-pclose.php + * + * @param resource $connection Specifies a persistent DB2 client connection. + * + * @return bool Returns true on success or false on failure. + */ +function db2_pclose($connection): bool {} + /** * Returns or sets the AUTOCOMMIT state for a database connection * @link https://php.net/manual/en/function.db2-autocommit.php From 3b4c0b0701790046f2be48d0821ca4b7532126a1 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 3 Nov 2023 12:54:06 +0100 Subject: [PATCH 417/419] [phpstorm-stubs] WI-74930 add cubrid_lob2_write function stub --- PhpStormStubsMap.php | 1 + cubrid/cubrid.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 057a03205..80ca450f8 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -1910,6 +1910,7 @@ final class PhpStormStubsMap 'cubrid_lob2_size64' => 'cubrid/cubrid.php', 'cubrid_lob2_tell' => 'cubrid/cubrid.php', 'cubrid_lob2_tell64' => 'cubrid/cubrid.php', + 'cubrid_lob2_write' => 'cubrid/cubrid.php', 'cubrid_lob_close' => 'cubrid/cubrid.php', 'cubrid_lob_export' => 'cubrid/cubrid.php', 'cubrid_lob_get' => 'cubrid/cubrid.php', diff --git a/cubrid/cubrid.php b/cubrid/cubrid.php index b70d7c98b..ff8b4cf00 100644 --- a/cubrid/cubrid.php +++ b/cubrid/cubrid.php @@ -1857,6 +1857,23 @@ function cubrid_set_drop($conn_identifier, $oid, $attr_name, $set_element) {} */ function cubrid_version() {} +/** + * (PHP 5, CUBRID >= 8.4.0)
    + * Write a string into the LOB large object + * + * @link https://php.net/manual/en/function.cubrid-lob2-write.php + * @param resource $lob_identifier

    + * LOB identifier obtained by cubrid_lob2_new() or cubrid_lob2_import(). + *

    + * @param string $buf

    + * The string to be written into the LOB. + *

    + * @return bool

    + * Returns true on success, false on failure. + *

    + */ +function cubrid_lob2_write($lob_identifier, string $buf): bool {} + /** * Columns are returned into the array having a numerical index to the * fields. This index starts with 0, the first field in the result. From 7d1ce85e746f91e96efdd029c824443815b6f10f Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 3 Nov 2023 13:31:13 +0100 Subject: [PATCH 418/419] [phpstorm-stubs] WI-74925 add oci_set_prefetch_lob function stub --- PhpStormStubsMap.php | 1 + oci8/oci8v3.php | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 80ca450f8..d5f130868 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -4400,6 +4400,7 @@ final class PhpStormStubsMap 'oci_set_edition' => 'oci8/oci8.php', 'oci_set_module_name' => 'oci8/oci8.php', 'oci_set_prefetch' => 'oci8/oci8.php', + 'oci_set_prefetch_lob' => 'oci8/oci8v3.php', 'oci_statement_type' => 'oci8/oci8.php', 'oci_unregister_taf_callback' => 'oci8/oci8.php', 'ocibindbyname' => 'oci8/oci8.php', diff --git a/oci8/oci8v3.php b/oci8/oci8v3.php index 03f25c9d7..1193f9de4 100644 --- a/oci8/oci8v3.php +++ b/oci8/oci8v3.php @@ -392,3 +392,15 @@ function oci_set_call_timeout($connection, int $time_out) {} * @return bool TRUE on success or FALSE on failure. */ function oci_set_db_operation($connection, string $dbop) {} + +/** + * Sets the size of the LOB column that will be prefetched by OCI8 when executing a query. + * This can improve performance when working with large LOB data. + * + * @param resource $statement The OCI8 statement resource. + * @param int $prefetch_lob_size The size of the LOB column, in bytes, to be prefetched. + * @return bool Returns TRUE on success or FALSE on failure. + * @link https://php.net/manual/en/function.oci-set-prefetch-lob.php + * @since 8.2 + */ +function oci_set_prefetch_lob($statement, int $prefetch_lob_size): bool {} From b7dbc3c356a259680b08c314a95337e16bdb5d44 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Fri, 3 Nov 2023 13:38:01 +0100 Subject: [PATCH 419/419] [phpstorm-stubs] WI-74921 add ssh2_send_eof function stub --- PhpStormStubsMap.php | 1 + ssh2/ssh2.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index d5f130868..81f53c6c6 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -5308,6 +5308,7 @@ final class PhpStormStubsMap 'ssh2_publickey_remove' => 'ssh2/ssh2.php', 'ssh2_scp_recv' => 'ssh2/ssh2.php', 'ssh2_scp_send' => 'ssh2/ssh2.php', + 'ssh2_send_eof' => 'ssh2/ssh2.php', 'ssh2_sftp' => 'ssh2/ssh2.php', 'ssh2_sftp_chmod' => 'ssh2/ssh2.php', 'ssh2_sftp_lstat' => 'ssh2/ssh2.php', diff --git a/ssh2/ssh2.php b/ssh2/ssh2.php index 2f239d713..d88506b4f 100644 --- a/ssh2/ssh2.php +++ b/ssh2/ssh2.php @@ -713,6 +713,21 @@ function ssh2_sftp_chmod($sftp, $filename, $mode) {} */ function ssh2_auth_agent($session, $username) {} +/** + * (PECL ssh2 >= 1.0)
    + * Send end-of-file signal through an SSH2 channel + * + * @param resource $channel

    + * The SSH2 channel resource created by ssh2_shell, + * ssh2_exec, or ssh2_tunnel. + *

    + * + * @return bool Returns true on success or false on failure. + * + * @link https://php.net/manual/en/function.ssh2-send-eof.php + */ +function ssh2_send_eof($channel): bool {} + /** * Flag to ssh2_fingerprint requesting hostkey * fingerprint as an MD5 hash.