projects
/
php-functional.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0005c22
)
ListtNil works nicely with function based on Iterator
author
widmogrod
<widmogrod@gmail.com>
Wed, 13 Jun 2018 21:06:54 +0000
(23:06 +0200)
committer
widmogrod
<widmogrod@gmail.com>
Wed, 13 Jun 2018 21:06:54 +0000
(23:06 +0200)
src/Primitive/ListtNil.php
patch
|
blob
|
history
diff --git
a/src/Primitive/ListtNil.php
b/src/Primitive/ListtNil.php
index
c2a4c00
..
21bb8ec
100644
(file)
--- a/
src/Primitive/ListtNil.php
+++ b/
src/Primitive/ListtNil.php
@@
-4,10
+4,10
@@
declare(strict_types=1);
namespace Widmogrod\Primitive;
-use Widmogrod\Common;
use FunctionalPHP\FantasyLand;
+use Widmogrod\Common;
-class ListtNil implements Listt
+class ListtNil implements Listt
, \IteratorAggregate
{
use Common\PointedTrait;
@@
-123,4
+123,12
@@
class ListtNil implements Listt
{
throw new EmptyListError(__FUNCTION__);
}
+
+ /**
+ * @inheritdoc
+ */
+ public function getIterator()
+ {
+ return new \ArrayObject();
+ }
}