Skip to content

Commit

Permalink
docs: Update typing information.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 26, 2021
1 parent 34d626c commit 0f2d096
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Operation/Last.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ static function (Iterator $iterator): Iterator {
return new EmptyIterator();
}

/**
* @psalm-var TKey $key
* @psalm-var T $current
*/
return yield $key => $current;
};
}
Expand Down
5 changes: 4 additions & 1 deletion src/Operation/Unfold.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ public function __invoke(): Closure
*/
static function () use ($parameters, $callback): Generator {
while (true) {
yield $parameters = $callback(...array_values((array) $parameters));
/** @psalm-var T $parameters */
$parameters = $callback(...array_values((array) $parameters));

yield $parameters;
}
};
}
Expand Down
5 changes: 4 additions & 1 deletion src/Operation/Unwindow.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ public function __invoke(): Closure
/**
* @psalm-param iterable<TKey, list<T>> $iterable
*
* @psalm-return T
* @psalm-return T|null
*/
static function (iterable $iterable) {
$value = null;

/** @psalm-var T $value */
foreach ($iterable as $value) {
}

Expand Down

0 comments on commit 0f2d096

Please sign in to comment.