Skip to content

Commit

Permalink
Extracting collection definition into an interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Sep 23, 2014
1 parent 406d1ed commit edefed1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 555 deletions.
12 changes: 2 additions & 10 deletions src/Collection/Collection.php
Expand Up @@ -15,6 +15,7 @@
namespace Cake\Collection;

use ArrayIterator;
use Cake\Collection\CollectionInterface;
use Cake\Collection\CollectionTrait;
use InvalidArgumentException;
use IteratorIterator;
Expand All @@ -24,7 +25,7 @@
* A collection is an immutable list of elements with a handful of functions to
* iterate, group, transform and extract information from it.
*/
class Collection extends IteratorIterator implements JsonSerializable {
class Collection extends IteratorIterator implements CollectionInterface {

use CollectionTrait;

Expand All @@ -47,13 +48,4 @@ public function __construct($items) {
parent::__construct($items);
}

/**
* Returns the iterator with this collection's elements
*
* @return \Traversable
*/
public function getIterator() {
return $this->_iterator;
}

}

0 comments on commit edefed1

Please sign in to comment.