Documentation

Iter
in package
implements Countable, IteratorAggregate, IterOps Uses IterTrait

Tags
template

TKey

template

TVal

implements

IteratorAggregate<TKey, TVal>

implements

IterOps<TKey, TVal>

Table of Contents

Interfaces

Countable
IteratorAggregate
IterOps

Properties

$iterator  : Iterator

Methods

__construct()  : mixed
all()  : bool
any()  : bool
chunkBy()  : IterOps<int, array<string|int, TVal>>
collect()  : object
concat()  : IterOps<TKey, TVal>
consume()  : void
Iterates over this without doing anything else.
count()  : int
countUntil()  : int
cycle()  : IterOps<TKey, TVal>
dedup()  : IterOps<TKey, TVal>
dedupBy()  : IterOps<TKey, TVal>
each()  : IterOps<TKey, TVal>
enumerate()  : IterOps<TKey, TVal}>
filter()  : IterOps<TKey, TVal>
find()  : Option<string|int, TVal>
findKey()  : Option<string|int, TVal>
findLast()  : Option<string|int, TVal>
findLastKey()  : Option<string|int, TVal>
flatMap()  : IterOps<TKey, UVal>
flatten()  : IterOps
Flattens one level of an iterator of iterators.
fold()  : U
fromIterable()  : IterOps<UKey, UVal>
generate()  : IterOps<int, T>
getIter()  : Iterator
isEmpty()  : bool
join()  : string
keys()  : IterOps<int, TKey>
last()  : Option<string|int, TVal>
map()  : IterOps<TKey, UVal>
max()  : Option<string|int, TVal>
min()  : Option<string|int, TVal>
nth()  : Option<string|int, TVal>
position()  : Option<string|int, int>
reduce()  : Option<string|int, U>
reject()  : IterOps<TKey, TVal>
repeat()  : IterOps<int, U>
repeatWith()  : IterOps<int, T>
Returns an iterator that yields the result of the given callback infinitely.
skip()  : IterOps<TKey, TVal>
skipEvery()  : IterOps<TKey, TVal>
skipWhile()  : IterOps<TKey, TVal>
slice()  : IterOps<TKey, TVal>
sorted()  : IterOps<TKey, TVal>
take()  : IterOps<TKey, TVal>
takeEvery()  : IterOps<TKey, TVal>
takeRandom()  : array<string|int, TVal>
takeWhile()  : IterOps<TKey, TVal>
toArray()  : array<string|int, TVal>
toList()  : array<int, TVal>
toSortedArray()  : array<string|int, TVal>
toSortedList()  : array<int, TVal>
tryCollect()  : Result<object, Throwable>
unique()  : IterOps<TKey, TVal>
uniqueBy()  : IterOps<TKey, TVal>
unzip()  : array<string|int, mixed>
values()  : IterOps<int, TVal>
zip()  : IterOps<UKey}, UVal}>
zipMultiple()  : IterOps<array<string|int, mixed>, array<string|int, mixed>>

Properties

$iterator read-only

private Iterator $iterator

Methods

__construct()

public __construct(Iterator<TKey, TVal$iterator) : mixed
Parameters
$iterator : Iterator<TKey, TVal>

all()

public all(callable $predicate) : bool
Parameters
$predicate : callable
Return values
bool

any()

public any(callable $predicate) : bool
Parameters
$predicate : callable
Return values
bool

chunkBy()

public chunkBy(callable $f[, bool $preserveKeys = false ]) : IterOps<int, array<string|int, TVal>>
Parameters
$f : callable
$preserveKeys : bool = false
Return values
IterOps<int, array<string|int, TVal>>

collect()

public collect(D> $dest) : object
Parameters
$dest : D>
Tags
template

D of FromIterator

psalm-return

D

psalm-suppress

MixedInferredReturnType

Return values
object

concat()

public concat(Iterator<TKey, TVal>|Iter<TKey, TVal...$iterators) : IterOps<TKey, TVal>
Parameters
$iterators : Iterator<TKey, TVal>|Iter<TKey, TVal>
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
IterOps<TKey, TVal>

consume()

Iterates over this without doing anything else.

public consume() : void

count()

public count() : int
Return values
int

countUntil()

public countUntil(int $limit) : int
Parameters
$limit : int
Return values
int

dedupBy()

public dedupBy(callable $f) : IterOps<TKey, TVal>
Parameters
$f : callable
Return values
IterOps<TKey, TVal>

each()

public each(callable $f) : IterOps<TKey, TVal>
Parameters
$f : callable
Return values
IterOps<TKey, TVal>

filter()

public filter(callable $predicate) : IterOps<TKey, TVal>
Parameters
$predicate : callable
Return values
IterOps<TKey, TVal>

find()

public find(callable $predicate) : Option<string|int, TVal>
Parameters
$predicate : callable
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
Option<string|int, TVal>

findKey()

public findKey(callable $predicate) : Option<string|int, TVal>
Parameters
$predicate : callable
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
Option<string|int, TVal>

findLast()

public findLast(callable $predicate) : Option<string|int, TVal>
Parameters
$predicate : callable
Return values
Option<string|int, TVal>

findLastKey()

public findLastKey(callable $predicate) : Option<string|int, TVal>
Parameters
$predicate : callable
Return values
Option<string|int, TVal>

flatMap()

public flatMap(callable $f) : IterOps<TKey, UVal>
Parameters
$f : callable
Tags
template

UKey

template

UVal

Return values
IterOps<TKey, UVal>

flatten()

Flattens one level of an iterator of iterators.

public flatten() : IterOps
Tags
psalm-suppress

MixedArgumentTypeCoercion

Return values
IterOps

fold()

public fold(U $initialValue, callable $f) : U
Parameters
$initialValue : U
$f : callable
Tags
template

U

Return values
U

fromIterable()

public static fromIterable(iterable<UKey, UVal$iterable) : IterOps<UKey, UVal>
Parameters
$iterable : iterable<UKey, UVal>
Tags
template

UKey

template

UVal

throws
Exception
psalm-suppress

InvalidReturnStatement, InvalidReturnType

Return values
IterOps<UKey, UVal>

generate()

public static generate(T $initialValue, callable $genFn) : IterOps<int, T>
Parameters
$initialValue : T
$genFn : callable
Tags
template

T

Return values
IterOps<int, T>

getIter()

public getIter() : Iterator
Tags
inheritDoc
Return values
Iterator

isEmpty()

public isEmpty() : bool
Return values
bool

join()

public join([string $separator = "" ]) : string
Parameters
$separator : string = ""
Return values
string

keys()

public keys() : IterOps<int, TKey>
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
IterOps<int, TKey>

map()

public map(callable $f) : IterOps<TKey, UVal>
Parameters
$f : callable
Tags
template

UVal

Return values
IterOps<TKey, UVal>

max()

public max(callable|null $comparator) : Option<string|int, TVal>
Parameters
$comparator : callable|null
Tags
psalm-suppress

MixedArgumentTypeCoercion

Return values
Option<string|int, TVal>

min()

public min(callable|null $comparator) : Option<string|int, TVal>
Parameters
$comparator : callable|null
Tags
psalm-suppress

MixedArgumentTypeCoercion

Return values
Option<string|int, TVal>

nth()

public nth(int $n) : Option<string|int, TVal>
Parameters
$n : int
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
Option<string|int, TVal>

position()

public position(callable $predicate) : Option<string|int, int>
Parameters
$predicate : callable
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
Option<string|int, int>

reduce()

public reduce(callable $f) : Option<string|int, U>
Parameters
$f : callable
Tags
template

U

psalm-suppress

InvalidReturnType, MixedArgumentTypeCoercion, PossiblyInvalidArgument

Return values
Option<string|int, U>

reject()

public reject(callable $predicate) : IterOps<TKey, TVal>
Parameters
$predicate : callable
Return values
IterOps<TKey, TVal>

repeat()

public static repeat(U $value) : IterOps<int, U>
Parameters
$value : U
Tags
template

U

Return values
IterOps<int, U>

repeatWith()

Returns an iterator that yields the result of the given callback infinitely.

public static repeatWith(callable $f) : IterOps<int, T>
Parameters
$f : callable
Tags
template

T

Return values
IterOps<int, T>

skipEvery()

public skipEvery(int $step) : IterOps<TKey, TVal>
Parameters
$step : int
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
IterOps<TKey, TVal>

skipWhile()

public skipWhile(callable $predicate) : IterOps<TKey, TVal>
Parameters
$predicate : callable
Return values
IterOps<TKey, TVal>

slice()

public slice(int $start[, int $amount = -1 ]) : IterOps<TKey, TVal>
Parameters
$start : int
$amount : int = -1
Return values
IterOps<TKey, TVal>

sorted()

public sorted(callable $comparator[, bool $preserveKeys = true ]) : IterOps<TKey, TVal>
Parameters
$comparator : callable
$preserveKeys : bool = true
Return values
IterOps<TKey, TVal>

takeEvery()

public takeEvery(int<0, max> $step) : IterOps<TKey, TVal>
Parameters
$step : int<0, max>
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
IterOps<TKey, TVal>

takeRandom()

public takeRandom([int $count = 1 ][, bool $preserveKeys = false ]) : array<string|int, TVal>
Parameters
$count : int = 1
$preserveKeys : bool = false
Tags
psalm-return

list<TVal>

psalm-suppress

MixedArgumentTypeCoercion, MixedAssignment, MixedArrayOffset, MoreSpecificReturnType, InvalidArrayOffset

Return values
array<string|int, TVal>

takeWhile()

public takeWhile(callable $predicate) : IterOps<TKey, TVal>
Parameters
$predicate : callable
Return values
IterOps<TKey, TVal>

toArray()

public toArray() : array<string|int, TVal>
Return values
array<string|int, TVal>

toList()

public toList() : array<int, TVal>
Tags
psalm-return

list<TVal>

Return values
array<int, TVal>

toSortedArray()

public toSortedArray(callable $comparator) : array<string|int, TVal>
Parameters
$comparator : callable
Return values
array<string|int, TVal>

toSortedList()

public toSortedList(callable $comparator) : array<int, TVal>
Parameters
$comparator : callable
Tags
psalm-return

list<TVal>

Return values
array<int, TVal>

tryCollect()

public tryCollect(D> $dest) : Result<object, Throwable>
Parameters
$dest : D>
Tags
template

D of TryFromIterator

psalm-return

Result<D, Throwable>

psalm-suppress

MixedInferredReturnType, InvalidReturnType

Return values
Result<object, Throwable>

uniqueBy()

public uniqueBy(callable $f) : IterOps<TKey, TVal>
Parameters
$f : callable
Return values
IterOps<TKey, TVal>

unzip()

public unzip() : array<string|int, mixed>
Tags
psalm-suppress

MixedReturnTypeCoercion, MixedAssignment

Return values
array<string|int, mixed>

values()

public values() : IterOps<int, TVal>
Tags
psalm-suppress

MixedReturnTypeCoercion

Return values
IterOps<int, TVal>

zip()

public zip(Iterator<UKey, UVal>|Iter<UKey, UVal$iterator) : IterOps<UKey}, UVal}>
Parameters
$iterator : Iterator<UKey, UVal>|Iter<UKey, UVal>
Tags
template

UKey

template

UVal

psalm-suppress

InvalidReturnType, MoreSpecificReturnType

Return values
IterOps<UKey}, UVal}>

zipMultiple()

public zipMultiple(Iterator|Iter ...$iterators) : IterOps<array<string|int, mixed>, array<string|int, mixed>>
Parameters
$iterators : Iterator|Iter
Return values
IterOps<array<string|int, mixed>, array<string|int, mixed>>

        
On this page

Search results