From 528161bdebd2aa8aefe1c60690b3e4fd588e8bd3 Mon Sep 17 00:00:00 2001 From: armorshard1 <202433812+armorshard1@users.noreply.github.com> Date: Thu, 6 Aug 2026 16:49:46 +0200 Subject: [PATCH] Update ext-ds.stub and functionMap.php for ext-ds version 2.0.0 --- resources/functionMap.php | 40 +- stubs/ext-ds.stub | 836 +++++++++++++------------------------- 2 files changed, 306 insertions(+), 570 deletions(-) diff --git a/resources/functionMap.php b/resources/functionMap.php index a216ff776a5..933f9006ec9 100644 --- a/resources/functionMap.php +++ b/resources/functionMap.php @@ -1651,29 +1651,25 @@ 'DOTNET::__construct' => ['void', 'assembly_name'=>'string', 'class_name'=>'string', 'codepage='=>'int'], 'dotnet_load' => ['int', 'assembly_name'=>'string', 'datatype_name='=>'string', 'codepage='=>'int'], 'doubleval' => ['float', 'var'=>'int|float|__stringNotStringable|bool|array|resource|GMP|SimpleXMLElement|null'], -'Ds\Deque::__construct' => ['void', 'values='=>'mixed'], -'Ds\Deque::count' => ['0|positive-int'], -'Ds\Deque::jsonSerialize' => ['array'], 'Ds\Map::__construct' => ['void', 'values='=>'mixed'], -'Ds\Map::allocate' => ['void', 'capacity'=>'int'], +'Ds\Map::allocate' => ['void', 'capacity'=>'0|positive-int'], 'Ds\Map::apply' => ['void', 'callback'=>'callable'], 'Ds\Map::count' => ['0|positive-int'], 'Ds\Map::jsonSerialize' => ['array'], -'Ds\Map::ksort' => ['void', 'comparator='=>'callable'], +'Ds\Map::ksort' => ['void', 'comparator='=>'callable|null'], 'Ds\Map::put' => ['void', 'key'=>'mixed', 'value'=>'mixed'], 'Ds\Map::putAll' => ['void', 'values'=>'mixed'], 'Ds\Map::reverse' => ['void'], -'Ds\Map::sort' => ['void', 'comparator='=>'callable'], +'Ds\Map::sort' => ['void', 'comparator='=>'callable|null'], 'Ds\Pair::jsonSerialize' => ['array'], -'Ds\PriorityQueue::count' => ['0|positive-int'], -'Ds\PriorityQueue::jsonSerialize' => ['array'], -'Ds\PriorityQueue::push' => ['void', 'value'=>'mixed', 'priority'=>'int'], -'Ds\Queue::allocate' => ['void', 'capacity'=>'int'], -'Ds\Queue::count' => ['0|positive-int'], -'Ds\Queue::jsonSerialize' => ['array'], -'Ds\Queue::push' => ['void', '...values='=>'mixed'], +'Ds\Heap::__construct' => ['void', 'comparator='=>'callable|null'], +'Ds\Heap::allocate' => ['void', 'capacity'=>'0|positive-int'], +'Ds\Heap::count' => ['0|positive-int'], +'Ds\Heap::jsonSerialize' => ['array'], +'Ds\Heap::push' => ['void', '...values='=>'mixed'], +'Ds\Set::__construct' => ['void', 'values='=>'mixed'], 'Ds\Set::add' => ['void', '...values='=>'mixed'], -'Ds\Set::allocate' => ['void', 'capacity'=>'int'], +'Ds\Set::allocate' => ['void', 'capacity'=>'0|positive-int'], 'Ds\Set::clear' => ['void'], 'Ds\Set::count' => ['0|positive-int'], 'Ds\Set::join' => ['string', 'glue='=>'string'], @@ -1681,15 +1677,13 @@ 'Ds\Set::remove' => ['void', '...values='=>'mixed'], 'Ds\Set::reverse' => ['void'], 'Ds\Set::sort' => ['void', 'comparator='=>'callable'], -'Ds\Stack::allocate' => ['void', 'capacity'=>'int'], -'Ds\Stack::count' => ['0|positive-int'], -'Ds\Stack::jsonSerialize' => ['array'], -'Ds\Vector::__construct' => ['void', 'values='=>'mixed'], -'Ds\Vector::count' => ['0|positive-int'], -'Ds\Vector::join' => ['string', 'glue='=>'string'], -'Ds\Vector::jsonSerialize' => ['array'], -'Ds\Vector::sum' => ['int|float'], -'Ds\Vector::unshift' => ['void', '...values='=>'mixed'], +'Ds\Seq::__construct' => ['void', 'values='=>'mixed'], +'Ds\Seq::allocate' => ['void', 'capacity'=>'0|positive-int'], +'Ds\Seq::count' => ['0|positive-int'], +'Ds\Seq::join' => ['string', 'glue='=>'string'], +'Ds\Seq::jsonSerialize' => ['array'], +'Ds\Seq::sum' => ['int|float'], +'Ds\Seq::unshift' => ['void', '...values='=>'mixed'], 'each' => ['array', '&rw_arr'=>'array'], 'easter_date' => ['int', 'year='=>'int'], 'easter_days' => ['int', 'year='=>'int', 'method='=>'int'], diff --git a/stubs/ext-ds.stub b/stubs/ext-ds.stub index 03acd69af5c..69e40533885 100644 --- a/stubs/ext-ds.stub +++ b/stubs/ext-ds.stub @@ -4,254 +4,241 @@ namespace Ds; use ArrayAccess; use Countable; +use IteratorAggregate; use JsonSerializable; use OutOfBoundsException; use OutOfRangeException; -use IteratorAggregate; use UnderflowException; /** - * @template-covariant TKey - * @template-covariant TValue - * @extends IteratorAggregate + * @template TValue + * @param iterable $values + * @param (callable(TValue, TValue): int)|null $comparator + * @return Heap */ -interface Collection extends IteratorAggregate, Countable, JsonSerializable -{ - /** - * @return static - */ - public function copy(); +function heap(iterable $values = [], ?callable $comparator = null): Heap {} - /** - * @return array - */ - public function toArray(): array; -} +/** + * @template TKey + * @template TValue + * @param iterable $values + * @return Map + */ +function map(iterable $values = []): Map {} /** * @template TValue - * @implements Sequence + * @param iterable $values + * @return Seq */ -final class Deque implements Sequence -{ +function seq(iterable $values = []): Seq {} + +/** + * @template TValue + * @param iterable $values + * @return Set + */ +function set(iterable $values = []): Set {} + +/** + * @template TValue + * @implements IteratorAggregate + */ +final class Heap implements Countable, IteratorAggregate, JsonSerializable { + const int MIN_CAPACITY = 8; + /** - * @param iterable $values + * @param (callable(TValue, TValue): int)|null $comparator */ - public function __construct(iterable $values = []) - { - } + public function __construct(?callable $comparator = null) {} /** - * @return Deque + * @param int<0, max> $capacity */ - public function copy() - { - } + public function allocate(int $capacity): void {} /** - * @template TValue2 - * @param iterable $values - * @return Deque + * @return int<0, max> */ - public function merge(iterable $values): Deque - { - } + public function capacity(): int {} + + public function clear(): void {} /** - * @param (callable(TValue): bool)|null $callback - * @return Deque + * @return Heap */ - public function filter(?callable $callback = null): Deque - { - } + public function copy(): Heap {} + + public function isEmpty(): bool {} /** - * @template TNewValue - * @param callable(TValue): TNewValue $callback - * @return Deque + * @return TValue */ - public function map(callable $callback): Deque - { - } + public function peek(): mixed {} /** - * @return Deque + * @phpstan-impure + * @return TValue + * @throws UnderflowException */ - public function reversed(): Deque - { - } + public function pop(): mixed {} /** - * @param (callable(TValue, TValue): int)|null $comparator - * @return Deque + * @param TValue ...$values */ - public function sorted(?callable $comparator = null): Deque - { - } + public function push(mixed ...$values): void {} /** - * @return Deque + * @return list */ - public function slice(int $offset, ?int $length = null): Deque - { - } + public function toArray(): array {} +} + +interface Key { + public function equals(mixed $other): bool; + + /** + * @return scalar + */ + public function hash(): mixed; } /** * @template TKey * @template TValue - * @implements Collection + * @implements IteratorAggregate * @implements ArrayAccess */ -final class Map implements Collection, ArrayAccess -{ +final class Map implements Countable, IteratorAggregate, JsonSerializable, ArrayAccess { + const int MIN_CAPACITY = 8; + /** * @param iterable $values */ - public function __construct(iterable $values = []) - { - } + public function __construct(iterable $values = []) {} /** - * @return Map + * @param int<0, max> $capacity */ - public function copy(): Map - { - } + public function allocate(int $capacity): void {} /** * @param callable(TKey, TValue): TValue $callback - * @return void */ - public function apply(callable $callback) - { - } + public function apply(callable $callback): void {} /** - * @return Pair - * @throws UnderflowException + * @return int<0, max> */ - public function first(): Pair - { - } + public function capacity(): int {} + + public function clear(): void {} /** - * @return Pair - * @throws UnderflowException + * @return Map */ - public function last(): Pair - { - } + public function copy(): Map {} /** - * @return Pair - * @throws OutOfRangeException + * @template TNewValue + * @param Map $map + * @return Map */ - public function skip(int $position): Pair - { - } + public function diff(Map $map): Map {} /** - * @template TKey2 - * @template TValue2 - * @param iterable $values - * @return Map + * @param callable(TKey, TValue): bool $callback + * @return Map */ - public function merge(iterable $values): Map - { - } + public function filter($callback = null): Map {} /** - * @template TKey2 - * @template TValue2 - * @param Map $map - * @return Map + * @return Pair + * @throws UnderflowException */ - public function intersect(Map $map): Map - { - } + public function first(): Pair {} /** - * @template TValue2 - * @param Map $map - * @return Map + * @template TDefault + * @param TKey $key + * @param TDefault $default + * @return TValue|TDefault + * @throws OutOfBoundsException */ - public function diff(Map $map): Map - { - } + public function get($key, $default = null): mixed {} /** * @param TKey $key */ - public function hasKey($key): bool - { - } + public function hasKey(mixed $key): bool {} /** * @param TValue $value */ - public function hasValue($value): bool - { - } + public function hasValue(mixed $value): bool {} /** - * @param (callable(TKey, TValue): bool)|null $callback - * @return Map + * @template TKey2 + * @template TValue2 + * @param Map $map + * @return Map */ - public function filter(?callable $callback = null): Map - { - } + public function intersect(Map $map): Map {} + + public function isEmpty(): bool {} /** - * @template TDefault - * @param TKey $key - * @param TDefault $default - * @return TValue|TDefault - * @throws OutOfBoundsException + * @return Set */ - public function get($key, $default = null) - { - } + public function keys(): Set {} /** - * @return Set + * @param (callable(TKey, TKey): int)|null $comparator */ - public function keys(): Set - { - } + public function ksort(?callable $comparator = null): void {} + + /** + * @param (callable(TKey, TKey): int)|null $comparator + * @return Map + */ + public function ksorted(?callable $comparator = null): Map {} + + /** + * @return Pair + * @throws UnderflowException + */ + public function last(): Pair {} /** * @template TNewValue * @param callable(TKey, TValue): TNewValue $callback * @return Map */ - public function map(callable $callback): Map - { - } + public function map(callable $callback): Map {} + + /** + * @template TKey2 + * @template TValue2 + * @param iterable $values + * @return Map + */ + public function merge(iterable $values): Map {} /** - * @return Sequence> + * @return Seq> */ - public function pairs(): Sequence - { - } + public function pairs(): Seq {} /** * @param TKey $key * @param TValue $value - * @return void */ - public function put($key, $value) - { - } + public function put(mixed $key, mixed $value): void {} /** - * @param iterable $values - * @return void + * @param iterable $pairs */ - public function putAll(iterable $values) - { - } + public function putAll(iterable $pairs): void {} /** * @template TCarry @@ -259,80 +246,54 @@ final class Map implements Collection, ArrayAccess * @param TCarry $initial * @return TCarry */ - public function reduce(callable $callback, $initial = null) - { - } + public function reduce(callable $callback, mixed $initial = null): mixed {} /** + * @phpstan-impure * @template TDefault * @param TKey $key * @param TDefault $default * @return TValue|TDefault - * @throws \OutOfBoundsException + * @throws OutOfBoundsException */ - public function remove($key, $default = null) - { - } + public function remove($key, $default = null): mixed {} - /** - * @return Map - */ - public function reversed(): Map - { - } + public function reverse(): void {} /** * @return Map */ - public function slice(int $offset, ?int $length = null): Map - { - } + public function reversed(): Map {} /** - * @param (callable(TValue, TValue): int)|null $comparator - * @return void + * @param int<0, max> $position + * @return Pair + * @throws OutOfRangeException */ - public function sort(?callable $comparator = null) - { - } + public function skip(int $position): Pair {} /** - * @param (callable(TValue, TValue): int)|null $comparator * @return Map */ - public function sorted(?callable $comparator = null): Map - { - } + public function slice(int $index, ?int $length = null): Map {} /** - * @param (callable(TKey, TKey): int)|null $comparator - * @return void + * @param (callable(TValue, TValue): int)|null $comparator */ - public function ksort(?callable $comparator = null) - { - } + public function sort(?callable $comparator = null): void {} /** - * @param (callable(TKey, TKey): int)|null $comparator + * @param (callable(TValue, TValue): int)|null $comparator * @return Map */ - public function ksorted(?callable $comparator = null): Map - { - } + public function sorted(?callable $comparator = null): Map {} - /** - * @return array - */ - public function toArray(): array - { - } + public function sum(): int|float {} /** - * @return Sequence + * @return array */ - public function values(): Sequence - { - } + public function toArray(): array {} /** * @template TKey2 @@ -340,9 +301,12 @@ final class Map implements Collection, ArrayAccess * @param Map $map * @return Map */ - public function union(Map $map): Map - { - } + public function union(Map $map): Map {} + + /** + * @return Seq + */ + public function values(): Seq {} /** * @template TKey2 @@ -350,130 +314,141 @@ final class Map implements Collection, ArrayAccess * @param Map $map * @return Map */ - public function xor(Map $map): Map - { - } + public function xor(Map $map): Map {} } /** * @template TKey * @template TValue */ -final class Pair implements JsonSerializable -{ +final readonly class Pair implements JsonSerializable { /** * @var TKey */ - public $key; - + public mixed $key; /** * @var TValue */ - public $value; + public mixed $value; /** * @param TKey $key * @param TValue $value */ - public function __construct($key = null, $value = null) - { - } + public function __construct(mixed $key, mixed $value) {} /** - * @return Pair + * @return array{'key': TKey, 'value': TValue} */ - public function copy(): Pair - { - } + public function toArray(): array {} } /** * @template TValue - * @extends Collection - * @extends ArrayAccess + * @implements IteratorAggregate + * @implements ArrayAccess */ -interface Sequence extends Collection, ArrayAccess -{ +final class Seq implements Countable, IteratorAggregate, JsonSerializable, ArrayAccess { + const int MIN_CAPACITY = 8; + + /** + * @param iterable $values + */ + public function __construct($values = null) {} + + /** + * @param int<0, max> $capacity + */ + public function allocate(int $capacity): void {} + /** * @param callable(TValue): TValue $callback - * @return void */ - public function apply(callable $callback); + public function apply(callable $callback): void {} + + /** + * @return int<0, max> + */ + public function capacity(): int {} + + public function clear(): void {} /** * @param TValue ...$values */ - public function contains(...$values): bool; + public function contains(mixed ...$values): bool {} + + /** + * @return Seq + */ + public function copy(): Seq {} /** - * @param (callable(TValue): bool)|null $callback - * @return Sequence + * @param callable(TValue): bool $callback + * @return Seq */ - public function filter(?callable $callback = null); + public function filter($callback = null): Seq {} /** * @param TValue $value - * @return int|false */ - public function find($value); + public function find(mixed $value): int|false {} /** * @return TValue - * @throws \UnderflowException + * @throws OutOfRangeException */ - public function first(); + public function first(): mixed {} /** + * @param int<0, max> $index * @return TValue - * @throws \OutOfRangeException + * @throws OutOfRangeException */ - public function get(int $index); + public function get(int $index): mixed {} /** + * @param int<0, max> $index * @param TValue ...$values - * @throws \OutOfRangeException - * @return void */ - public function insert(int $index, ...$values); + public function insert(int $index, mixed ...$values): void {} - /** - * @param string $glue - * @return string - */ - public function join(?string $glue = null): string; + public function isEmpty(): bool {} + + public function join(string $glue = ""): string {} /** + * @phpstan-impure * @return TValue - * @throws \UnderflowException + * @throws OutOfRangeException */ - public function last(); + public function last(): mixed {} /** * @template TNewValue * @param callable(TValue): TNewValue $callback - * @return Sequence + * @return Seq */ - public function map(callable $callback); + public function map(callable $callback): Seq {} /** * @template TValue2 * @param iterable $values - * @return Sequence + * @return Seq */ - public function merge(iterable $values); + public function merge(iterable $values): Seq {} /** - * @return TValue - * @throws \UnderflowException * @phpstan-impure + * @return TValue + * @throws UnderflowException */ - public function pop(); + public function pop(): mixed {} /** * @param TValue ...$values - * @return void */ - public function push(...$values); + public function push(mixed ...$values): void {} /** * @template TCarry @@ -481,229 +456,163 @@ interface Sequence extends Collection, ArrayAccess * @param TCarry $initial * @return TCarry */ - public function reduce(callable $callback, $initial = null); + public function reduce(callable $callback, mixed $initial = null): mixed {} /** + * @phpstan-impure + * @param int<0, max> $index * @return TValue - * @throws \OutOfRangeException + * @throws OutOfRangeException */ - public function remove(int $index); + public function remove(int $index): mixed {} + + public function reverse(): void {} /** - * @return Sequence + * @return Seq */ - public function reversed(); + public function reversed(): Seq {} + + public function rotate(int $rotations): void {} /** + * @param int<0, max> $index * @param TValue $value - * @throws \OutOfRangeException - * @return void */ - public function set(int $index, $value); + public function set(int $index, mixed $value): void {} /** - * @return TValue - * @throws \UnderflowException * @phpstan-impure + * @return TValue + * @throws UnderflowException */ - public function shift(); + public function shift(): mixed {} /** - * @return Sequence + * @return Seq */ - public function slice(int $index, ?int $length = null); + public function slice(int $index, ?int $length = null): Seq {} /** * @param (callable(TValue, TValue): int)|null $comparator - * @return void */ - public function sort(?callable $comparator = null); + public function sort(?callable $comparator = null): void {} /** * @param (callable(TValue, TValue): int)|null $comparator - * @return Sequence + * @return Seq */ - public function sorted(?callable $comparator = null); + public function sorted(?callable $comparator = null): Seq {} + + public function sum(): int|float {} + + /** + * @return list + */ + public function toArray(): array {} /** * @param TValue ...$values - * @return void */ - public function unshift(...$values); + public function unshift(mixed ...$values): void {} } - /** * @template TValue - * @implements Sequence + * @implements IteratorAggregate + * @implements ArrayAccess */ -final class Vector implements Sequence -{ - /** - * @param iterable $values - */ - public function __construct(iterable $values = []) - { - } - - /** - * @return Vector - */ - public function copy() - { - } - - /** - * @return Vector - */ - public function reversed(): Vector - { - } +final class Set implements Countable, IteratorAggregate, JsonSerializable, ArrayAccess { + const int MIN_CAPACITY = 8; /** - * @return Vector - */ - public function slice(int $offset, ?int $length = null): Vector - { - } - - /** - * @param (callable(TValue, TValue): int)|null $comparator - * @return Vector - */ - public function sorted(?callable $comparator = null): Vector - { - } - - /** - * @param (callable(TValue): bool)|null $callback - * @return Vector + * @param iterable $values */ - public function filter(?callable $callback = null): Vector - { - } + public function __construct(iterable $values = []) {} /** - * @template TNewValue - * @param callable(TValue): TNewValue $callback - * @return Vector + * @param TValue ...$values */ - public function map(callable $callback): Vector - { - } + public function add(mixed ...$values): void {} /** - * @template TValue2 - * @param iterable $values - * @return Vector + * @param int<0, max> $capacity */ - public function merge(iterable $values): Vector - { - } -} + public function allocate(int $capacity): void {} -/** - * @template TValue - * @implements Collection - * @implements ArrayAccess - */ -final class Set implements Collection, ArrayAccess -{ /** - * @param iterable $values + * @return int<0, max> */ - public function __construct(iterable $values = []) - { - } + public function capacity(): int {} - /** - * @param TValue ...$values - */ - public function add(...$values): void - { - } + public function clear(): void {} /** * @param TValue ...$values */ - public function contains(...$values): bool - { - } + public function contains(mixed ...$values): bool {} /** * @return Set */ - public function copy(): Set - { - } + public function copy(): Set {} /** * @template TValue2 * @param Set $set * @return Set */ - public function diff(Set $set): Set - { - } + public function diff(Set $set): Set {} /** - * @param (callable(TValue): bool)|null $callback + * @param callable(TValue): bool $callback * @return Set */ - public function filter(?callable $callback = null): Set - { - } + public function filter($callback = null): Set {} /** * @return TValue - * @throws \UnderflowException + * @throws UnderflowException */ - public function first() - { - } + public function first(): mixed {} /** + * @param int<0, max> $index * @return TValue - * @throws \OutOfRangeException + * @throws OutOfRangeException */ - public function get(int $index) - { - } + public function get(int $index): mixed {} /** * @template TValue2 * @param Set $set * @return Set */ - public function intersect(Set $set): Set - { - } + public function intersect(Set $set): Set {} + + public function isEmpty(): bool {} + + public function join(string $glue = ""): string {} /** * @return TValue - * @throws \UnderflowException + * @throws UnderflowException */ - public function last() - { - } + public function last(): mixed {} /** * @template TNewValue * @param callable(TValue): TNewValue $callback * @return Set */ - public function map(callable $callback): Set - { - } + public function map(callable $callback): Set {} /** * @template TValue2 * @param iterable $values * @return Set */ - public function merge(iterable $values): Set - { - } + public function merge(iterable $values): Set {} /** * @template TCarry @@ -711,220 +620,53 @@ final class Set implements Collection, ArrayAccess * @param TCarry $initial * @return TCarry */ - public function reduce(callable $callback, $initial = null) - { - } + public function reduce(callable $callback, mixed $initial = null): mixed {} /** * @param TValue ...$values */ - public function remove(...$values): void - { - } + public function remove(mixed ...$values): void {} + + public function reverse(): void {} /** * @return Set */ - public function reversed(): Set - { - } + public function reversed(): Set {} /** * @return Set */ - public function slice(int $index, ?int $length = null): Set - { - } + public function slice(int $index, ?int $length = null): Set {} /** * @param (callable(TValue, TValue): int)|null $comparator */ - public function sort(?callable $comparator = null): void - { - } + public function sort(?callable $comparator = null): void {} /** * @param (callable(TValue, TValue): int)|null $comparator * @return Set */ - public function sorted(?callable $comparator = null): Set - { - } + public function sorted(?callable $comparator = null): Set {} + /** * @return list */ - public function toArray(): array - { - } + public function toArray(): array {} /** * @template TValue2 * @param Set $set * @return Set */ - public function union(Set $set): Set - { - } + public function union(Set $set): Set {} /** * @template TValue2 * @param Set $set * @return Set */ - 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 - */ - public function copy(): Stack - { - } - - /** - * @return TValue - * @throws UnderflowException - */ - public function peek() - { - } - - /** - * @return TValue - * @throws UnderflowException - * @phpstan-impure - */ - public function pop() - { - } - - /** - * @param TValue ...$values - * @return void - */ - public function push(...$values): void - { - } - - /** - * @return list - */ - public function toArray(): array - { - } -} - -/** - * @template TValue - * @implements Collection - * @implements ArrayAccess - */ -final class Queue implements Collection, ArrayAccess -{ - /** - * @param iterable $values - */ - public function __construct(iterable $values = []) - { - } - - /** - * @return Queue - */ - public function copy(): Queue - { - } - - /** - * @return TValue - * @throws UnderflowException - */ - public function peek() - { - } - - /** - * @return TValue - * @throws UnderflowException - * @phpstan-impure - */ - public function pop() - { - } - - /** - * @param TValue ...$values - */ - public function push(...$values): void - { - } - - /** - * @return list - */ - public function toArray(): array - { - } -} - -/** - * @template TValue - * @implements Collection - */ -final class PriorityQueue implements Collection -{ - /** - * @return PriorityQueue - */ - public function copy(): PriorityQueue - { - } - - /** - * @return TValue - * @throws UnderflowException - */ - public function peek() - { - } - - /** - * @return TValue - * @throws UnderflowException - * @phpstan-impure - */ - public function pop() - { - } - - /** - * @param TValue $value - */ - public function push($value, int $priority): void - { - } - - /** - * @return list - */ - public function toArray(): array - { - } + public function xor(Set $set): Set {} }