Skip to content

Commit eb7baf3

Browse files
authored
Make sure the usleep() method always takes an integer parameter (#44357)
1 parent f414f9d commit eb7baf3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Illuminate/Support/Timebox.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function call(callable $callback, int $microseconds)
2424

2525
$result = $callback($this);
2626

27-
$remainder = $microseconds - ((microtime(true) - $start) * 1000000);
27+
$remainder = intval($microseconds - ((microtime(true) - $start) * 1000000));
2828

2929
if (! $this->earlyReturn && $remainder > 0) {
3030
$this->usleep($remainder);
@@ -60,10 +60,10 @@ public function dontReturnEarly()
6060
/**
6161
* Sleep for the specified number of microseconds.
6262
*
63-
* @param $microseconds
63+
* @param int $microseconds
6464
* @return void
6565
*/
66-
protected function usleep($microseconds)
66+
protected function usleep(int $microseconds)
6767
{
6868
usleep($microseconds);
6969
}

0 commit comments

Comments
 (0)