Skip to content

Commit e479913

Browse files
authored
Merge pull request #110 from Deluxo/fix/return-declarations
fix: list & iterator return declarations
2 parents 73006eb + 5201dfc commit e479913

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Primitive/ListtCons.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(callable $next)
3535
/**
3636
* @inheritdoc
3737
*/
38-
public function getIterator()
38+
public function getIterator(): \Traversable
3939
{
4040
$tail = $this;
4141
do {

src/Primitive/ListtNil.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function tail(): Listt
127127
/**
128128
* @inheritdoc
129129
*/
130-
public function getIterator()
130+
public function getIterator(): \Traversable
131131
{
132132
return new \ArrayObject();
133133
}

src/Useful/SnapshotIterator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SnapshotIterator extends \IteratorIterator
1010
private $inMemoryCurrent;
1111
private $inSnapshot;
1212

13-
public function valid()
13+
public function valid(): bool
1414
{
1515
if (null === $this->inMemoryValid) {
1616
$this->inMemoryValid = parent::valid();
@@ -19,7 +19,7 @@ public function valid()
1919
return $this->inMemoryValid;
2020
}
2121

22-
public function current()
22+
public function current(): mixed
2323
{
2424
if (null === $this->inMemoryCurrent) {
2525
$this->inMemoryCurrent = parent::current();

0 commit comments

Comments
 (0)