Skip to content

Commit

Permalink
fix type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptouuuu committed Dec 10, 2019
1 parent e4554d9 commit 2e42f35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Sequence/Defer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function __construct(string $type, \Generator $generator)
$this->type = $type;
$validate = Type::of($type);
$this->values = new Accumulate((function(\Generator $generator, ValidateArgument $validate): \Generator {
/** @var T $value */
foreach ($generator as $value) {
$validate($value, 1);
yield $value;
Expand Down
1 change: 1 addition & 0 deletions src/Sequence/Lazy.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function __construct(string $type, callable $generator)
$validate = Type::of($type);
/** @var \Closure(): \Generator<T> */
$this->values = \Closure::fromCallable(static function() use ($generator, $validate): \Generator {
/** @var T $value */
foreach ($generator() as $value) {
$validate($value, 1);
yield $value;
Expand Down

0 comments on commit 2e42f35

Please sign in to comment.