Documentation

PQueue
in package

Simple priority queue.

Tags
phpstan-template

T

Table of Contents

$comparator  : callable
$contents  : array<string|int, mixed>
$sorted  : bool
__construct()  : mixed
getContent()  : array<string|int, T>
map()  : array<string|int, mixed>
peek()  : mixed
pop()  : mixed|null
push()  : void
setComparator()  : void
size()  : int
sort()  : void

Properties

$comparator

private callable $comparator = null
Tags
phpstan-var

callable(T, T): int

$contents

private array<string|int, mixed> $contents = []
Tags
phpstan-var

array<T>

$sorted

private bool $sorted = false

Methods

__construct()

public __construct(callable $comparator) : mixed
Parameters
$comparator : callable
Return values
mixed

getContent()

public getContent([bool $sorted = true ]) : array<string|int, T>
Parameters
$sorted : bool = true
Tags
phpstan-return

array<T>

Return values
array<string|int, T>

map()

public map(callable $function[, bool $sorted = true ]) : array<string|int, mixed>
Parameters
$function : callable
$sorted : bool = true
Tags
phpstan-template

R

phpstan-param

callable(T): R $function

phpstan-return

array<R>

Return values
array<string|int, mixed>

peek()

public peek([int|null $index = null ]) : mixed
Parameters
$index : int|null = null
Tags
phpstan-return

T

Return values
mixed

pop()

public pop() : mixed|null
Tags
phpstan-return

T|null

Return values
mixed|null

push()

public push(mixed $object) : void
Parameters
$object : mixed
Tags
phpstan-param

T $object

Return values
void

setComparator()

public setComparator(callable $function) : void
Parameters
$function : callable
Tags
phpstan-param

callable(T, T): int $function

Return values
void

size()

public size() : int
Return values
int

sort()

private sort() : void
Return values
void

Search results