Methods |
public
|
__construct($items = [])
|
#
|
public
|
isEmpty(): bool
|
#
|
public
|
has($key): bool
|
#
|
public
|
get($key)
|
#
|
public
|
forEach(callable $callback, int $mode = CollectionInterface::CALLBACK_USE_VALUE)
|
#
|
public
|
find(callable $callback, int $mode = CollectionInterface::CALLBACK_USE_VALUE | CollectionInterface::FIND_VALUE)
|
#
|
public
|
hasValue($value, bool $strict = false): bool
|
#
|
public
|
keyOf($value, bool $strict = false)
|
#
|
public
|
firstOf($value)
|
#
|
public
|
all(): array
|
#
|
public
|
toArray(): array
|
#
|
public
|
jsonSerialize(): array<TKey, mixed>
|
#
|
public
|
toJson(int $flags = 0): string
|
#
|
public
|
first()
|
#
|
public
|
last()
|
#
|
public
|
nth(int $n)
|
#
|
public
|
getIterator(): Traversable<TKey, TValue>
|
#
|
public
|
offsetExists(TKey $offset): bool
|
#
|
public
|
offsetGet(TKey $offset): TValue
|
#
|
public
|
count(): int
|
#
|
protected
|
getItemsArray(Arrayable<TKey, TValue>|iterable<TKey, TValue> $items): array<TKey, TValue>
|
#
|
protected
|
getItems(Arrayable<TKey, TValue>|iterable<TKey, TValue> $items): iterable<TKey, TValue>
|
#
|
protected
|
filterItems(iterable<TKey, TValue> $items): iterable<TKey, TValue>
Override to normalise items applied to the collection
Override to normalise items applied to the collection
|
#
|
protected
|
compareItems(TValue $a, TValue $b): int
Compare items using Comparable::compare() if implemented
Compare items using Comparable::compare() if implemented
|
#
|
protected
|
getCallbackValue(
int-mask-of<CollectionInterface::*> $mode,
TKey $key,
TValue $value,
): ($mode is 3|11|19 ? array{TKey, TValue} : ($mode is 2|10|18 ? TKey : TValue))
|
#
|
protected
|
getReturnValue(
int-mask-of<CollectionInterface::*> $mode,
TKey $key,
TValue $value,
): ($mode is 16|17|18|19 ? TKey : TValue)
|
#
|