mirror of
https://github.com/ConvoyPanel/panel.git
synced 2026-06-09 11:36:46 +08:00
23 lines
484 B
PHP
23 lines
484 B
PHP
<?php
|
|
|
|
namespace Convoy\Extensions\Lcobucci\JWT\Validation;
|
|
|
|
use DateTimeImmutable;
|
|
use Carbon\CarbonInterface;
|
|
use Carbon\CarbonImmutable;
|
|
use Psr\Clock\ClockInterface;
|
|
|
|
class Clock implements ClockInterface
|
|
{
|
|
private CarbonInterface $date;
|
|
|
|
public function __construct(?CarbonInterface $date = null) {
|
|
$this->date = $date ?? CarbonImmutable::now();
|
|
}
|
|
|
|
public function now(): DateTimeImmutable
|
|
{
|
|
return $this->date->toDateTimeImmutable();
|
|
}
|
|
}
|