final class Seq implements Countable, IteratorAggregate, JsonSerializable, ArrayAccess (View source)

Constants

MIN_CAPACITY

Methods

__construct(iterable $values = [])

No description

void
allocate(int $capacity)

No description

void
apply(callable $callback)

No description

int
capacity()

No description

void
clear()

No description

bool
contains(TValue ...$values)

No description

Seq
copy()

No description

int
count()

Count elements of an object

Seq
filter(callable|null $callback = null)

No description

int|false
find(TValue $value)

No description

TValue
first()

No description

getIterator()

No description

TValue
get(int $index)

No description

void
insert(int $index, TValue ...$values)

No description

bool
isEmpty()

No description

string
join(string $glue = '')

No description

mixed
jsonSerialize()

No description

TValue
last()

No description

Seq
map(callable $callback)

No description

Seq
merge(TValue> $values)

No description

TValue
pop()

No description

void
push(TValue ...$values)

No description

TReturn|null
reduce(callable $callback, TInitial|null $initial = null)

No description

TValue
remove(int $index)

No description

void
reverse()

No description

Seq
reversed()

No description

void
rotate(int $rotations)

No description

void
set(int $index, TValue $value)

No description

TValue
shift()

No description

Seq
slice(int $index, int|null $length = null)

No description

void
sort(callable|null $comparator = null)

No description

Seq
sorted(callable|null $comparator = null)

No description

int|float
sum()

No description

array
toArray()

No description

void
unshift(TValue ...$values)

No description

array
__serialize()

No description

void
__unserialize(array $data)

No description

bool
offsetExists(TKey $offset)

Whether a offset exists

mixed
offsetGet(TKey $offset)

Offset to retrieve

void
offsetSet(TKey $offset, TValue $value)

Offset to set

void
offsetUnset(TKey $offset)

Offset to unset

Details

__construct(iterable $values = [])

No description

Parameters

iterable $values

void allocate(int $capacity)

No description

Parameters

int $capacity

Return Value

void

void apply(callable $callback)

No description

Parameters

callable $callback

Return Value

void

int capacity()

No description

Return Value

int

void clear()

No description

Return Value

void

bool contains(TValue ...$values)

No description

Parameters

TValue ...$values

Return Value

bool

Seq copy()

No description

Return Value

Seq

int count()

Count elements of an object

Return Value

int

The custom count as an integer.

The return value is cast to an integer.

Seq filter(callable|null $callback = null)

No description

Parameters

callable|null $callback

Return Value

Seq

int|false find(TValue $value)

No description

Parameters

TValue $value

Return Value

int|false

TValue first()

No description

Return Value

TValue

Traversable getIterator()

No description

Return Value

Traversable

An instance of an object implementing Iterator or Traversable

TValue get(int $index)

No description

Parameters

int $index

Return Value

TValue

void insert(int $index, TValue ...$values)

No description

Parameters

int $index
TValue ...$values

Return Value

void

bool isEmpty()

No description

Return Value

bool

string join(string $glue = '')

No description

Parameters

string $glue

Return Value

string

mixed jsonSerialize()

No description

Return Value

mixed

data which can be serialized by json_encode, which is a value of any type other than a resource.

TValue last()

No description

Return Value

TValue

Seq map(callable $callback)

No description

Parameters

callable $callback

Return Value

Seq

Seq merge(TValue> $values)

No description

Parameters

TValue> $values

Return Value

Seq

TValue pop()

No description

Return Value

TValue

void push(TValue ...$values)

No description

Parameters

TValue ...$values

Return Value

void

TReturn|null reduce(callable $callback, TInitial|null $initial = null)

No description

Parameters

callable $callback
TInitial|null $initial

Return Value

TReturn|null

TValue remove(int $index)

No description

Parameters

int $index

Return Value

TValue

void reverse()

No description

Return Value

void

Seq reversed()

No description

Return Value

Seq

void rotate(int $rotations)

No description

Parameters

int $rotations

Return Value

void

void set(int $index, TValue $value)

No description

Parameters

int $index
TValue $value

Return Value

void

TValue shift()

No description

Return Value

TValue

Seq slice(int $index, int|null $length = null)

No description

Parameters

int $index
int|null $length

Return Value

Seq

void sort(callable|null $comparator = null)

No description

Parameters

callable|null $comparator

Return Value

void

Seq sorted(callable|null $comparator = null)

No description

Parameters

callable|null $comparator

Return Value

Seq

int|float sum()

No description

Return Value

int|float

array toArray()

No description

Return Value

array

void unshift(TValue ...$values)

No description

Parameters

TValue ...$values

Return Value

void

array __serialize()

No description

Return Value

array

void __unserialize(array $data)

No description

Parameters

array $data

Return Value

void

bool offsetExists(TKey $offset)

Whether a offset exists

Parameters

TKey $offset

An offset to check for.

Return Value

bool

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

mixed offsetGet(TKey $offset)

Offset to retrieve

Parameters

TKey $offset

The offset to retrieve.

Return Value

mixed

Can return all value types.

void offsetSet(TKey $offset, TValue $value)

Offset to set

Parameters

TKey $offset

The offset to assign the value to.

TValue $value

The value to set.

Return Value

void

void offsetUnset(TKey $offset)

Offset to unset

Parameters

TKey $offset

The offset to unset.

Return Value

void