This commit is contained in:
TiclemFR
2023-12-29 16:00:02 +01:00
parent 9d79d7c0c6
commit 884eb3011a
8361 changed files with 1160554 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace Spatie\FlareClient\Concerns;
use Spatie\FlareClient\Time\SystemTime;
use Spatie\FlareClient\Time\Time;
trait UsesTime
{
public static Time $time;
public static function useTime(Time $time): void
{
self::$time = $time;
}
public function getCurrentTime(): int
{
$time = self::$time ?? new SystemTime();
return $time->getCurrentTime();
}
}