__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Lcobucci\Clock;
use DateTimeImmutable;
use DateTimeZone;
use function interface_exists;
if (! interface_exists(Clock::class)) {
interface Clock
{
/** @return DateTimeImmutable */
public function now();
}
final class FrozenClock implements Clock
{
/** @var DateTimeImmutable */
private $now;
public function __construct(DateTimeImmutable $now)
{
$this->now = $now;
}
/** @return self */
public static function fromUTC()
{
return new self(new DateTimeImmutable('now', new DateTimeZone('UTC')));
}
public function setTo(DateTimeImmutable $now)
{
$this->now = $now;
}
public function now()
{
return $this->now;
}
}
final class SystemClock implements Clock
{
/** @var DateTimeZone */
private $timezone;
public function __construct(DateTimeZone $timezone)
{
$this->timezone = $timezone;
}
/** @return self */
public static function fromUTC()
{
return new self(new DateTimeZone('UTC'));
}
/** @return self */
public static function fromSystemTimezone()
{
return new self(new DateTimeZone(date_default_timezone_get()));
}
public function now()
{
return new DateTimeImmutable('now', $this->timezone);
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| class-aliases.php | File | 283 B | 0664 |
|
| json-exception-polyfill.php | File | 128 B | 0664 |
|
| lcobucci-clock-polyfill.php | File | 1.49 KB | 0664 |
|