D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
lcobucci
/
clock
/
src
/
Filename :
FrozenClock.php
back
Copy
<?php declare (strict_types=1); namespace WPToolkitDependenciesIsolationPrefix\Lcobucci\Clock; use DateTimeImmutable; use DateTimeZone; final class FrozenClock implements Clock { public function __construct(private DateTimeImmutable $now) { } public static function fromUTC() : self { return new self(new DateTimeImmutable('now', new DateTimeZone('UTC'))); } public function setTo(DateTimeImmutable $now) : void { $this->now = $now; } public function now() : DateTimeImmutable { return $this->now; } }