diff --git a/composer.json b/composer.json index de4e92f..33be175 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "codeinc/collection-interface", - "version": "1.0.0", + "version": "1.1.0", "description": "A simple PHP interface for iterable collections", "homepage": "https://github.com/CodeIncHQ/CollectionInterface", "type": "library", diff --git a/src/AggregatedCollectionInterface.php b/src/AggregatedCollectionInterface.php new file mode 100644 index 0000000..c632b9a --- /dev/null +++ b/src/AggregatedCollectionInterface.php @@ -0,0 +1,33 @@ + +// Date: 24/09/2018 +// Project: CollectionInterface +// +declare(strict_types=1); +namespace CodeInc\CollectionInterface; + +/** + * Interface AggregatedCollectionInterface + * + * @package CodeInc\CollectionInterface + * @author Joan Fabrégat + */ +interface AggregatedCollectionInterface extends CollectionInterface, \IteratorAggregate +{ + +} \ No newline at end of file diff --git a/src/CollectionInterface.php b/src/CollectionInterface.php index 74f36c4..c68dfe5 100644 --- a/src/CollectionInterface.php +++ b/src/CollectionInterface.php @@ -26,29 +26,8 @@ * * @package CodeInc\CollectionInterface * @author Joan Fabrégat - * @version 1.0 */ -interface CollectionInterface extends \Iterator, \Countable +interface CollectionInterface extends \Traversable { - /** - * @inheritdoc - */ - public function rewind():void; - /** - * @inheritdoc - */ - public function next():void; - - /** - * @inheritdoc - * @return bool - */ - public function valid():bool; - - /** - * @inheritdoc - * @return int - */ - public function count():int; } \ No newline at end of file diff --git a/src/CountableCollectionInterface.php b/src/CountableCollectionInterface.php new file mode 100644 index 0000000..6035687 --- /dev/null +++ b/src/CountableCollectionInterface.php @@ -0,0 +1,37 @@ + +// Date: 24/09/2018 +// Project: CollectionInterface +// +declare(strict_types=1); +namespace CodeInc\CollectionInterface; + +/** + * Interface CountableCollectionInterface + * + * @package CodeInc\CollectionInterface + * @author Joan Fabrégat + */ +interface CountableCollectionInterface extends CollectionInterface, \Countable +{ + /** + * @inheritdoc + * @return int + */ + public function count():int; +} \ No newline at end of file diff --git a/src/IteratorCollectionInterface.php b/src/IteratorCollectionInterface.php new file mode 100644 index 0000000..3aa95b7 --- /dev/null +++ b/src/IteratorCollectionInterface.php @@ -0,0 +1,47 @@ + +// Date: 24/09/2018 +// Project: CollectionInterface +// +declare(strict_types=1); +namespace CodeInc\CollectionInterface; + +/** + * Interface IteratorCollectionInterface + * + * @package CodeInc\CollectionInterface + * @author Joan Fabrégat + */ +interface IteratorCollectionInterface extends CollectionInterface, \Iterator +{ + /** + * @inheritdoc + */ + public function rewind():void; + + /** + * @inheritdoc + */ + public function next():void; + + /** + * @inheritdoc + * @return bool + */ + public function valid():bool; +} \ No newline at end of file