updated-packages
This commit is contained in:
@@ -68,7 +68,7 @@ class ResultPaginator implements \Iterator
|
||||
*/
|
||||
public function each(callable $handleResult)
|
||||
{
|
||||
return Promise\coroutine(function () use ($handleResult) {
|
||||
return Promise\Coroutine::of(function () use ($handleResult) {
|
||||
$nextToken = null;
|
||||
do {
|
||||
$command = $this->createNextCommand($this->args, $nextToken);
|
||||
@@ -76,7 +76,7 @@ class ResultPaginator implements \Iterator
|
||||
$nextToken = $this->determineNextToken($result);
|
||||
$retVal = $handleResult($result);
|
||||
if ($retVal !== null) {
|
||||
yield Promise\promise_for($retVal);
|
||||
yield Promise\Create::promiseFor($retVal);
|
||||
}
|
||||
} while ($nextToken);
|
||||
});
|
||||
@@ -101,21 +101,25 @@ class ResultPaginator implements \Iterator
|
||||
/**
|
||||
* @return Result
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
return $this->valid() ? $this->result : false;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
{
|
||||
return $this->valid() ? $this->requestCount - 1 : null;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
{
|
||||
$this->result = null;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
{
|
||||
if ($this->result) {
|
||||
@@ -134,6 +138,7 @@ class ResultPaginator implements \Iterator
|
||||
return false;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->requestCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user