| Total Complexity | 8 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class TestClock implements Clock |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @private |
||
| 16 | */ |
||
| 17 | const FORMAT_OF_TIME = 'Y-m-d H:i:s.uO'; |
||
| 18 | private DateTimeImmutable $time; |
||
| 19 | private DateTimeZone $timeZone; |
||
| 20 | |||
| 21 | public function __construct(DateTimeZone $timeZone = null) |
||
| 25 | } |
||
| 26 | |||
| 27 | public function tick(): void |
||
| 28 | { |
||
| 29 | $this->time = new DateTimeImmutable('now', $this->timeZone); |
||
| 30 | 27 | } |
|
| 31 | |||
| 32 | 27 | public function fixate(string $input): void |
|
| 42 | } |
||
| 43 | 3 | ||
| 44 | 3 | public function moveForward(DateInterval $interval): void |
|
| 45 | { |
||
| 46 | 3 | $this->time = $this->now()->add($interval); |
|
| 47 | 1 | } |
|
| 48 | |||
| 49 | public function now(): DateTimeImmutable |
||
| 50 | 2 | { |
|
| 51 | 2 | return $this->time; |
|
| 52 | } |
||
| 53 | 1 | ||
| 54 | public function timeZone(): DateTimeZone |
||
| 57 | } |
||
| 58 | } |
||
| 59 |