1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
psalm/stubs/ext-ds.php

1426 lines
25 KiB
PHP
Raw Normal View History

2019-10-18 17:35:24 +02:00
<?php
namespace Ds;
2020-10-23 02:28:39 +02:00
use ArrayAccess;
2019-10-18 17:35:24 +02:00
use Countable;
use JsonSerializable;
use OutOfBoundsException;
use OutOfRangeException;
use Traversable;
use UnderflowException;
/**
* @template-covariant TKey
* @template-covariant TValue
* @extends Traversable<TKey, TValue>
2019-10-18 17:35:24 +02:00
*/
interface Collection extends Traversable, Countable, JsonSerializable
{
/**
* @return Collection<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function copy(): Collection;
/**
* @return array<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function toArray(): array;
/**
* @psalm-mutation-free
*/
public function isEmpty(): bool;
/**
* @psalm-mutation-free
*/
public function count(): int;
2019-10-18 17:35:24 +02:00
}
/**
* @template TValue
* @implements Sequence<TValue>
2019-10-18 17:35:24 +02:00
*/
final class Deque implements Sequence
2019-10-18 17:35:24 +02:00
{
/**
2020-04-15 13:31:17 +02:00
* @param iterable<TValue> $values
2019-10-18 17:35:24 +02:00
*/
2020-04-15 13:31:17 +02:00
public function __construct(iterable $values = [])
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Deque<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function copy(): Deque
2019-10-18 17:35:24 +02:00
{
}
2020-06-10 23:27:39 +02:00
/**
* @return list<TValue>
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function toArray(): array
{
}
/**
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function isEmpty(): bool
2020-06-10 23:27:39 +02:00
{
}
/**
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function count(): int
2020-06-10 23:27:39 +02:00
{
}
/**
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function allocate(int $capacity): void
2020-06-10 23:27:39 +02:00
{
}
/**
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function capacity(): int
2020-06-10 23:27:39 +02:00
{
}
/**
* @return number
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function sum()
{
}
/**
* @param TValue ...$values
* @psalm-mutation-free
*/
public function contains(...$values): bool
{
}
/**
* @param (callable(TValue): bool)|null $callback
* @return Deque<TValue>
* @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()
2020-06-10 23:27:39 +02:00
{
}
/**
* @return TValue
* @throws \OutOfRangeException
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function get(int $index)
{
}
/**
* @psalm-mutation-free
*/
public function join(?string $glue = null): string
2020-06-10 23:27:39 +02:00
{
}
/**
* @return TValue
* @throws \UnderflowException
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function last()
{
}
/**
* @template TNewValue
* @param callable(TValue): TNewValue $callback
* @return Deque<TNewValue>
* @psalm-mutation-free
*/
public function map(callable $callback): Deque
2020-06-10 23:27:39 +02:00
{
}
2019-10-18 17:35:24 +02:00
/**
* @template TValue2
* @param iterable<TValue2> $values
* @return Deque<TValue|TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function merge(iterable $values): Deque
2019-10-18 17:35:24 +02:00
{
}
/**
* @return TValue
* @throws \UnderflowException
2019-10-18 17:35:24 +02:00
*/
public function pop()
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TCarry
* @param callable(TCarry, TValue): TCarry $callback
* @param TCarry $initial
* @return TCarry
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function reduce(callable $callback, $initial = null)
{
}
/**
* @return TValue
* @throws \OutOfRangeException
*/
public function remove(int $index)
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Deque<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function reversed(): Deque
2019-10-18 17:35:24 +02:00
{
}
/**
* @return TValue
* @throws \UnderflowException
*/
public function shift()
{
}
2019-10-18 17:35:24 +02:00
/**
* @return Deque<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function slice(int $offset, ?int $length = null): Deque
2019-10-18 17:35:24 +02:00
{
}
2020-06-10 23:27:39 +02:00
/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Deque<TValue>
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function sorted(callable $comparator = null): Deque
{
}
}
2019-10-18 17:35:24 +02:00
/**
* @template TKey
* @template TValue
* @implements Collection<TKey, TValue>
2020-10-23 02:28:39 +02:00
* @implements ArrayAccess<TKey, TValue>
*/
2020-10-23 02:28:39 +02:00
final class Map implements Collection, ArrayAccess
{
2019-10-18 17:35:24 +02:00
/**
2020-04-15 13:31:17 +02:00
* @param iterable<TKey, TValue> $values
2019-10-18 17:35:24 +02:00
*/
2020-04-15 13:31:17 +02:00
public function __construct(iterable $values = [])
2019-10-18 17:35:24 +02:00
{
}
/**
* @psalm-mutation-free
*/
public function allocate(int $capacity): void
{
}
/**
* @psalm-mutation-free
*/
public function capacity(): int
{
}
2019-10-18 17:35:24 +02:00
/**
* @return Map<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function copy(): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @return array<TKey, TValue>
* @psalm-mutation-free
*/
public function toArray(): array
{
}
/**
* @psalm-mutation-free
*/
public function isEmpty(): bool
{
}
/**
* @psalm-mutation-free
*/
public function count(): int
{
}
2019-10-18 17:35:24 +02:00
/**
* @param callable(TKey, TValue): TValue $callback
2019-10-18 17:35:24 +02:00
*/
2020-06-10 23:27:39 +02:00
public function apply(callable $callback): void
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Pair<TKey, TValue>
* @throws UnderflowException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function first(): Pair
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Pair<TKey, TValue>
* @throws UnderflowException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function last(): Pair
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Pair<TKey, TValue>
* @throws OutOfRangeException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function skip(int $position): Pair
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TKey2
* @template TValue2
* @param iterable<TKey2, TValue2> $values
* @return Map<TKey|TKey2, TValue|TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function merge(iterable $values): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TKey2
* @template TValue2
* @param Map<TKey2, TValue2> $map
* @return Map<TKey&TKey2, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function intersect(Map $map): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TValue2
* @param Map<TKey, TValue2> $map
* @return Map<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function diff(Map $map): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @param TKey $key
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function hasKey($key): bool
2019-10-18 17:35:24 +02:00
{
}
/**
* @param TValue $value
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function hasValue($value): bool
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TKey, TValue): bool)|null $callback
* @return Map<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function filter(callable $callback = null): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TDefault
* @param TKey $key
* @param TDefault $default
2020-05-20 13:27:25 +02:00
* @return (
* func_num_args() is 1
* ? TValue
* : TValue|TDefault
* )
* @throws OutOfBoundsException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function get($key, $default = null)
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Set<TKey>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function keys(): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TNewValue
* @param callable(TKey, TValue): TNewValue $callback
* @return Map<TKey, TNewValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function map(callable $callback): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Sequence<Pair<TKey, TValue>>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function pairs(): Sequence
2019-10-18 17:35:24 +02:00
{
}
/**
* @param TKey $key
* @param TValue $value
2019-10-18 17:35:24 +02:00
*/
public function put($key, $value)
2019-10-18 17:35:24 +02:00
{
}
/**
* @param iterable<TKey, TValue> $values
2019-10-18 17:35:24 +02:00
*/
public function putAll(iterable $values)
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TCarry
* @param callable(TCarry, TKey, TValue): TCarry $callback
* @param TCarry $initial
* @return TCarry
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function reduce(callable $callback, $initial = null)
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TDefault
* @param TKey $key
* @param TDefault $default
2020-05-20 13:27:25 +02:00
* @return (
* func_num_args() is 1
* ? TValue
* : TValue|TDefault
* )
* @throws \OutOfBoundsException
2019-10-18 17:35:24 +02:00
*/
public function remove($key, $default = null)
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Map<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function reversed(): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Map<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function slice(int $offset, ?int $length = null): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TValue, TValue): int)|null $comparator
2019-10-18 17:35:24 +02:00
*/
public function sort(callable $comparator = null)
{
}
/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Map<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function sorted(callable $comparator = null): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TKey, TKey): int)|null $comparator
2019-10-18 17:35:24 +02:00
*/
public function ksort(callable $comparator = null)
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TKey, TKey): int)|null $comparator
* @return Map<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function ksorted(callable $comparator = null): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Sequence<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function values(): Sequence
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TKey2
* @template TValue2
* @param Map<TKey2, TValue2> $map
* @return Map<TKey|TKey2, TValue|TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function union(Map $map): Map
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TKey2
* @template TValue2
* @param Map<TKey2, TValue2> $map
* @return Map<TKey|TKey2, TValue|TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function xor(Map $map): Map
2019-10-18 17:35:24 +02:00
{
}
}
2019-10-18 17:35:24 +02:00
/**
* @template-covariant TKey
* @template-covariant TValue
*/
final class Pair implements JsonSerializable
{
2019-10-18 17:35:24 +02:00
/**
* @var TKey
2019-10-18 17:35:24 +02:00
*/
public $key;
2019-10-18 17:35:24 +02:00
/**
* @var TValue
2019-10-18 17:35:24 +02:00
*/
public $value;
2019-10-18 17:35:24 +02:00
/**
* @param TKey $key
* @param TValue $value
2019-10-18 17:35:24 +02:00
*/
public function __construct($key = null, $value = null)
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Pair<TKey, TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function copy(): Pair
2019-10-18 17:35:24 +02:00
{
}
}
2019-10-18 17:35:24 +02:00
/**
* @template TValue
* @extends Collection<int, TValue>
2020-10-23 02:28:39 +02:00
* @extends ArrayAccess<int, TValue>
*/
2020-10-23 02:28:39 +02:00
interface Sequence extends Collection, ArrayAccess
{
/**
* @return Sequence<int, TValue>
* @psalm-mutation-free
*/
public function copy(): Sequence;
/**
* @return array<int, TValue>
* @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 number
* @psalm-mutation-free
*/
public function sum();
2019-10-18 17:35:24 +02:00
/**
* @param callable(TValue): TValue $callback
2019-10-18 17:35:24 +02:00
*/
2020-06-10 23:27:39 +02:00
public function apply(callable $callback): void;
2019-10-18 17:35:24 +02:00
/**
* @param TValue ...$values
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function contains(...$values): bool;
2019-10-18 17:35:24 +02:00
/**
* @param (callable(TValue): bool)|null $callback
* @return Sequence<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function filter(callable $callback = null): Sequence;
2019-10-18 17:35:24 +02:00
/**
* @param TValue $value
* @return int|false
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function find($value);
2019-10-18 17:35:24 +02:00
/**
* @return TValue
* @throws \UnderflowException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function first();
2019-10-18 17:35:24 +02:00
/**
* @return TValue
* @throws \OutOfRangeException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function get(int $index);
2019-10-18 17:35:24 +02:00
/**
* @param TValue ...$values
* @throws \OutOfRangeException
2019-10-18 17:35:24 +02:00
*/
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<TNewValue>
* @psalm-mutation-free
*/
public function map(callable $callback): Sequence;
/**
* @template TValue2
* @param iterable<TValue2> $values
* @return Sequence<TValue|TValue2>
* @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<TValue>
* @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<TValue>
* @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);
2019-10-18 17:35:24 +02:00
/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Sequence<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function sorted(callable $comparator = null): Sequence;
2019-10-18 17:35:24 +02:00
/**
* @param TValue ...$values
2019-10-18 17:35:24 +02:00
*/
public function unshift(...$values);
2019-10-18 17:35:24 +02:00
}
2019-10-18 17:35:24 +02:00
/**
* @template TValue
* @implements Sequence<TValue>
2019-10-18 17:35:24 +02:00
*/
final class Vector implements Sequence
2019-10-18 17:35:24 +02:00
{
/**
2020-04-17 21:07:16 +02:00
* @param iterable<TValue> $values
2019-10-18 17:35:24 +02:00
*/
2020-04-17 21:07:16 +02:00
public function __construct(iterable $values = [])
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Vector<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function copy(): Vector
2019-10-18 17:35:24 +02:00
{
}
2020-06-10 23:27:39 +02:00
/**
* @return list<TValue>
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
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 number
* @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<TValue>
* @psalm-mutation-free
*/
public function filter(callable $callback = null): Vector
{
}
/**
* @param TValue $value
* @return int|false
* @psalm-mutation-free
*/
public function find($value)
{
}
2020-06-10 23:27:39 +02:00
/**
* @return TValue
* @throws \UnderflowException
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function first()
{
}
/**
* @return TValue
* @throws \OutOfRangeException
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function get(int $index)
{
}
/**
* @psalm-mutation-free
*/
public function join(?string $glue = null): string
{
}
2020-06-10 23:27:39 +02:00
/**
* @return TValue
* @throws \UnderflowException
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function last()
{
}
/**
* @template TNewValue
* @param callable(TValue): TNewValue $callback
* @return Vector<TNewValue>
* @psalm-mutation-free
*/
public function map(callable $callback): Vector
{
}
/**
* @template TValue2
* @param iterable<TValue2> $values
* @return Vector<TValue|TValue2>
* @psalm-mutation-free
*/
public function merge(iterable $values): Sequence
{
}
2020-06-10 23:27:39 +02:00
/**
* @return TValue
* @throws \UnderflowException
*/
public function pop()
{
}
/**
* @template TCarry
* @param callable(TCarry, TValue): TCarry $callback
* @param TCarry $initial
* @return TCarry
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function reduce(callable $callback, $initial = null)
{
}
/**
* @return TValue
* @throws \OutOfRangeException
*/
public function remove(int $index)
{
}
/**
* @return Vector<TValue>
* @psalm-mutation-free
2020-06-10 23:27:39 +02:00
*/
public function reversed(): Vector
2020-06-10 23:27:39 +02:00
{
}
2019-10-18 17:35:24 +02:00
/**
* @return TValue
* @throws \UnderflowException
2019-10-18 17:35:24 +02:00
*/
public function shift()
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Vector<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function slice(int $offset, ?int $length = null): Vector
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Vector<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function sorted(callable $comparator = null): Vector
2019-10-18 17:35:24 +02:00
{
}
}
2019-10-18 17:35:24 +02:00
/**
* @template TValue
* @implements Collection<int, TValue>
* @implements ArrayAccess<int, TValue>
*/
final class Set implements Collection, ArrayAccess
{
2019-10-18 17:35:24 +02:00
/**
* @param iterable<TValue> $values
2019-10-18 17:35:24 +02:00
*/
public function __construct(iterable $values = [])
2019-10-18 17:35:24 +02:00
{
}
2020-02-11 03:09:07 +01:00
/**
* @return Set<TValue>
* @psalm-mutation-free
2020-02-11 03:09:07 +01:00
*/
public function copy(): Set
{
}
2020-06-03 22:50:01 +02:00
/**
* @return list<TValue>
* @psalm-mutation-free
2020-06-03 22:50:01 +02:00
*/
public function toArray(): array
2020-06-03 22:50:01 +02:00
{
}
2019-10-18 17:35:24 +02:00
/**
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function isEmpty(): bool
2019-10-18 17:35:24 +02:00
{
}
/**
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function count(): int
{
}
/**
* @psalm-mutation-free
*/
public function allocate(int $capacity): void
{
}
/**
* @psalm-mutation-free
*/
public function capacity(): int
2019-10-18 17:35:24 +02:00
{
}
/**
* @param TValue ...$values
2019-10-18 17:35:24 +02:00
*/
public function add(...$values): void
2019-10-18 17:35:24 +02:00
{
}
/**
* @param TValue ...$values
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function contains(...$values): bool
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TValue2
* @param Set<TValue2> $set
* @return Set<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function diff(Set $set): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TValue): bool)|null $callback
* @return Set<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function filter(callable $callback = null): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @return TValue
* @throws \UnderflowException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function first()
2019-10-18 17:35:24 +02:00
{
}
/**
* @return TValue
* @throws \OutOfRangeException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function get(int $index)
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TValue2
* @param Set<TValue2> $set
* @return Set<TValue&TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function intersect(Set $set): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @return TValue
* @throws \UnderflowException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function last()
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TValue2
* @param iterable<TValue2> $values
* @return Set<TValue|TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function merge(iterable $values): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @param TValue ...$values
2019-10-18 17:35:24 +02:00
*/
public function remove(...$values): void
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Set<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function reversed(): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Set<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function slice(int $index, ?int $length = null): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TValue, TValue): int)|null $comparator
2019-10-18 17:35:24 +02:00
*/
public function sort(callable $comparator = null): void
2019-10-18 17:35:24 +02:00
{
}
/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Set<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function sorted(callable $comparator = null): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TValue2
* @param Set<TValue2> $set
* @return Set<TValue|TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function union(Set $set): Set
2019-10-18 17:35:24 +02:00
{
}
/**
* @template TValue2
* @param Set<TValue2> $set
* @return Set<TValue|TValue2>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function xor(Set $set): Set
2019-10-18 17:35:24 +02:00
{
}
}
2019-10-18 17:35:24 +02:00
/**
* @template TValue
* @implements Collection<int, TValue>
2020-10-23 02:28:39 +02:00
* @implements ArrayAccess<int, TValue>
*/
2020-10-23 02:28:39 +02:00
final class Stack implements Collection, ArrayAccess
{
2019-10-18 17:35:24 +02:00
/**
2020-04-15 13:31:17 +02:00
* @param iterable<TValue> $values
2019-10-18 17:35:24 +02:00
*/
2020-04-15 13:31:17 +02:00
public function __construct(iterable $values = [])
2019-10-18 17:35:24 +02:00
{
}
/**
* @return Stack<TValue>
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function copy(): Stack
2019-10-18 17:35:24 +02:00
{
}
/**
* @return list<TValue>
* @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
{
}
2019-10-18 17:35:24 +02:00
/**
* @return TValue
* @throws UnderflowException
* @psalm-mutation-free
2019-10-18 17:35:24 +02:00
*/
public function peek()
2019-10-18 17:35:24 +02:00
{
}
/**
* @return TValue
* @throws UnderflowException
2019-10-18 17:35:24 +02:00
*/
public function pop()
{
}
/**
* @param TValue ...$values
2019-10-18 17:35:24 +02:00
*/
public function push(...$values): void
2019-10-18 17:35:24 +02:00
{
}
}
/**
* @template TValue
* @implements Collection<int, TValue>
* @implements ArrayAccess<int, TValue>
*/
final class Queue implements Collection, ArrayAccess
{
/**
2020-04-15 13:31:17 +02:00
* @param iterable<TValue> $values
*/
2020-04-15 13:31:17 +02:00
public function __construct(iterable $values = [])
{
}
/**
* @return Queue<TValue>
* @psalm-mutation-free
*/
public function copy(): Queue
{
}
/**
* @return list<TValue>
* @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<int, TValue>
*/
final class PriorityQueue implements Collection
{
/**
* @return PriorityQueue<TValue>
* @psalm-mutation-free
*/
public function copy(): PriorityQueue
{
}
/**
* @return list<TValue>
* @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
{
}
}