class Sequence implements Countable

Properties

protected array $sequence

The sequence of return values.

int $count

The count of the sequence items.

int $index

The current index of the sequence iteration.

Methods

__construct(mixed ...$sequence)

Create a new sequence instance.

int
count()

Get the current count of the sequence items.

mixed
__invoke(array|Model $attributes = [], Model|null $parent = null)

Get the next value in the sequence.

Details

at line 30
__construct(mixed ...$sequence)

Create a new sequence instance.

Parameters

mixed ...$sequence

at line 39
int count()

Get the current count of the sequence items.

Return Value

int

at line 49
mixed __invoke(array|Model $attributes = [], Model|null $parent = null)

Get the next value in the sequence.

Parameters

array|Model $attributes
Model|null $parent

Return Value

mixed