Download the PHP package dhii/iterator-interface without Composer
On this page you can find all versions of the php package dhii/iterator-interface. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dhii/iterator-interface
More information about dhii/iterator-interface
Files in dhii/iterator-interface
Package iterator-interface
Short Description Interfaces for standard iterators
License MIT
Informations about the package iterator-interface
Dhii - Iterator - Interface
Details
An iterator standard, which aims to provide more information about each iteration by exposing an immutable iteration
object. This object can be safely passed to other methods, even those which save the reference to it, as a new object
is created for every iteration. That object can provide additional information besides the current key and value.
This makes implementations of this standard easier to work with than other iterator implementations, such as
DirectoryIterator
, which expose iteration data through the iterator itself, instead of a separate object, making
it hard to keep iteration data immutable. The fact that its manipulator methods are allowed to throw a specific type
of exception make it possible to create more reliable consumers with meaningful error reporting.
Features
- All standards-compliant iterators are PHP iterators.
- Iteration information provided via immutable and extensible iteration objects.
- Easier to keep track of iteration information: each iteration produces a separate iteration object.
- Specialized iterator types can be created on interface level by promising custom iteration types.
Interfaces
Iterator
by exposing a disposable iteration object. Also promises to throw a specific kind of meaningful exception when rewinding or advancing.IterationInterface
- Exposes the key and the value of an iteration.IteratorAwareInterface
- Exposes an iterator.RecursiveIteratorInterface
- An iterator that iterates over other iterators recursively.RecursiveIterationInterface
- An iteration of a recursive iterator. Exposes the depth of the iterator hierarchy, and the path to the current iteration in that hierarchy.DepthAwareIterationInterface
- An iteration that can tell how deep it is in a hierarchy.PathSegmentsAwareIterationInterface
- An iteration that can tell the path to itself in a hierarchy.IteratingExceptionInterface
- An exception that can occur during iteration.IterationExceptionInterface
- An iterating exception that relates to an iteration.IteratorExceptionInterface
- An iteration exception that relates to an iterator.
All versions of iterator-interface with dependencies
dhii/data-key-value-aware-interface Version ^0.1
dhii/data-path-aware-interface Version ^0.1
dhii/data-hierarchy-interface Version ^0.1
dhii/exception-interface Version ^0.1 | ^0.2