Skip to content
Permalink
Browse files

Extracting collection definition into an interface

  • Loading branch information...
lorenzo committed Sep 23, 2014
1 parent 406d1ed commit edefed1be5d89ee923b6466f2c82e341f031d4b9
Showing with 33 additions and 555 deletions.
  1. +2 −10 src/Collection/Collection.php
  2. +31 −545 src/Collection/CollectionTrait.php
@@ -15,6 +15,7 @@
namespace Cake\Collection;
use ArrayIterator;
use Cake\Collection\CollectionInterface;
use Cake\Collection\CollectionTrait;
use InvalidArgumentException;
use IteratorIterator;
@@ -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;
@@ -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;
}
}
Oops, something went wrong.

0 comments on commit edefed1

Please sign in to comment.
You can’t perform that action at this time.