Skip to content

Commit

Permalink
Ignore new psalm false-positives
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Nov 22, 2021
1 parent 38bda20 commit dc9fbe7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/EventLoop/Driver/StreamSelectDriver.php
Expand Up @@ -287,11 +287,13 @@ private function selectStreams(array $read, array $write, float $timeout): void
}

if ($timeout < 0) { // Only signal callbacks are enabled, so sleep indefinitely.
/** @psalm-suppress ArgumentTypeCoercion */
\usleep(\PHP_INT_MAX);
return;
}

if ($timeout > 0) { // Sleep until next timer expires.
/** @psalm-var positive-int $timeout */
\usleep((int) ($timeout * 1_000_000));
}
}
Expand Down

0 comments on commit dc9fbe7

Please sign in to comment.