MediaWiki master
ClockAdapter.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Json;
4
5use DateTimeImmutable;
6use Lcobucci\Clock\Clock;
7use Wikimedia\Timestamp\ConvertibleTimestamp;
8
9// FIXME upgrade to a more recent lcobucci/jwt version that supports PSR-20, then add support for
10// that to ConvertibleTimestamp directly
11
12class ClockAdapter implements Clock {
13
14 public function now(): DateTimeImmutable {
15 $ts = new ConvertibleTimestamp();
16 return DateTimeImmutable::createFromMutable( $ts->timestamp );
17 }
18
19}