kununu / collections
To reduce boilerplate associated with collections
Installs: 5 550
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 0
Open Issues: 0
Requires
- php: >=8.1
Requires (Dev)
- kununu/scripts: >=4.0
- phpunit/phpunit: ^10.5
README
The goal of this library is to provide some boilerplate code to assist you in creating more friendly collections when using ArrayIterator
.
Install
You can use this library by issuing the following command:
composer require kununu/collections
Running Tests
Run the tests by doing:
composer install vendor/bin/phpunit
or
composer install
composer test
To run test and generate coverage information:
composer install composer test-coverage
Usage
The library provide three traits that you can add to your custom class extending ArrayIterator
.
It defines interfaces to convert collection items to array
, string
and int
and to compare items.
It also provides some interfaces to filter and group data on your collections and base classes with default implementations.
More details:
- Collection Trait
- Filterable Collection Trait
- Auto Sortable OffsetSet Trait
- Convertible
- Abstract Collections
- Abstract Item
- Mapper
Contribute
If you are interested in contributing read our contributing guidelines.