BaseCollection implements Countable, IteratorAggregate
AbstractYes
Tags
Table of Contents
Interfaces
- Countable
- IteratorAggregate
Methods
- __clone() : void
- __construct() : mixed
- add() : void
- all() : array<int, T>
- clear() : void
- contains() : bool
- count() : int
- empty() : bool
- filter() : self
- first() : T|null
- forEach() : void
- get() : T|null
- getIterator() : Traversable<int, T>
- map() : array<int, ReturnT>
- remove() : void
Methods
__clone()
public
__clone() : void
__construct()
public
__construct(array<int, T> ...$items) : mixed
Parameters
- $items : array<int, T>
Tags
add()
public
add(T $item) : void
Parameters
- $item : T
Tags
all()
public
all() : array<int, T>
Return values
array<int, T>clear()
public
clear() : void
contains()
public
contains(T $item) : bool
Parameters
- $item : T
Return values
boolcount()
public
count() : int
Return values
intempty()
public
empty() : bool
Return values
boolfilter()
public
filter(callable(T): bool $callback) : self
Parameters
- $callback : callable(T): bool
Tags
Return values
selffirst()
public
first() : T|null
Return values
T|nullforEach()
public
forEach(callable(T): void $callback) : void
Parameters
- $callback : callable(T): void
get()
public
get(int $index) : T|null
Parameters
- $index : int
Return values
T|nullgetIterator()
public
getIterator() : Traversable<int, T>
Return values
Traversable<int, T>map()
public
map(callable(T): ReturnT $callback) : array<int, ReturnT>
Parameters
- $callback : callable(T): ReturnT
Tags
Return values
array<int, ReturnT>remove()
public
remove(int $index) : void
Parameters
- $index : int