1
0
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:
Daniil Gentili 2021-04-21 15:41:15 +02:00
parent db84c4851f
commit b1941cc6a7
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
4 changed files with 6 additions and 3 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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
*