Skip to content

Commit

Permalink
Allow Sleep::until() to be passed a timestamp as a string (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia authored Nov 2, 2023
1 parent af2bd0e commit 1c83818
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Sleep.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ public static function for($duration)
/**
* Sleep until the given timestamp.
*
* @param DateTimeInterface|int $timestamp
* @param DateTimeInterface|int|float|numeric-string $timestamp
* @return static
*/
public static function until($timestamp)
{
if (is_int($timestamp)) {
if (is_numeric($timestamp)) {
$timestamp = Carbon::createFromTimestamp($timestamp);
}

Expand Down

0 comments on commit 1c83818

Please sign in to comment.