jlaso / iterators
Several iterators
dev-master
2016-10-02 17:17 UTC
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2024-11-15 10:54:40 UTC
README
installation
composer require jlaso/itearators
variable-iterator
simplifies the use of a complex array to iterate over all the possibilities
how to use
use JLaso\Iterators\VariableIterator; $iterator = new VariableIterator([ 'genre' => ['W', 'M', '?'], 'ages' => ['18-25', '26-58', '+59'], 'profession' => ['engineer', 'services', 'others'], 'holidays' => ['none', '1-10', '+10'], ]); foreach ($iterator as $item) { // you have in every $item the current mix of variations }
unit testing
vendor/bin/phpunit