• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tempestphp / tempest-framework / 14639629920

24 Apr 2025 10:41AM UTC coverage: 80.923%. First build
14639629920

Pull #1158

github

web-flow
Merge 11a3af0ac into 06be1af98
Pull Request #1158: feat(datetime): add datetime component

1099 of 1227 new or added lines in 39 files covered. (89.57%)

12849 of 15878 relevant lines covered (80.92%)

100.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/Tempest/Clock/src/GenericClock.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Clock;
6

7
use Psr\Clock\ClockInterface;
8
use Tempest\DateTime\DateTime;
9
use Tempest\DateTime\DateTimeInterface;
10
use Tempest\DateTime\Duration;
11
use Tempest\DateTime\Timestamp;
12

13
use const Tempest\DateTime\MILLISECONDS_PER_SECOND;
14

15
final class GenericClock implements Clock
16
{
NEW
17
    public function toPsrClock(): ClockInterface
×
18
    {
NEW
19
        return new PsrClock($this);
×
20
    }
21

22
    public function now(): DateTimeInterface
59✔
23
    {
24
        return DateTime::now();
59✔
25
    }
26

27
    public function timestamp(): int
59✔
28
    {
29
        return Timestamp::monotonic()->getSeconds();
59✔
30
    }
31

NEW
32
    public function timestampMs(): int
×
33
    {
NEW
34
        return Timestamp::monotonic()->getMilliseconds();
×
35
    }
36

37
    public function sleep(int|Duration $milliseconds): void
2✔
38
    {
39
        if ($milliseconds instanceof Duration) {
2✔
40
            $milliseconds = (int) $milliseconds->getTotalMilliseconds();
1✔
41
        }
42

43
        usleep($milliseconds * MILLISECONDS_PER_SECOND);
2✔
44
    }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc