Skip to content

Commit

Permalink
Add return type to IteratorAggregate interface methods
Browse files Browse the repository at this point in the history
  • Loading branch information
BackEndTea authored and spaze committed Jul 1, 2023
1 parent da68d5e commit 7da5e66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/libs/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use EmptyIterator;
use IteratorAggregate;
use ArrayIterator;
use Traversable;

/**
* @template T
Expand Down Expand Up @@ -62,7 +63,7 @@ public static function create()
return self::$instance;
}

public function getIterator()
public function getIterator(): Traversable
{
return new EmptyIterator();
}
Expand Down Expand Up @@ -104,7 +105,7 @@ public static function create($value)
}


public function getIterator()
public function getIterator(): Traversable
{
return new ArrayIterator([$this->value]);
}
Expand Down

0 comments on commit 7da5e66

Please sign in to comment.