Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9af0ac5

Browse files
committed
always pass microseconds to sleep as integers
1 parent 2b10976 commit 9af0ac5

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Symfony/Component/HttpClient/Response/AsyncContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function pause(float $duration): void
9292
if (\is_callable($pause = $this->response->getInfo('pause_handler'))) {
9393
$pause($duration);
9494
} elseif (0 < $duration) {
95-
usleep(1E6 * $duration);
95+
usleep((int) (1E6 * $duration));
9696
}
9797
}
9898

src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public static function stream(iterable $responses, float $timeout = null): \Gene
303303
}
304304

305305
if (-1 === self::select($multi, min($timeoutMin, $timeoutMax - $elapsedTimeout))) {
306-
usleep(min(500, 1E6 * $timeoutMin));
306+
usleep((int) min(500, 1E6 * $timeoutMin));
307307
}
308308

309309
$elapsedTimeout = microtime(true) - $lastActivity;

src/Symfony/Component/Mailer/Transport/AbstractTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private function checkThrottling()
104104
$sleep = (1 / $this->rate) - (microtime(true) - $this->lastSent);
105105
if (0 < $sleep) {
106106
$this->logger->debug(sprintf('Email transport "%s" sleeps for %.2f seconds', __CLASS__, $sleep));
107-
usleep($sleep * 1000000);
107+
usleep((int) ($sleep * 1000000));
108108
}
109109
$this->lastSent = microtime(true);
110110
}

src/Symfony/Component/Process/Pipes/WindowsPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function readAndWrite(bool $blocking, bool $close = false): array
149149
if ($w) {
150150
@stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6);
151151
} elseif ($this->fileHandles) {
152-
usleep(Process::TIMEOUT_PRECISION * 1E6);
152+
usleep((int) (Process::TIMEOUT_PRECISION * 1E6));
153153
}
154154
}
155155
foreach ($this->fileHandles as $type => $fileHandle) {

0 commit comments

Comments
 (0)