Download the PHP package jeroen/rewindable-generator without Composer
On this page you can find all versions of the php package jeroen/rewindable-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeroen/rewindable-generator
More information about jeroen/rewindable-generator
Files in jeroen/rewindable-generator
Package rewindable-generator
Short Description Provides a simple adapter to make generators rewindable
License GPL-2.0+
Homepage https://github.com/JeroenDeDauw/RewindableGenerator
Informations about the package rewindable-generator
Rewindable Generator
Provides a simple adapter to make generators rewindable. Please beware that you can do the same by using PHPs native CachingIterator
.
Unfortunately, you cannot do this:
Or this:
Both result in an Exception
, as proven by the tests in tests/GeneratorTest.php
. This library provides
a simple class that takes a generator function (the function, not its return value) and adapts it to
a rewindable Iterator
.
Installation
To add this package as a local, per-project dependency to your project, simply add a
dependency on jeroen/rewindable-generator
to your project's composer.json
file.
Here is a minimal example of a composer.json
file that just defines a dependency on
Rewindable Generator 1.x:
Running the tests
For tests only
composer test
For style checks only
composer cs
For a full CI run
composer ci
Release notes
Version 1.2.0 (2017-05-16)
- Dropped PHP 5.x support
Version 1.1.1 (2015-11-08)
- Fixed HHVM compatibility. Maybe...
Version 1.1.0 (2015-11-08)
- Added
onRewind
function and second constructor parameter toRewindableGenerator
Version 1.0.0 (2015-11-08)
- Initial release - read blog post