mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-11-30 04:39:48 +01:00
Merge pull request #11 from azjezz/as-of
use `of` instead of `as` for generic type constrain
This commit is contained in:
commit
f4188365bf
@ -10,7 +10,7 @@ use Psl;
|
||||
* Retrieve a value from the array using the given key.
|
||||
* If the key doesn't exist, an InvariantViolationException will be thrown.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Arr;
|
||||
/**
|
||||
* Returns true if the given array contains the key.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -12,7 +12,7 @@ use Psl\Str;
|
||||
* Returns a new array mapping each value to the number of times it appears
|
||||
* in the given iterable.
|
||||
*
|
||||
* @psalm-template Tv as array-key
|
||||
* @psalm-template Tv of array-key
|
||||
*
|
||||
* @psalm-param iterable<Tv> $values
|
||||
*
|
||||
|
@ -10,7 +10,7 @@ use Psl\Iter;
|
||||
* Returns whether the two given arrays have the same entries, using strict
|
||||
* equality. To guarantee equality of order as well as contents, use `===`.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Arr;
|
||||
/**
|
||||
* Get the first value of an array, If the array is empty, null will be returned.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Arr;
|
||||
/**
|
||||
* Get the first key of an array, if the array is empty, null will be returned.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
*
|
||||
* @psalm-param array<Tk, mixed> $array
|
||||
*
|
||||
|
@ -10,7 +10,7 @@ use Psl;
|
||||
* Get the first value of an array, If the array is empty, an InvariantViolationException
|
||||
* will be thrown.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -16,7 +16,7 @@ namespace Psl\Arr;
|
||||
* Arr\flatten([[0 => 1, 1 => 2], [2 => 9, 3 => 8]])
|
||||
* => Arr(0 => 1, 1 => 2, 2 => 9, 3 => 8)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<iterable<Tk, Tv>> $iterables
|
||||
|
@ -16,8 +16,8 @@ use Psl\Str;
|
||||
* Iter\flip(['a' => 1, 'b' => 2, 'c' => 3])
|
||||
* => Iter(1 => 'a', 2 => 'b', 3 => 'c')
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tv as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv of array-key
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
*
|
||||
|
@ -27,7 +27,7 @@ use Psl\Str;
|
||||
* )
|
||||
* => Arr(7 => [2], 8 => [3], 9 => [4], 10 => [5], 11 => [6], 12 => [7, 8, 9, 10])
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tv> $values
|
||||
|
@ -19,7 +19,7 @@ namespace Psl\Arr;
|
||||
* Arr\contains_key($array, $index) ? $array[$index] : $default;
|
||||
* ```
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Arr;
|
||||
/**
|
||||
* Return all the keys of an array.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $arr
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Arr;
|
||||
/**
|
||||
* Get the last value of an array, if the array is empty, returns null.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Arr;
|
||||
/**
|
||||
* Get the last key of an array, if the array is empty, null will be returned.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -10,7 +10,7 @@ use Psl;
|
||||
* Get the last value of an array, If the array is empty, an InvariantViolationException
|
||||
* will be thrown.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -15,7 +15,7 @@ namespace Psl\Arr;
|
||||
* Arr\merge([0 => 1, 1 => 2], [2 => 9, 3 => 8])
|
||||
* => Arr(0 => 1, 1 => 2, 2 => 9, 3 => 8)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $first
|
||||
|
@ -11,7 +11,7 @@ use Psl\Random;
|
||||
/**
|
||||
* Retrieve a random value from a non-empty array.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $values
|
||||
|
@ -9,7 +9,7 @@ namespace Psl\Arr;
|
||||
* and the given iterable. The array will have the same ordering as the
|
||||
* `$keys` iterable.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -17,7 +17,7 @@ use Psl;
|
||||
* Arr\shuffle('a' => 1, 'b' => 2, 'c' => 3)
|
||||
* => Arr(2, 3, 1)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -11,7 +11,7 @@ use Psl\Iter;
|
||||
* optional comparator function isn't provided, the values will be sorted in
|
||||
* ascending order.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -12,7 +12,7 @@ use Psl\Iter;
|
||||
* comparator function isn't provided, the values will be sorted in ascending
|
||||
* order of scalar key.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
* @psalm-template Ts
|
||||
*
|
||||
|
@ -11,7 +11,7 @@ use Psl\Iter;
|
||||
* optional comparator function isn't provided, the keys will be sorted in
|
||||
* ascending order.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -11,7 +11,7 @@ use Psl\Iter;
|
||||
* optional comparator function isn't provided, the values will be sorted in
|
||||
* ascending order ( maintains index association ).
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -12,7 +12,7 @@ use Psl\Iter;
|
||||
* comparator function isn't provided, the values will be sorted in ascending
|
||||
* order of scalar key.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
* @psalm-template Ts
|
||||
*
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Arr;
|
||||
/**
|
||||
* Returns a new array in which each value appears exactly once.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -13,9 +13,9 @@ use Psl\Str;
|
||||
* value's uniqueness is determined by transforming it to a scalar via the
|
||||
* given function.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
* @psalm-template Ts as array-key
|
||||
* @psalm-template Ts of array-key
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
* @psalm-param (callable(Tv): Ts) $scalar_func
|
||||
|
@ -9,7 +9,7 @@ use IteratorAggregate;
|
||||
/**
|
||||
* Interface ConstMap.
|
||||
*
|
||||
* @template Tk as array-key
|
||||
* @template Tk of array-key
|
||||
* @template Tv
|
||||
*
|
||||
* @extends ConstCollection<Pair<Tk, Tv>>
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Collection;
|
||||
/**
|
||||
* The interface for all Sets to enable access its values.
|
||||
*
|
||||
* @template Tv as array-key
|
||||
* @template Tv of array-key
|
||||
*/
|
||||
interface ConstSetAccess
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ use Psl;
|
||||
use Psl\Iter;
|
||||
|
||||
/**
|
||||
* @template Tk as array-key
|
||||
* @template Tk of array-key
|
||||
* @template Tv
|
||||
*
|
||||
* @implements ConstMap<Tk, Tv>
|
||||
|
@ -24,7 +24,7 @@ use Psl\Iter;
|
||||
* are being removed. When a new key is added or an element is removed, all
|
||||
* iterators that point to the `Map` shall be considered invalid.
|
||||
*
|
||||
* @template Tk as array-key
|
||||
* @template Tk of array-key
|
||||
* @template Tv
|
||||
*
|
||||
* @implements MutableMap<Tk, Tv>
|
||||
|
@ -11,7 +11,7 @@ namespace Psl\Collection;
|
||||
* defined in its parent interfaces. But you could theoretically use this
|
||||
* interface for parameter and return type annotations.
|
||||
*
|
||||
* @template Tk as array-key
|
||||
* @template Tk of array-key
|
||||
* @template Tv
|
||||
*
|
||||
* @extends ConstMapAccess<Tk, Tv>
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Collection;
|
||||
/**
|
||||
* Represents a write-enabled (mutable) sequence of key/value pairs (ie. map).
|
||||
*
|
||||
* @template Tk as array-key
|
||||
* @template Tk of array-key
|
||||
* @template Tv
|
||||
*
|
||||
* @extends ConstMap<Tk, Tv>
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Collection;
|
||||
/**
|
||||
* The interface for mutable `Set`s to enable removal of its values.
|
||||
*
|
||||
* @template Tv as array-key
|
||||
* @template Tv of array-key
|
||||
*
|
||||
* @extends ConstSetAccess<Tv>
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@ use Generator;
|
||||
* Iter\chain(Iterable\range(0, 5), Iter\range(6, 10), Iter\range(11, 15))
|
||||
* => Iter(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> ...$iterables Iterables to chain
|
||||
|
@ -9,7 +9,7 @@ use Psl\Arr;
|
||||
/**
|
||||
* Returns true if the given iterable contains the key.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable,
|
||||
|
@ -9,7 +9,7 @@ use Generator;
|
||||
use Psl\Arr;
|
||||
|
||||
/**
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $first
|
||||
|
@ -12,7 +12,7 @@ namespace Psl\Iter;
|
||||
* Iter\drop([1, 2, 3, 4, 5], 3)
|
||||
* => Iter(4, 5)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk,Tv> $iterable Iterable to drop the elements from
|
||||
|
@ -17,7 +17,7 @@ use Generator;
|
||||
* Iter\drop_while([3, 1, 4, -1, 5], fm($i) => $i > 0)
|
||||
* => Iter(-1, 5)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable Iterable to drop values from
|
||||
|
@ -9,7 +9,7 @@ use Generator;
|
||||
/**
|
||||
* Converts an iterable of key and value pairs, into an iterable of entries.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -19,7 +19,7 @@ use Generator;
|
||||
* Iter\filter(['foo', 'bar', 'baz', 'qux'], fn($value) => Str\contains($value, 'a'));
|
||||
* => Iter('bar', 'baz')
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -19,7 +19,7 @@ use Generator;
|
||||
* Iter\filter_keys([0 => 'a', 1 => 'b', 2 => 'c'], fn($key) => $key <= 1);
|
||||
* => Iter(0 => 'a', 1 => 'b')
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -19,7 +19,7 @@ use Psl;
|
||||
* Iter\filter(['foo', 'bar', 'baz', 'qux'], fn($key, $value) => $key > 1 && Str\contains($value, 'a'));
|
||||
* => Iter('baz')
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -22,7 +22,7 @@ use Psl\Arr;
|
||||
* Iter\first_key([])
|
||||
* => Null
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -10,7 +10,7 @@ use Generator;
|
||||
* Returns a new dict formed by merging the iterable elements of the
|
||||
* given iterable.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<iterable<Tk, Tv>> $iterables
|
||||
|
@ -10,7 +10,7 @@ use Generator;
|
||||
* Returns a new dict where each mapping is defined by the given key/value
|
||||
* tuples.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<array{0: Tk, 1: Tv}> $entries
|
||||
|
@ -10,7 +10,7 @@ use Generator;
|
||||
* Returns a new dict where each value is the result of calling the given
|
||||
* function on the corresponding key.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk> $keys
|
||||
|
@ -14,7 +14,7 @@ use Generator;
|
||||
* Iter\keys(['a' => 0, 'b' => 1, 'c' => 2])
|
||||
* => Iter('a', 'b', 'c')
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable Iterable to get keys from
|
||||
|
@ -9,7 +9,7 @@ use Psl\Arr;
|
||||
/**
|
||||
* Get the last value of an iterable, if the iterable is empty, returns null.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -9,7 +9,7 @@ use Psl\Arr;
|
||||
/**
|
||||
* Get the last key of an iterable, if the iterable is empty, null will be returned.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param array<Tk, Tv> $array
|
||||
|
@ -18,7 +18,7 @@ use Generator;
|
||||
* Iter\map([1, 2, 3, 4, 5], fn($i) => $i * 2);
|
||||
* => Iter(2, 4, 6, 8, 10)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
* @psalm-template T
|
||||
*
|
||||
|
@ -18,8 +18,8 @@ use Generator;
|
||||
* Iter\map_keys([0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5], fn($i) => $i * 2);
|
||||
* => Iter(0 => 1, 2 => 2, 4 => 3, 6 => 4, 8 => 5)
|
||||
*
|
||||
* @psalm-template Tk1 as array-key
|
||||
* @psalm-template Tk2 as array-key
|
||||
* @psalm-template Tk1 of array-key
|
||||
* @psalm-template Tk2 of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk1, Tv> $iterable Iterable to be mapped over
|
||||
|
@ -17,7 +17,7 @@ use Generator;
|
||||
* Iter\map_with_key([1, 2, 3, 4, 5], fn($k, $v) => $k + $v);
|
||||
* => Iter(1, 3, 5, 7, 9)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
* @psalm-template T
|
||||
*
|
||||
|
@ -24,11 +24,11 @@ use Generator;
|
||||
* )
|
||||
*
|
||||
*
|
||||
* k as array-key
|
||||
* k of array-key
|
||||
* v
|
||||
*
|
||||
* @psalm-template T
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<T> $iterable
|
||||
|
@ -23,9 +23,9 @@ use Generator;
|
||||
* 70 => 'H', 131 => 'I', 264 => 'J', 521 => 'K', 1034 => 'L'
|
||||
* )
|
||||
*
|
||||
* @psalm-template Tk1 as array-key
|
||||
* @psalm-template Tk1 of array-key
|
||||
* @psalm-template Tv1
|
||||
* @psalm-template Tk2 as array-key
|
||||
* @psalm-template Tk2 of array-key
|
||||
* @psalm-template Tv2
|
||||
*
|
||||
* @psalm-param iterable<Tk1, Tv1> $iterable
|
||||
|
@ -10,7 +10,7 @@ use Psl\Arr;
|
||||
/**
|
||||
* Retrieve a random value from a non-empty iterable.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -19,7 +19,7 @@ namespace Psl\Iter;
|
||||
* Iter\reduce(Iter\range(1, 5), fn($accumulator, $value) => $accumulator * $value, 1)
|
||||
* => 120
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
* @psalm-template Ts
|
||||
*
|
||||
|
@ -15,7 +15,7 @@ use Generator;
|
||||
*
|
||||
* Reductions yield each accumulator along the way.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
* @psalm-template Ts
|
||||
*
|
||||
|
@ -26,8 +26,8 @@ use Generator;
|
||||
* 24 => ['id' => 24, 'name' => 'bar']
|
||||
* )
|
||||
*
|
||||
* @psalm-template Tk1 as array-key
|
||||
* @psalm-template Tk2 as array-key
|
||||
* @psalm-template Tk1 of array-key
|
||||
* @psalm-template Tk2 of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk1, Tv> $iterable Iterable to reindex
|
||||
|
@ -18,7 +18,7 @@ use Psl;
|
||||
* IterIter\slice([-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], 5, 3)
|
||||
* => Iter(0, 1, 2, 3)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk,Tv> $iterable Iterable to take the slice from
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Iter;
|
||||
/**
|
||||
* Take the first n elements from an iterable.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -17,7 +17,7 @@ use Generator;
|
||||
* Iter\take_while([3, 1, 4, -1, 5], fn($i) => $i > 0)
|
||||
* => iter(3, 1, 4)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable Iterable to take values from
|
||||
|
@ -7,7 +7,7 @@ namespace Psl\Iter;
|
||||
/**
|
||||
* Copy the iterable into an array with keys.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -10,7 +10,7 @@ use IteratorAggregate;
|
||||
/**
|
||||
* Copy the iterable into an Iterator.
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable
|
||||
|
@ -17,7 +17,7 @@ use Generator;
|
||||
* Iter\values([17 => 1, 42 => 2, -2 => 100])
|
||||
* => Iter(0 => 1, 1 => 42, 2 => 100)
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> $iterable Iterable to get values from
|
||||
|
@ -22,7 +22,7 @@ use Generator;
|
||||
* Arr(2, 2, 2) => Arr(3, 6, 9)
|
||||
* )
|
||||
*
|
||||
* @psalm-template Tk as array-key
|
||||
* @psalm-template Tk of array-key
|
||||
* @psalm-template Tv
|
||||
*
|
||||
* @psalm-param iterable<Tk, Tv> ...$iterables
|
||||
|
Loading…
Reference in New Issue
Block a user