<TKey is array-key, TValue>
Implements CollectionInterface
Unless otherwise noted, {@see CollectionTrait} methods operate on one instance of the class. Immutable collections should use {@see ImmutableCollectionTrait} instead.
Methods | ||
---|---|---|
public
|
set($key, $value)
|
# |
public
|
unset($key)
|
# |
public
|
pop(&$last = null)
|
# |
public
|
sort(): static
|
# |
public
|
reverse(): static
|
# |
public
|
map<T is TValue|TKey|array{TKey, TValue}, TReturn>(
callable(T, T|null $next, T|null $prev): TReturn $callback,
int $mode = CollectionInterface::CALLBACK_USE_VALUE,
)
|
# |
public
|
filter<T is TValue|TKey|array{TKey, TValue}>(
callable(T, T|null $next, T|null $prev): bool $callback,
int $mode = CollectionInterface::CALLBACK_USE_VALUE,
): static
|
# |
public
|
only(array $keys): static
|
# |
public
|
onlyIn(array $index): static
|
# |
public
|
except(array $keys): static
|
# |
public
|
exceptIn(array $index): static
|
# |
public
|
slice(int $offset, ?int $length = null): static
|
# |
public
|
shift(&$first = null)
|
# |
public
|
merge($items)
|
# |
public
|
offsetSet(TKey|null $offset, TValue $value): void
|
# |
public
|
offsetUnset(TKey $offset): void
|
# |
protected
|
maybeReplaceItems(array<TKey, TValue> $items, ?bool $getClone = null): static
|
# |
protected
|
replaceItems(array<TKey, TValue> $items, ?bool $getClone = null): static
|
# |
protected
|
maybeClone(): static
|
# |
protected
|
handleItemsReplaced(): void
|
# |