ergebnis / clock
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * Copyright (c) 2018-2020 Andreas Möller
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE.md file that was distributed with this source code.
10
 *
11
 * @see https://github.com/ergebnis/clock
12
 */
13

14
namespace Ergebnis\Clock;
15

16
final class FrozenClock implements Clock
17
{
18
    private $now;
19

20 1
    public function __construct(\DateTimeImmutable $now)
21
    {
22 1
        $this->now = $now;
23
    }
24

25 1
    public function now(): \DateTimeImmutable
26
    {
27 1
        return $this->now;
28
    }
29
}

Read our documentation on viewing source code .

Loading