library trait-iterator
A Trait for the iterator-interface
org_heigl/trait-iterator
A Trait for the iterator-interface
- Thursday, September 29, 2016
- by heiglandreas
- Repository
- 1 Watchers
- 0 Stars
- 676 Installations
- PHP
- 2 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 12 % Grown
IteratorTrait
Often used implementation of the IteratorInterface, (*1)
Installation
composer require org_heigl/trait-iterator
Usage
Add it to a class like this:, (*2)
use Org_Heigl\IteratorTrait\IteratorTrait;
class MyList implements \Iterator
{
use IteratorTrait;
/** Can be an array or an Object implementing traversable */
protected $yourArrayToIterateOver = [];
public function & getIterableElement()
{
return $yourArrayToIterateOver
}
}
The rest of the Iterator implementation is handled within the IteratorTrait., (*3)
Issues
Feel free to drop an issue on github when you need help., (*4)
dev-master
9999999-dev
A Trait for the iterator-interface
Sources
Download
MIT
The Development Requires
trait
iterator
interface
1.1.0
1.1.0.0
A Trait for the iterator-interface
Sources
Download
MIT
The Development Requires
trait
iterator
interface
1.0.0
1.0.0.0
A Trait for the iterator-interface
Sources
Download
MIT
trait
iterator
interface