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/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. diff --git a/Core/Core.php b/Core/Core.php index e5b1857e0..7e4d5b5ac 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 {}
/**
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/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.
diff --git a/PDO/PDO.php b/PDO/PDO.php
index e1fc82d80..98c06135a 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)
@@ -1070,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
@@ -1091,22 +1094,22 @@ 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($query, $fetchMode = 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
+ * @param string $query
* The SQL statement to prepare and execute. *
** Data inside the query should be properly escaped. *
- * @param int $mode+ * @param int|null $fetchMode
* 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. *
@@ -1115,7 +1118,11 @@ 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) {} + public function query( + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, + #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $fetchMode = null, + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$fetch_mode_args + ) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)+ * 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, $finalize_func, $num_args = -1) {} + + /** + * (PHP 5 >= 5.3.11, PHP 7)+ * 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)+ * @param mixed ...$args
* Arguments of custom class constructor when the fetch_style * parameter is PDO::FETCH_CLASS. *
@@ -1713,7 +1754,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)+ * @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+ * @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
+ * @param class-string
* The classname of the array iterator to use when iterating over this object.
*
* The optional assigned values.
* Note: Casting to an array is not supported yet. Note: You can insert at the index equal to the number of values. Note: The values of the current instance won't be
* affected.
+ * @template TCarry
+ * @param callable(TCarry, TValue): TCarry $callback
* Note: The current instance is not affected. Note: Multiple values will be added in the same order that they
* are passed. Note: Values will be compared by value and by type. Note: Casting to an array is not supported yet. Note: Casting to an array is not supported yet.
*
* Note: You can insert at the index equal to the number of values. Note: The values of the current instance won't be
* affected.
* $value The value of the current iteration.
* Note: The current instance is not affected.callback ( mixed $value ) : mixed
@@ -174,7 +181,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 +191,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 Sequencecallback ( mixed $value ) : mixed
- * @return Sequence The result of applying a callback to each value in
+ * @return Sequence
* 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.
* 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 +509,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 +518,7 @@ public function contains(...$values): bool {}
/**
*Returns a shallow copy of the vector.
- * @return Vector Returns a shallow copy of the vector.
+ * @return Vectorcallback ( mixed $value ) : bool
- * @return Vector A new vector containing all the values for which
+ * @return Vector
* You can insert at the index equal to the number of values.
- * @param array $values The value or values to insert.
+ * @param array
The callable should return what the new value will be in the new sequence.
*
- * @return Vector
+ * @return Vector
* Note:
* The current instance won't be affected.
@@ -607,27 +621,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 +651,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 +664,7 @@ public function reverse(): void {}
/**
* Returns a reversed copy of the sequence.
- * @return Vector A reversed copy of the sequence.
+ * @return Vector
* Note: The current instance is not affected.
* @link https://www.php.net/manual/en/ds-vector.reversed.php
*/
@@ -673,7 +688,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 +699,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 +718,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
@@ -735,7 +750,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
+ * @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 +795,7 @@ public function isEmpty(): bool {}
* Converts the collection to an array.
* callback ( mixed $value ) : mixed
@@ -880,7 +922,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 +932,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
* callback ( mixed $value ) : mixed
*
- * @return Deque The result of applying a callback to each value in
+ * @return Dequecallback ( mixed $carry , mixed $value ) : mixed
* $carry The return value of the previous callback, or initial if it's
* the first iteration.
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 @@ -1140,13 +1185,41 @@ 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 {} } - class Map implements Collection + /** + * @template TKey + * @template TValue + * @implements CollectionNote: 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 Mapcallback ( mixed $key , mixed $value ) : mixed
- * @return Map The result of applying a callback to each value in the
+ * @return Mapcallback ( 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 +1577,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 +1596,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 +1616,7 @@ public function reverse() {}
/**
* Returns a reversed copy of the map.
*
- * @return Map A reversed copy of the map.
+ * @return MapNote: The current instance is not affected.
* @@ -1546,7 +1629,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 PairNote: 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 MapNote: 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,14 +1870,16 @@ public function jsonSerialize() {} * @link https://www.php.net/manual/en/class.ds-set.php * * @package Ds + * @template TValue + * @implements CollectionCaution: 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 +1927,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 +1963,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 Note: The values of the current instance won't be affected. Note: The current instance is not affected.callback ( mixed $value ) : mixed
- * @return Set The result of applying a callback to each value in
+ * @return Setcallback ( 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 +2112,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 +2130,7 @@ public function reverse() {}
*
*
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 arrayNote: 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 arrayNote: 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 arrayNote: 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 arrayThe 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) diff --git a/gd/gd.php b/gd/gd.php index 27b74d859..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 @@ -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/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/ibm_db2/ibm_db2.php b/ibm_db2/ibm_db2.php index 9130c7676..b074a0baf 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(#[\SensitiveParameter] 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(#[\SensitiveParameter] 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 mixedWhen 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() {} *
* 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) {} ** 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() {} *
Return value | *Parameter type | *|
0 (SQL_FALSE) | + *false (SQL_FALSE) | *The index allows duplicate values. | *
1 (SQL_TRUE) | + *true (SQL_TRUE) | *The index values must be unique. | *
* 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) ** 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() {} *- * 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 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.*
* @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,87 @@ 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); diff --git a/intl/intl.php b/intl/intl.php index 718e6f8a2..587a55a84 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 $stringThe input string to normalize
- * @param string $form + * @param int $form * @return string|nullReturns 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)* 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)* 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)"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) {}
+}
diff --git a/meta/guzzle/.phpstorm.meta.php b/meta/guzzle/.phpstorm.meta.php
new file mode 100644
index 000000000..2118db218
--- /dev/null
+++ b/meta/guzzle/.phpstorm.meta.php
@@ -0,0 +1,24 @@
+
- * - * A read preference to use for selecting a server for the operation. - *
- *- * A session to associate with the operation. - *
- *+ * @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 @@ -1174,7 +1181,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) {} /** 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/pgsql/pgsql.php b/pgsql/pgsql.php index 90d8ad290..91f899c0a 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
@@ -2065,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', "14.5");
-define('PGSQL_LIBPQ_VERSION_STR', "14.5");
+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,
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 @@
* 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]
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/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
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
- * A character.
+ * A string.
*
+ * @param int<0,max> $seconds
* Halt time in seconds.
*
+ * @param int<0,max> $microseconds
* Halt time in micro seconds. A micro second is one millionth of a
* second.
*
- * The column width.
+ * The number of characters at which the string will be wrapped.
*
* 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).
*
- * 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
*
@@ -2825,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() {}
/**
@@ -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
+ * $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,61 +3979,22 @@ public function bzPopMax($key, $timeout_or_key, ...$extra_args) {}
* @see bzPopMax
* @since >= 5.0
* @link https://redis.io/commands/bzpopmin
- */
- public function bzPopMin($key, $timeout_or_key, ...$extra_args) {}
-
- /**
- * Can pop the highest scoring members from one ZSET.
- *
- * @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 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 $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);
+ * // 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 zPopMin($key, $count = null) {}
+ public function bzPopMin($key_or_keys, $timeout_or_key, ...$extra_args) {}
/**
* Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned.
*
* @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 +4013,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 +4112,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 +4147,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 +4182,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 +4260,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 +4313,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 +4333,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 +4344,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 +4379,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 +4395,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 +4415,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 +4483,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' => [
+ *
+ * @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 +4534,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 +4687,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 +4720,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 +4820,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 +4862,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 +4888,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 +4912,7 @@ public function clearLastError() {}
* $redis->client('kill',
* $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);
@@ -4643,7 +4976,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 +4992,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.
+ *
*/
- 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 +5046,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 +5071,20 @@ 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 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 +5093,31 @@ public function time() {}
* @link https://redis.io/commands/scan
* @example
*
+ * $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 +5022,21 @@ public function dump($key) {}
* $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo'
*
- * $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 +5125,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 +5138,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 +5153,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 +5226,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
+ * # 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 +5329,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 +5370,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 +5390,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 +5412,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 +5436,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 +5459,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 +5478,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 +5503,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 +5516,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 +5526,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 +5549,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 +5572,721 @@ 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.
+ * @since phpredis 6.0
+ */
+ 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.
+ * @since phpredis 6.0
+ */
+ 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.
+ * @since phpredis 6.0
+ */
+ 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.
+ *
+ * @since phpredis 6.0
+ */
+ 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
+ * @since phpredis 6.0
+ *
+ * @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()
+ * @since phpredis 6.0
+ */
+ 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()
+ * @since phpredis 6.0
+ */
+ public function evalsha_ro($sha1, $args = [], $num_keys = 0) {}
+
+ /**
+ * @param array|null $to
+ * @param bool $abort
+ * @param int $timeout
+ *
+ * @return bool|Redis
+ * @since phpredis 6.0
+ */
+ 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
+ * @since phpredis 6.0
+ *
+ * @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()
+ * @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.
+ */
+ 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
+ * @since phpredis 6.0
+ */
+ 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
+ * @since phpredis 6.0
+ */
+ 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
+ * @since phpredis 6.0
+ */
+ 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' =>
- * 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. *
**