Joywork/import/Clock/MutableClock.php

28 lines
382 B
PHP
Raw Permalink Normal View History

2026-05-22 20:21:54 +02:00
<?php
final class MutableClock implements Clock
{
/**
* @var string
*/
private $time;
public function __construct()
{
$this->time = 'now';
}
public function setTime($time)
{
$this->time = $time;
}
/**
* {@inheritdoc}
*/
public function now()
{
return new \DateTimeImmutable($this->time);
}
}