Skip to content

Commit

Permalink
Relax type requirements for FakeTimeKeeper (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai authored Jun 21, 2023
1 parent 8cfeb07 commit f74c2f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/FakeTimeKeeper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ class FakeTimeKeeper extends TimeKeeper
/**
* FakeTimeKeeper constructor.
*
* @param float $current_unix_time Optional unix time to mock time() and microtime(true)
* @param float|int $current_unix_time Optional unix time to mock time() and microtime(true)
*/
public function __construct(float $current_unix_time = 0.0)
public function __construct($current_unix_time = 0.0)
{
$this->setCurrentUnixTime($current_unix_time);
}

/**
* @param float $current_unix_time Current unix timestamp (int seconds) to mimic
* @param float|int $current_unix_time Current unix timestamp (int seconds) to mimic
*/
public function setCurrentUnixTime(float $current_unix_time): void
public function setCurrentUnixTime($current_unix_time): void
{
$this->current_unix_time = (int) $current_unix_time;
$this->current_unix_time_float = $current_unix_time;
$this->current_unix_time_float = (float) $current_unix_time;
$this->current_microsecond_time = (int) ($current_unix_time * self::MICROSECONDS_PER_SECOND);
}

Expand Down

0 comments on commit f74c2f1

Please # to comment.