lcobucci/clock
Small PHP clock abstraction to decouple your code from direct DateTimeImmutable instantiation. Depend on the Clock interface and use SystemClock for real time or FrozenClock for deterministic tests, with explicit timezone support.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| eventsauce/clock | 0.91 | Simple clock abstraction for PHP. Use SystemClock in production and TestClock in tests to control time deterministically. Get now() as DateTimeImmutable, access timeZone(), move time forward, tick to system time, or fixate to a specific moment. | 3 | 3 | 2 | 35K | 0 | 0.1 | 54.2 | — | — | |
| symfony/clock | 0.90 | Symfony Clock decouples your app from the system clock via a ClockInterface. Swap real and test clocks, get DateTimeImmutable “now()” values, control time zones, and pause execution with sleep()—ideal for time-sensitive code and reliable testing. | 431 | 432 | 3 | 11M | 0 | 32.4 | 65.0 | MIT | 1 week ago | |
| digital-craftsman/date-time-precision | 0.89 | Thin PHP value objects for precise date/time concepts: Moment (UTC-backed) plus Time, Date, Month, Year, Day, Weekday and collections. Avoid misleading DateTime comparisons, handle timezone-safe modifications (DST), with Symfony normalizers and Doctrine types. | 0 | 0 | 0 | 95 | 5 | 25.5 | 32.7 | MIT | 2 months ago | |
| comsolit/clock-bundle | 0.89 | — | 0 | 0 | 1 | 2 | 4 | 1.0 | 7.3 | — | — | |
| digital-craftsman/datetime-parts | 0.89 | Value objects for precise date/time parts in PHP: Moment (UTC-based) plus Time, Date, Month, Year, Day/Weekday and collections. Avoid misleading DateTime comparisons, handle timezone-safe modifications across DST, with Symfony normalizers and Doctrine types. | 0 | 0 | 0 | 0 | 5 | 25.3 | 2.2 | MIT | 2 months ago | |
| beste/clock | 0.88 | beste/clock is a lightweight PHP clock implementation for time-dependent code. It provides a simple, test-friendly way to obtain the current time, swap in fixed or mock clocks, and improve determinism across your application and automated tests. | 74 | 74 | 1 | 1M | 0 | 2.5 | 55.3 | MIT | 3 years ago | |
| alexeyshockov/clock | 0.87 | — | 2 | 2 | 2 | 0 | 6 | 0.8 | 1.1 | — | — | |
| sanmai/duoclock | 0.81 | PSR-20 clock abstraction with dual time access (DateTimeImmutable, time(), microtime()) plus mockable sleep/usleep/nanosleep for testing. Includes deterministic TimeSpy and tick helpers to measure elapsed time. Minimal dependency (psr/clock) and easy to mock. | 3 | 3 | 1 | 549K | 0 | 12.4 | 60.7 | Apache-2.0 | 5 months ago |
How can I help you explore Laravel packages today?