Installation
Install Collection with Composer.
shell
composer require raxos/collectionRequirements
- PHP 8.5 or newer.
The package uses jetbrains/phpstorm-attributes for editor hints such as #[ArrayShape]. It requires no PHP extensions of its own.
Raxos dependencies
Collection builds on three other Raxos packages, which Composer installs automatically:
- contract: the collection interfaces (
ArrayListInterface,MapInterface,ValidatedArrayListInterface) and the collection exception interface that the classes implement. - error: the base
Exceptionclass thatCollectionImmutableExceptionandCollectionInvalidTypeExceptionextend. - foundation: the
ArrayUtilhelpers used forfirst,last,onlyandmergebehavior.
Return to the Collection introduction.