tubul / iterator
Class for chainable operations on iterables
1.1.1
2024-01-24 21:54 UTC
Requires
- php: ^8.2
Requires (Dev)
- ext-pcov: *
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^10
- psalm/plugin-phpunit: ^0.18.4
- vimeo/psalm: ^5
README
Class for chainable operations on iterables.
Example:
$abc = new \Tubul\Iterator(['a', 'b', 'c']);
echo $abc
->map(fn($value) => ucfirst($value)) // 'A', 'B', 'C'
->filter(fn($value) => $value !== 'B') // 'A', 'C'
->skip() // 'C'
->first(); // outputs 'C'
Homepage: https://code.tubul.net/Tubul/iterator