2017 © Pedro Peláez
 

library trait-iterator

A Trait for the iterator-interface

image

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

The README.md

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)

The Versions

29/09 2016

dev-master

9999999-dev

A Trait for the iterator-interface

  Sources   Download

MIT

The Development Requires

trait iterator interface

29/09 2016

1.1.0

1.1.0.0

A Trait for the iterator-interface

  Sources   Download

MIT

The Development Requires

trait iterator interface

27/03 2016

1.0.0

1.0.0.0

A Trait for the iterator-interface

  Sources   Download

MIT

trait iterator interface