CoreFiles by mySites.guru
FrozenClock.php29 lines, 539 bytes, from Joomla_5.2.3-Stable-Full_Package.zip
Raw History Compare with 5.2.2
md5
ebd4462502fce5ca520620470fbcc596
sha1
aadf0b84eea00b5ba5703b6e9f40211eabe07769
sha256
d23dfd67f583c8b35c4c7a55de624ddae6ed7e474592fd2d436a1122b6f6f1e8
<?php
declare(strict_types=1);

namespace 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;
    }
}

The same content is in 109 releases, Joomla 5.0.0-alpha1 to 6.0.0-alpha3. See them all, or every version of this file.