intelephense
1.14.41.16.1
lib/stub/ds/ds.phplib/stub/ds/ds.php+80−32
Index: package/lib/stub/ds/ds.php
===================================================================
--- package/lib/stub/ds/ds.php
+++ package/lib/stub/ds/ds.php
@@ -40,9 +40,9 @@
/**
* Returns a shallow copy of the collection.
* @link https://www.php.net/manual/en/ds-collection.copy.php
- * @return Collection<TKey, TValue>
+ * @return static
*/
public function copy();
/**
@@ -381,9 +381,9 @@
public function slice(int $index, int $length = null);
/**
* Sorts the sequence in-place, using an optional comparator function.
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.<p>
@@ -398,9 +398,9 @@
public function sort(?callable $comparator = null): void;
/**
* Returns a sorted copy, using an optional comparator function.
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.<p>
@@ -563,9 +563,9 @@
*/
public function get(int $index) {}
/**
- * @return Traversable<TValue>
+ * @return Traversable<int, TValue>
*/
public function getIterator(): Traversable {}
/**
@@ -581,13 +581,13 @@
/**
* Joins all values together as a string using an optional separator between each value.
*
- * @param string|null $glue An optional string to separate each value.
+ * @param string $glue An optional string to separate each value.
* @return string All values of the sequence joined together as a string.
* @link https://www.php.net/manual/en/ds-vector.join.php
*/
- public function join(?string $glue = null): string {}
+ public function join(string $glue = ''): string {}
/**
* Returns the last value in the sequence.
*
@@ -727,9 +727,9 @@
/**
* Sorts the sequence in-place, using an optional comparator function.
* @link https://www.php.net/manual/en/ds-vector.sort.php
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return an
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return an
* integer less than, equal to, or greater
* than zero if the first argument is considered to be respectively less than, equal to, or greater than the
* second. Note that before PHP 7.0.0 this integer had to be in the
* range from -2147483648 to 2147483647.<br>
@@ -744,9 +744,9 @@
/**
* Returns a sorted copy, using an optional comparator function.
* @link https://www.php.net/manual/en/ds-vector.sorted.php
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return an integer less than, equal to, or
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return an integer less than, equal to, or
* greater than zero if the first argument is considered to be respectively less than, equal to, or greater
* than the second. Note that before PHP 7.0.0 this integer had to be in the range from -2147483648 to
* 2147483647.<br>
* <code>callback ( mixed $a, mixed $b ) : int</code>
@@ -761,11 +761,11 @@
* Returns the sum of all values in the sequence.<br>
* <b>Note:</b> Arrays and objects are considered equal to zero when
* calculating the sum.
* @link https://www.php.net/manual/en/ds-vector.sum.php
- * @return float
+ * @return float|int
*/
- public function sum(): float {}
+ public function sum(): float|int {}
/**
* Adds values to the front of the sequence, moving all the current
* values forward to make room for the new values.
@@ -773,9 +773,9 @@
* <b>Note:</b> Multiple values will be added in the same order that they are
* passed.
* @link https://www.php.net/manual/en/ds-vector.unshift.php
*/
- public function unshift($values): void {}
+ public function unshift(...$values): void {}
/**
* Count elements of an object
* @link https://php.net/manual/en/ds-vector.count.php
@@ -826,8 +826,10 @@
/**
* @param int $offset
* @param TValue $value
+ *
+ * @return void
*/
public function offsetSet(mixed $offset, mixed $value) {}
/**
@@ -843,13 +845,13 @@
class Deque implements Sequence
{
/**
* Creates a new instance, using either a traversable object or an array for the initial values.
- * @param TValue ...$values A traversable object or an array to use for the initial values.
+ * @param iterable<TValue> $values A traversable object or an array to use for the initial values.
*
* @link https://www.php.net/manual/en/ds-deque.construct.php
*/
- public function __construct(...$values) {}
+ public function __construct(iterable $values = []) {}
/**
* Count elements of an object
* @link https://php.net/manual/en/countable.count.php
@@ -874,9 +876,9 @@
*/
public function copy(): Collection {}
/**
- * @return Traversable<TValue>
+ * @return Traversable<int, TValue>
*/
public function getIterator(): Traversable {}
/**
@@ -1131,9 +1133,9 @@
public function slice(int $index, int $length = null): Deque {}
/**
* Sorts the deque in-place, using an optional comparator function.
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.
@@ -1148,9 +1150,9 @@
public function sort(?callable $comparator = null): void {}
/**
* Returns a sorted copy, using an optional comparator function.
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.
@@ -1206,8 +1208,10 @@
/**
* @param int $offset
* @param TValue $value
+ *
+ * @return void
*/
public function offsetSet(mixed $offset, mixed $value) {}
/**
@@ -1224,21 +1228,23 @@
class Map implements Collection, ArrayAccess
{
/**
* Creates a new instance, using either a traversable object or an array for the initial values.
- * @param iterable<TKey, TValue> ...$values A traversable object or an array to use for the initial values.
+ * @param iterable<TKey, TValue> $values A traversable object or an array to use for the initial values.
*
* @link https://www.php.net/manual/en/ds-map.construct.php
*/
- public function __construct(...$values) {}
+ public function __construct(iterable $values = []) {}
/**
* Allocates enough memory for a required capacity.
*
* @param int $capacity The number of values for which capacity should be allocated.<br>
* <p><b>Note:</b> Capacity will stay the same if this value is less than or equal to the current capacity.</p>
* Capacity will always be rounded up to the nearest power of 2.
*
+ * @return void
+ *
* @link https://www.php.net/manual/en/ds-map.allocate.php
*/
public function allocate(int $capacity) {}
@@ -1247,8 +1253,10 @@
*
* @param callable(TKey, TValue): TValue $callback A callable to apply to each value in the map. The callback should return what
* the value should be replaced by.
*
+ * @return void
+ *
* @link https://www.php.net/manual/en/ds-map.apply.php
*/
public function apply(callable $callback) {}
@@ -1348,9 +1356,9 @@
*/
public function get($key, $default = null) {}
/**
- * @return Traversable<TValue>
+ * @return Traversable<TKey, TValue>
*/
public function getIterator(): Traversable {}
/**
@@ -1440,9 +1448,10 @@
public function keys(): Set {}
/**
* Sorts the map in-place by key, using an optional comparator function.
- * @param callable(TKey, TKey):int|null $comparator The comparison function must return
+ *
+ * @param (callable(TKey, TKey):int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.
@@ -1451,15 +1460,16 @@
* 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.</p>
+ * @return void
* @link https://www.php.net/manual/en/ds-map.ksort.php
*/
public function ksort(?callable $comparator = null) {}
/**
* Returns a copy sorted by key, using an optional comparator function.
- * @param callable(TKey, TKey): int|null $comparator The comparison function must return
+ * @param (callable(TKey, TKey): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.
@@ -1468,16 +1478,16 @@
* 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.</p>
- * @return Map<TKeyK, TValueV> Returns a copy of the map, sorted by key.
+ * @return Map<TKey, TValue> Returns a copy of the map, sorted by key.
* @link https://www.php.net/manual/en/ds-map.ksorted.php
*/
public function ksorted(?callable $comparator = null): Map {}
/**
* Returns the last pair of the map.
- * @return Pair<K,V> The last pair of the map.
+ * @return Pair<TKey,TValue> The last pair of the map.
* @throws UnderflowException if empty
* @link https://www.php.net/manual/en/ds-map.last.php
*/
public function last(): Pair {}
@@ -1518,9 +1528,9 @@
/**
* Returns a Ds\Sequence containing all the pairs of the map.
*
- * @return Sequence<Pair<TKey, TValueV>> Ds\Sequence containing all the pairs of the map.
+ * @return Sequence<Pair<TKey, TValue>> Ds\Sequence containing all the pairs of the map.
*
* @link https://www.php.net/manual/en/ds-map.pairs.php
*/
public function pairs(): Sequence {}
@@ -1543,8 +1553,10 @@
* coerced to integers by the engine. For example, $map["1"] will
* attempt to access int(1), while $map->get("1") will correctly look up
* the string key.
*
+ * @return void
+ *
* @link https://www.php.net/manual/en/ds-map.put.php
*/
public function put($key, $value) {}
@@ -1558,8 +1570,10 @@
* considered equal.
*
* @param iterable<TKey, TValue> $pairs traversable object or array.
*
+ * @return void
+ *
* @link https://www.php.net/manual/en/ds-map.putall.php
*/
public function putAll($pairs) {}
@@ -1617,8 +1631,10 @@
/**
* Reverses the map in-place.
*
+ * @return void
+ *
* @link https://www.php.net/manual/en/ds-map.reverse.php
*/
public function reverse() {}
@@ -1671,9 +1687,9 @@
/**
* Sorts the map in-place by value, using an optional comparator
* function.
*
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.
@@ -1685,16 +1701,18 @@
* 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 void
+ *
* @link https://www.php.net/manual/en/ds-map.sort.php
*/
public function sort(?callable $comparator = null) {}
/**
* Returns a copy, sorted by value using an optional comparator function.
*
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.
@@ -1787,8 +1805,10 @@
/**
* @param TKey $offset
* @param TValue $value
+ *
+ * @return void
*/
public function offsetSet(mixed $offset, mixed $value) {}
/**
@@ -1827,8 +1847,10 @@
/**
* Removes all values from the pair.
*
+ * @return void
+ *
* @link https://php.net/manual/en/ds-pair.clear.php
*/
public function clear() {}
@@ -1906,8 +1928,10 @@
* <p><b>Caution:</b> All comparisons are strict (type and value).
*
* @param TValue ...$values Values to add to the set.
*
+ * @return void
+ *
* @link https://php.net/manual/en/ds-set.add.php
*/
public function add(...$values) {}
@@ -1921,8 +1945,10 @@
* equal to the current capacity.
*
* <p>Capacity will always be rounded up to the nearest power of 2.
*
+ * @return void
+ *
* @link https://php.net/manual/en/ds-set.allocate.php
*/
public function allocate(int $capacity) {}
@@ -2028,9 +2054,9 @@
*/
public function get(int $index) {}
/**
- * @return Traversable<TValue>
+ * @return Traversable<int, TValue>
*/
public function getIterator(): Traversable {}
/**
@@ -2065,9 +2091,9 @@
* @param null|string $glue An optional string to separate each value.
*
* @return string
*/
- public function join(?string $glue = null): string {}
+ public function join(string $glue = ''): string {}
/**
* Returns the result of applying a callback function to each value in
* the set.
@@ -2124,14 +2150,18 @@
*
* @link https://www.php.net/manual/en/ds-set.remove.php
*
* @param TValue ...$values The values to remove.
+ *
+ * @return void
*/
public function remove(...$values) {}
/**
* Reverses the set in-place.
*
+ * @return void
+ *
* @link https://www.php.net/manual/en/ds-set.reverse.php
*/
public function reverse() {}
@@ -2178,9 +2208,9 @@
/**
* Sorts the set in-place, using an optional comparator function.
*
- * @param callable(TValue, TValue): int|null $comparator The comparison function must return
+ * @param (callable(TValue, TValue): int)|null $comparator The comparison function must return
* an integer less than, equal to, or greater than zero if the first
* argument is considered to be respectively less than, equal to, or
* greater than the second. Note that before PHP 7.0.0 this integer had
* to be in the range from -2147483648 to 2147483647.
@@ -2190,8 +2220,10 @@
* 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.</note>
*
+ * @return void
+ *
* @link https://www.php.net/manual/en/ds-set.sort.php
*/
public function sort(?callable $comparator = null) {}
@@ -2295,8 +2327,10 @@
/**
* @param int $offset
* @param TValue $value
+ *
+ * @return void
*/
public function offsetSet(mixed $offset, mixed $value) {}
/**
@@ -2337,8 +2371,10 @@
*
* @param int $capacity The number of values for which capacity should
* be allocated.
*
+ * @return void
+ *
* <p><b>Note:</b> Capacity will stay the same if this value is less than or
* equal to the current capacity.</p>
*/
public function allocate(int $capacity) {}
@@ -2376,9 +2412,9 @@
*/
public function copy(): Stack {}
/**
- * @return Traversable<TValue>
+ * @return Traversable<int, TValue>
*/
public function getIterator(): Traversable {}
/**
@@ -2433,8 +2469,10 @@
*
* @link https://www.php.net/manual/en/ds-queue.push.php
*
* @param TValue ...$values The values to push onto the stack.
+ *
+ * @return void
*/
public function push(...$values) {}
/**
@@ -2451,8 +2489,10 @@
/**
* @param int $offset
* @param TValue $value
+ *
+ * @return void
*/
public function offsetSet(mixed $offset, mixed $value) {}
/**
@@ -2493,8 +2533,10 @@
*
* @param int $capacity The number of values for which capacity should
* be allocated.
*
+ * @return void
+ *
* <p><b>Note:</b> Capacity will stay the same if this value is less than or
* equal to the current capacity.</p>
*/
public function allocate(int $capacity) {}
@@ -2532,9 +2574,9 @@
*/
public function copy(): Queue {}
/**
- * @return Traversable<TValue>
+ * @return Traversable<int, TValue>
*/
public function getIterator(): Traversable {}
/**
@@ -2589,8 +2631,10 @@
*
* @link https://www.php.net/manual/en/ds-queue.push.php
*
* @param TValue ...$values The values to push onto the queue.
+ *
+ * @return void
*/
public function push(...$values) {}
/**
@@ -2607,8 +2651,10 @@
/**
* @param int $offset
* @param TValue $value
+ *
+ * @return void
*/
public function offsetSet(mixed $offset, mixed $value) {}
/**
@@ -2674,9 +2720,9 @@
*/
public function copy() {}
/**
- * @return Traversable<TValue>
+ * @return Traversable<int, TValue>
*/
public function getIterator(): Traversable {}
/**
@@ -2708,8 +2754,10 @@
* Pushes a value with a given priority into the queue.
*
* @param TValue $value
* @param int $priority
+ *
+ * @return void
*/
public function push($value, int $priority) {}
/**