mirror of
https://github.com/danog/loop.git
synced 2024-11-30 04:19:04 +01:00
Cs-fix and psalm fixes
This commit is contained in:
parent
db84c4851f
commit
b1941cc6a7
@ -41,7 +41,7 @@ interface ResumableLoopInterface extends LoopInterface
|
||||
public function resumeDefer(): Promise;
|
||||
/**
|
||||
* Defer resuming the loop to next tick.
|
||||
*
|
||||
*
|
||||
* Multiple consecutive calls will yield only one resume.
|
||||
*
|
||||
* @return Promise Resolved when the loop is paused again
|
||||
|
@ -67,6 +67,7 @@ trait ResumableLoop
|
||||
AmpLoop::cancel($this->resumeTimer);
|
||||
$this->resumeTimer = null;
|
||||
}
|
||||
/** @psalm-suppress MixedArgumentTypeCoercion */
|
||||
$this->resumeTimer = AmpLoop::delay($time, \Closure::fromCallable([$this, 'resumeInternal']));
|
||||
}
|
||||
|
||||
@ -103,6 +104,7 @@ trait ResumableLoop
|
||||
*/
|
||||
public function resumeDefer(): Promise
|
||||
{
|
||||
/** @psalm-suppress MixedArgumentTypeCoercion */
|
||||
AmpLoop::defer(Closure::fromCallable([$this, 'resumeInternal']));
|
||||
if (!$this->pause) {
|
||||
$this->pause = new Deferred;
|
||||
@ -111,7 +113,7 @@ trait ResumableLoop
|
||||
}
|
||||
/**
|
||||
* Defer resuming the loop to next tick.
|
||||
*
|
||||
*
|
||||
* Multiple consecutive calls will yield only one resume.
|
||||
*
|
||||
* @return Promise Resolved when the loop is paused again
|
||||
|
@ -63,6 +63,7 @@ trait SignalLoop
|
||||
public function waitSignal($promise): Promise
|
||||
{
|
||||
if ($promise instanceof \Generator) {
|
||||
/** @psalm-suppress MixedArgumentTypeCoercion */
|
||||
$promise = new Coroutine($promise);
|
||||
}
|
||||
$this->signalDeferred = new Deferred();
|
||||
|
@ -105,7 +105,7 @@ class ResumableTest extends Fixtures
|
||||
}
|
||||
|
||||
/**
|
||||
* Test pausing loop and then resuming it with deferOnce
|
||||
* Test pausing loop and then resuming it with deferOnce.
|
||||
*
|
||||
* @param ResumableInterface $loop Loop
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user