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