*/ interface Collection extends Traversable, Countable, JsonSerializable { /** * @return Collection * @psalm-mutation-free */ public function copy(): Collection; /** * @return array * @psalm-mutation-free */ public function toArray(): array; /** * @psalm-mutation-free */ public function isEmpty(): bool; /** * @psalm-mutation-free */ public function count(): int; } /** * @template TValue * @implements Sequence */ final class Deque implements Sequence { /** * @param iterable $values */ public function __construct(iterable $values = []) { } /** * @return Deque * @psalm-mutation-free */ public function copy(): Deque { } /** * @return list * @psalm-mutation-free */ public function toArray(): array { } /** * @psalm-mutation-free */ public function isEmpty(): bool { } /** * @psalm-mutation-free */ public function count(): int { } /** * @psalm-mutation-free */ public function allocate(int $capacity): void { } /** * @psalm-mutation-free */ public function capacity(): int { } /** * @return float|int * @psalm-mutation-free */ public function sum() { } /** * @param TValue ...$values * @psalm-mutation-free */ public function contains(...$values): bool { } /** * @param (callable(TValue): bool)|null $callback * @return Deque * @psalm-mutation-free */ public function filter(callable $callback = null): Deque { } /** * @param TValue $value * @return int|false * @psalm-mutation-free */ public function find($value) { } /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function first() { } /** * @return TValue * @throws \OutOfRangeException * @psalm-mutation-free */ public function get(int $index) { } /** * @psalm-mutation-free */ public function join(?string $glue = null): string { } /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function last() { } /** * @template TNewValue * @param callable(TValue): TNewValue $callback * @return Deque * @psalm-mutation-free */ public function map(callable $callback): Deque { } /** * @template TValue2 * @param iterable $values * @return Deque * @psalm-mutation-free */ public function merge(iterable $values): Deque { } /** * @return TValue * @throws \UnderflowException */ public function pop() { } /** * @template TCarry * @param callable(TCarry, TValue): TCarry $callback * @param TCarry $initial * @return TCarry * @psalm-mutation-free */ public function reduce(callable $callback, $initial = null) { } /** * @return TValue * @throws \OutOfRangeException */ public function remove(int $index) { } /** * @return Deque * @psalm-mutation-free */ public function reversed(): Deque { } /** * @return TValue * @throws \UnderflowException */ public function shift() { } /** * @return Deque * @psalm-mutation-free */ public function slice(int $offset, ?int $length = null): Deque { } /** * @param (callable(TValue, TValue): int)|null $comparator * @return Deque * @psalm-mutation-free */ public function sorted(callable $comparator = null): Deque { } } /** * @template TKey * @template TValue * @implements Collection * @implements ArrayAccess */ final class Map implements Collection, ArrayAccess { /** * @param iterable $values */ public function __construct(iterable $values = []) { } /** * @psalm-mutation-free */ public function allocate(int $capacity): void { } /** * @psalm-mutation-free */ public function capacity(): int { } /** * @return Map * @psalm-mutation-free */ public function copy(): Map { } /** * @return array * @psalm-mutation-free */ public function toArray(): array { } /** * @psalm-mutation-free */ public function isEmpty(): bool { } /** * @psalm-mutation-free */ public function count(): int { } /** * @param callable(TKey, TValue): TValue $callback */ public function apply(callable $callback): void { } /** * @return Pair * @throws UnderflowException * @psalm-mutation-free */ public function first(): Pair { } /** * @return Pair * @throws UnderflowException * @psalm-mutation-free */ public function last(): Pair { } /** * @return Pair * @throws OutOfRangeException * @psalm-mutation-free */ public function skip(int $position): Pair { } /** * @template TKey2 * @template TValue2 * @param iterable $values * @return Map * @psalm-mutation-free */ public function merge(iterable $values): Map { } /** * @template TKey2 * @template TValue2 * @param Map $map * @return Map * @psalm-mutation-free */ public function intersect(Map $map): Map { } /** * @template TValue2 * @param Map $map * @return Map * @psalm-mutation-free */ public function diff(Map $map): Map { } /** * @param TKey $key * @psalm-mutation-free */ public function hasKey($key): bool { } /** * @param TValue $value * @psalm-mutation-free */ public function hasValue($value): bool { } /** * @param (callable(TKey, TValue): bool)|null $callback * @return Map * @psalm-mutation-free */ public function filter(callable $callback = null): Map { } /** * @template TDefault * @param TKey $key * @param TDefault $default * @return ( * func_num_args() is 1 * ? TValue * : TValue|TDefault * ) * @throws OutOfBoundsException * @psalm-mutation-free */ public function get($key, $default = null) { } /** * @return Set * @psalm-mutation-free */ public function keys(): Set { } /** * @template TNewValue * @param callable(TKey, TValue): TNewValue $callback * @return Map * @psalm-mutation-free */ public function map(callable $callback): Map { } /** * @return Sequence> * @psalm-mutation-free */ public function pairs(): Sequence { } /** * @param TKey $key * @param TValue $value */ public function put($key, $value) { } /** * @param iterable $values */ public function putAll(iterable $values) { } /** * @template TCarry * @param callable(TCarry, TKey, TValue): TCarry $callback * @param TCarry $initial * @return TCarry * @psalm-mutation-free */ public function reduce(callable $callback, $initial = null) { } /** * @template TDefault * @param TKey $key * @param TDefault $default * @return ( * func_num_args() is 1 * ? TValue * : TValue|TDefault * ) * @throws \OutOfBoundsException */ public function remove($key, $default = null) { } /** * @return Map * @psalm-mutation-free */ public function reversed(): Map { } /** * @return Map * @psalm-mutation-free */ public function slice(int $offset, ?int $length = null): Map { } /** * @param (callable(TValue, TValue): int)|null $comparator */ public function sort(callable $comparator = null) { } /** * @param (callable(TValue, TValue): int)|null $comparator * @return Map * @psalm-mutation-free */ public function sorted(callable $comparator = null): Map { } /** * @param (callable(TKey, TKey): int)|null $comparator */ public function ksort(callable $comparator = null) { } /** * @param (callable(TKey, TKey): int)|null $comparator * @return Map * @psalm-mutation-free */ public function ksorted(callable $comparator = null): Map { } /** * @return Sequence * @psalm-mutation-free */ public function values(): Sequence { } /** * @template TKey2 * @template TValue2 * @param Map $map * @return Map * @psalm-mutation-free */ public function union(Map $map): Map { } /** * @template TKey2 * @template TValue2 * @param Map $map * @return Map * @psalm-mutation-free */ public function xor(Map $map): Map { } } /** * @template-covariant TKey * @template-covariant TValue */ final class Pair implements JsonSerializable { /** * @var TKey */ public $key; /** * @var TValue */ public $value; /** * @param TKey $key * @param TValue $value */ public function __construct($key = null, $value = null) { } /** * @return Pair * @psalm-mutation-free */ public function copy(): Pair { } } /** * @template TValue * @extends Collection * @extends ArrayAccess */ interface Sequence extends Collection, ArrayAccess { /** * @return Sequence * @psalm-mutation-free */ public function copy(): Sequence; /** * @return list * @psalm-mutation-free */ public function toArray(): array; /** * @psalm-mutation-free */ public function isEmpty(): bool; /** * @psalm-mutation-free */ public function count(): int; /** * @psalm-mutation-free */ public function allocate(int $capacity): void; /** * @psalm-mutation-free */ public function capacity(): int; /** * @return float|int * @psalm-mutation-free */ public function sum(); /** * @param callable(TValue): TValue $callback */ public function apply(callable $callback): void; /** * @param TValue ...$values * @psalm-mutation-free */ public function contains(...$values): bool; /** * @param (callable(TValue): bool)|null $callback * @return Sequence * @psalm-mutation-free */ public function filter(callable $callback = null): Sequence; /** * @param TValue $value * @return int|false * @psalm-mutation-free */ public function find($value); /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function first(); /** * @return TValue * @throws \OutOfRangeException * @psalm-mutation-free */ public function get(int $index); /** * @param TValue ...$values * @throws \OutOfRangeException */ public function insert(int $index, ...$values); /** * @psalm-mutation-free */ public function join(?string $glue = null): string; /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function last(); /** * @template TNewValue * @param callable(TValue): TNewValue $callback * @return Sequence * @psalm-mutation-free */ public function map(callable $callback): Sequence; /** * @template TValue2 * @param iterable $values * @return Sequence * @psalm-mutation-free */ public function merge(iterable $values): Sequence; /** * @return TValue * @throws \UnderflowException */ public function pop(); /** * @param TValue ...$values */ public function push(...$values); /** * @template TCarry * @param callable(TCarry, TValue): TCarry $callback * @param TCarry $initial * @return TCarry * @psalm-mutation-free */ public function reduce(callable $callback, $initial = null); /** * @return TValue * @throws \OutOfRangeException */ public function remove(int $index); /** * @return Sequence * @psalm-mutation-free */ public function reversed(): Sequence; /** * @param TValue $value * @throws \OutOfRangeException */ public function set(int $index, $value); /** * @return TValue * @throws \UnderflowException */ public function shift(); /** * @return Sequence * @psalm-mutation-free */ public function slice(int $index, ?int $length = null): Sequence; /** * @param (callable(TValue, TValue): int)|null $comparator */ public function sort(callable $comparator = null); /** * @param (callable(TValue, TValue): int)|null $comparator * @return Sequence * @psalm-mutation-free */ public function sorted(callable $comparator = null): Sequence; /** * @param TValue ...$values */ public function unshift(...$values); } /** * @template TValue * @implements Sequence */ final class Vector implements Sequence { /** * @param iterable $values */ public function __construct(iterable $values = []) { } /** * @return Vector * @psalm-mutation-free */ public function copy(): Vector { } /** * @return list * @psalm-mutation-free */ public function toArray(): array { } /** * @psalm-mutation-free */ public function isEmpty(): bool { } /** * @psalm-mutation-free */ public function count(): int { } /** * @psalm-mutation-free */ public function allocate(int $capacity): void { } /** * @psalm-mutation-free */ public function capacity(): int { } /** * @return float|int * @psalm-mutation-free */ public function sum() { } /** * @param TValue ...$values * @psalm-mutation-free */ public function contains(...$values): bool { } /** * @param (callable(TValue): bool)|null $callback * @return Vector * @psalm-mutation-free */ public function filter(callable $callback = null): Vector { } /** * @param TValue $value * @return int|false * @psalm-mutation-free */ public function find($value) { } /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function first() { } /** * @return TValue * @throws \OutOfRangeException * @psalm-mutation-free */ public function get(int $index) { } /** * @psalm-mutation-free */ public function join(?string $glue = null): string { } /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function last() { } /** * @template TNewValue * @param callable(TValue): TNewValue $callback * @return Vector * @psalm-mutation-free */ public function map(callable $callback): Vector { } /** * @template TValue2 * @param iterable $values * @return Vector * @psalm-mutation-free */ public function merge(iterable $values): Sequence { } /** * @return TValue * @throws \UnderflowException */ public function pop() { } /** * @template TCarry * @param callable(TCarry, TValue): TCarry $callback * @param TCarry $initial * @return TCarry * @psalm-mutation-free */ public function reduce(callable $callback, $initial = null) { } /** * @return TValue * @throws \OutOfRangeException */ public function remove(int $index) { } /** * @return Vector * @psalm-mutation-free */ public function reversed(): Vector { } /** * @return TValue * @throws \UnderflowException */ public function shift() { } /** * @return Vector * @psalm-mutation-free */ public function slice(int $offset, ?int $length = null): Vector { } /** * @param (callable(TValue, TValue): int)|null $comparator * @return Vector * @psalm-mutation-free */ public function sorted(callable $comparator = null): Vector { } } /** * @template TValue * @implements Collection * @implements ArrayAccess */ final class Set implements Collection, ArrayAccess { /** * @param iterable $values */ public function __construct(iterable $values = []) { } /** * @return Set * @psalm-mutation-free */ public function copy(): Set { } /** * @return list * @psalm-mutation-free */ public function toArray(): array { } /** * @psalm-mutation-free */ public function isEmpty(): bool { } /** * @psalm-mutation-free */ public function count(): int { } /** * @psalm-mutation-free */ public function allocate(int $capacity): void { } /** * @psalm-mutation-free */ public function capacity(): int { } /** * @param TValue ...$values */ public function add(...$values): void { } /** * @param TValue ...$values * @psalm-mutation-free */ public function contains(...$values): bool { } /** * @template TValue2 * @param Set $set * @return Set * @psalm-mutation-free */ public function diff(Set $set): Set { } /** * @param (callable(TValue): bool)|null $callback * @return Set * @psalm-mutation-free */ public function filter(callable $callback = null): Set { } /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function first() { } /** * @return TValue * @throws \OutOfRangeException * @psalm-mutation-free */ public function get(int $index) { } /** * @template TValue2 * @param Set $set * @return Set * @psalm-mutation-free */ public function intersect(Set $set): Set { } /** * @return TValue * @throws \UnderflowException * @psalm-mutation-free */ public function last() { } /** * @template TValue2 * @param iterable $values * @return Set * @psalm-mutation-free */ public function merge(iterable $values): Set { } /** * @param TValue ...$values */ public function remove(...$values): void { } /** * @return Set * @psalm-mutation-free */ public function reversed(): Set { } /** * @return Set * @psalm-mutation-free */ public function slice(int $index, ?int $length = null): Set { } /** * @param (callable(TValue, TValue): int)|null $comparator */ public function sort(callable $comparator = null): void { } /** * @param (callable(TValue, TValue): int)|null $comparator * @return Set * @psalm-mutation-free */ public function sorted(callable $comparator = null): Set { } /** * @template TValue2 * @param Set $set * @return Set * @psalm-mutation-free */ public function union(Set $set): Set { } /** * @template TValue2 * @param Set $set * @return Set * @psalm-mutation-free */ public function xor(Set $set): Set { } } /** * @template TValue * @implements Collection * @implements ArrayAccess */ final class Stack implements Collection, ArrayAccess { /** * @param iterable $values */ public function __construct(iterable $values = []) { } /** * @return Stack * @psalm-mutation-free */ public function copy(): Stack { } /** * @return list * @psalm-mutation-free */ public function toArray(): array { } /** * @psalm-mutation-free */ public function isEmpty(): bool { } /** * @psalm-mutation-free */ public function count(): int { } /** * @psalm-mutation-free */ public function allocate(int $capacity): void { } /** * @psalm-mutation-free */ public function capacity(): int { } /** * @return TValue * @throws UnderflowException * @psalm-mutation-free */ public function peek() { } /** * @return TValue * @throws UnderflowException */ public function pop() { } /** * @param TValue ...$values */ public function push(...$values): void { } } /** * @template TValue * @implements Collection * @implements ArrayAccess */ final class Queue implements Collection, ArrayAccess { /** * @param iterable $values */ public function __construct(iterable $values = []) { } /** * @return Queue * @psalm-mutation-free */ public function copy(): Queue { } /** * @return list * @psalm-mutation-free */ public function toArray(): array { } /** * @psalm-mutation-free */ public function isEmpty(): bool { } /** * @psalm-mutation-free */ public function count(): int { } /** * @psalm-mutation-free */ public function allocate(int $capacity): void { } /** * @psalm-mutation-free */ public function capacity(): int { } /** * @return TValue * @throws UnderflowException * @psalm-mutation-free */ public function peek() { } /** * @return TValue * @throws UnderflowException */ public function pop() { } /** * @param TValue ...$values */ public function push(...$values): void { } } /** * @template TValue * @implements Collection */ final class PriorityQueue implements Collection { /** * @return PriorityQueue * @psalm-mutation-free */ public function copy(): PriorityQueue { } /** * @return list * @psalm-mutation-free */ public function toArray(): array { } /** * @psalm-mutation-free */ public function isEmpty(): bool { } /** * @psalm-mutation-free */ public function count(): int { } /** * @psalm-mutation-free */ public function allocate(int $capacity): void { } /** * @psalm-mutation-free */ public function capacity(): int { } /** * @return TValue * @throws UnderflowException * @psalm-mutation-free */ public function peek() { } /** * @return TValue * @throws UnderflowException */ public function pop() { } /** * @param TValue $value */ public function push($value, int $priority): void { } }