Commit Graph

3 Commits

Author SHA1 Message Date
Daniele Alessandri 9da1648145 Mostly useless tweak for iterators example. 2013-11-07 12:10:04 +01:00
Daniele Alessandri 5ad00774e1 Rename for the last time all the iterator classes.
We are experimenting with a new approach at naming classes using less
redundant names by leveraging the containing namespace. The PHP "use"
directive is not limited to class names but can be used to import the
whole namespace, which means you can do something like this:

  use Predis\Collection\Iterator;
  // ...
  foreach (new Iterator\Keyspace($client) as $key) {
  	// ...
  }

Alternatively you can always rely on "use ... as ..." to import one of
the classes by giving it a more meaningful name in the context of the
root namespace:

  use Predis\Collection\Iterator\Keyspace as KeyspaceIterator;
  // ...
  foreach (new KeyspaceIterator($client) as $key) {
  	// ...
  }

In this specific case we chose to apply the -Key postfix to classes
iterating Redis keys to be more explicit about the fact that those
iterators does not work on local in-memory collections, but fetch
items from a key stored on a remote Redis server.
2013-11-07 12:09:59 +01:00
Daniele Alessandri df2c9eb7ff Move Redis collections iterators in a different namespace.
The base iterator class is now known as RedisCollectionIterator and
we've also renamed a few methods to make their naming more generic.
2013-11-06 16:19:12 +01:00