Debian Codegraph @

lib/3rdParty/composer/facile-it/php-jose-verifier/src/Internal/InternalClock.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Facile\JoseVerifier\Internal;
6
7 use DateTimeImmutable;
8 use Psr\Clock\ClockInterface;
9
10 /**
11 * @internal
12 */
13 final class InternalClock implements ClockInterface
14 {
15 private ?DateTimeImmutable $now;
16
17 public function __construct(?DateTimeImmutable $dateTime = null)
18 {
19 $this->now = $dateTime;
20 }
21
22 public function now(): DateTimeImmutable
23 {
24 return $this->now ?? new DateTimeImmutable();
25 }
26 }